All Projects → ts1 → Flipbook Vue

ts1 / Flipbook Vue

3D page flip effect for Vue.js

Programming Languages

coffeescript
4710 projects

Projects that are alternatives of or similar to Flipbook Vue

Cardslideview
一行代码实现ViewPager卡片效果,比ViewPager2更强大,底层同样是RecyclerView
Stars: ✭ 301 (+77.06%)
Mutual labels:  3d, page
Jxpagingview
类似微博主页、简书主页等效果。多页面嵌套,既可以上下滑动,也可以左右滑动切换页面。支持HeaderView悬浮、支持下拉刷新、上拉加载更多。
Stars: ✭ 2,309 (+1258.24%)
Mutual labels:  page
Sharpgltf
glTF reader and writer for .NET Standard
Stars: ✭ 159 (-6.47%)
Mutual labels:  3d
Hole fixer
Demo implementation of smoothly filling holes in 3D meshes using surface fairing
Stars: ✭ 165 (-2.94%)
Mutual labels:  3d
Vue Trix
Trix text editor component for Vue.js
Stars: ✭ 159 (-6.47%)
Mutual labels:  vue-component
Nginx Error Pages
Cute Error Pages for your nginx web server
Stars: ✭ 166 (-2.35%)
Mutual labels:  page
Layaair discard
This is old LayaAir veriosn writetten by ActionScript 3.0 ,now LayaAir is using TypeScript as the Engine Script,Please use https://github.com/layabox/LayaAir instead.
Stars: ✭ 1,858 (+992.94%)
Mutual labels:  3d
Vue Slider Component
🌡 A highly customized slider component
Stars: ✭ 2,158 (+1169.41%)
Mutual labels:  vue-component
Elm 3d Scene
A high-level 3D rendering engine for Elm, with support for lighting, shadows, and realistic materials.
Stars: ✭ 167 (-1.76%)
Mutual labels:  3d
Threejs Sandbox
Set of experiments and extensions to THREE.js.
Stars: ✭ 163 (-4.12%)
Mutual labels:  3d
Mundus
A 3D world/level editor built with Java, Kotlin & libGDX.
Stars: ✭ 164 (-3.53%)
Mutual labels:  3d
Pangolin
Python binding of 3D visualization library Pangolin
Stars: ✭ 157 (-7.65%)
Mutual labels:  3d
3d Iwgan
A repository for the paper "Improved Adversarial Systems for 3D Object Generation and Reconstruction".
Stars: ✭ 166 (-2.35%)
Mutual labels:  3d
Vuetify Form Base
Schema-based Form Generator - Vue.js 2.0 Component based on Vuetify 2.0
Stars: ✭ 157 (-7.65%)
Mutual labels:  vue-component
3d Boundingbox
PyTorch implementation for 3D Bounding Box Estimation Using Deep Learning and Geometry
Stars: ✭ 169 (-0.59%)
Mutual labels:  3d
Facemoji Kit
Face tracker with blend shapes coefficients, 3D head pose and dense mesh in real-time on iOS, Android, Mac, PC and Linux.
Stars: ✭ 158 (-7.06%)
Mutual labels:  3d
Anipose
🐜🐀🐒🚶 A toolkit for robust markerless 3D pose estimation
Stars: ✭ 162 (-4.71%)
Mutual labels:  3d
Dagon
3D game engine for D
Stars: ✭ 165 (-2.94%)
Mutual labels:  3d
React Three Fiber
🇨🇭 A React renderer for Three.js
Stars: ✭ 16,097 (+9368.82%)
Mutual labels:  3d
Tinykaboom
A brief computer graphics / rendering course
Stars: ✭ 2,077 (+1121.76%)
Mutual labels:  3d

flipbook-vue

npm version demo

flipbook-vue is a Vue component that displays images in 3D page flip effect.

Demo page is here.

Installation

Install as a module:

npm i -S flipbook-vue

or

yarn add flipbook-vue

Or include in html:

<script src="https://unpkg.com/flipbook-vue"></script>

Usage

<template>
  <flipbook class="flipbook" :pages="['array', 'of', 'image', 'URLs']"></flipbook>
</template>

<style>
.flipbook {
  width: 90vw;
  height: 90vh;
}
</style>

If installed as a module,

<script>
import Flipbook from 'flipbook-vue'
export default {
  components: { Flipbook }
}
</script>

If you would like to build from .vue directly (including CoffeeScript transpile, etc),

import Flipbook from 'flipbook-vue/sfc'

or

import Flipbook from 'flipbook-vue/src/Flipbook.vue'

Props

pages

Array of image URLs. Required. All images should have the same aspect ratio.

If the first element is null, the next element is displayed alone (as the cover page).

All other props are optional.

pagesHiRes

Array of high resolution versions of image URLs. They are used when zoomed.

flipDuration

Duration of page flipping animation in milliseconds. Defaults to 1000.

zoomDuration

Duration of zoom in/out animation in milliseconds. Defaults to 500.

zooms

Array of possible magnifications. null is equivalent to [1] (no zoom). Defaults to [1, 2, 4]. NOTE : Do NOT pass an empty array.

ambient

Intensity of ambient light in 0 to 1. Smaller value gives more shades. Defaults to 0.4.

gloss

Intensity of specular light in 0 to 1. Higher value gives more gloss. Defaults to 0.6.

perspective

Z-axis distance in pixels between the screen and the viewer. Higher value gives less effect. Defaults to 2400.

nPolygons

How many rectangles a single page is horizontally split into. Higher value gives higher quality rendering in exchange for performance. Defaults to 10.

singlePage

Force single page mode regardless of viewport size. Defaults to false.

forwardDirection

Reading direction. If your document is right-to-left, set this "left". Default is "right".

centering

Enable centering of the cover pages. Default is true.

startPage

Page number (>= 1) to open. Default is null.

loadingImage

URL of an image that is displayed while page is loading. By default internal animated SVG is used.

Events

flip-left-start

Fired when flip to left animation starts. Argument is page number before flip.

flip-left-end

Fired when flip to left animation ends. Argument is page number after flip.

flip-right-start

Fired when flip to right animation starts. Argument is page number before flip.

flip-right-end

Fired when flip to right animation ends. Argument is page number after flip.

zoom-start

Fired when zoom-in/out animation starts. Argument is magnification after zoom.

zoom-end

Fired when zoom-in/out animation ends. Argument is magnification after zoom.

Slot props

This component exposes some properties and methods as slot properties. Example usage:

<flipbook :pages="pages" v-slot="flipbook">
  <button @click="flipbook.flipLeft">Previous Page</button>
  <button @click="flipbook.flipRight">Next Page</button>
</flipbook>

For more practical usage, refer to src/App.vue (the demo page source).

These properties and methods can also be referred through $refs to the flipbook component.

canFlipLeft

True if it can flip to previous page. NOTE: Can return false if currently being animated.

canFlipRight

True if it can flip to next page. NOTE: Can return false if currently being animated.

canZoomIn

True if it can zoom in.

canZoomOut

True if it can zoom out.

page

Current page number (1 to numPages).

numPages

Total number of pages.

flipLeft()

Method to flip to previous page.

flipRight()

Method to flip to next page.

zoomIn()

Method to zoom in.

zoomOut()

Method to zoom out.

CSS API

You may need to specify the size of view port in your style sheet, directly to <flipbook> element, or to .viewport sub-element of flipbook.

If the size is horizontally long and singlePage prop is false (default), it displays two pages spread, suitable for desktop browsers. If it's vertically long, it displays single pages, suitable for smartphones.

There are some internal classes.

.viewport

A <div> element that contains everything but <slot>. <slot> is placed above .viewport.

.bounding-box

Approximate bounding box of the displayed images. Suitable to give box-shadow.

Browser support

Supports modern browsers and IE 11.

Server-side rendering, or Nuxt support

Server-side rendering is not supported. Configure this component rendered only on client-side. See this issue.

Development

To start development server with demo pages:

yarn
yarn serve

To package for npm:

yarn dist

License

MIT

Copyright © 2019-2020 Takeshi Sone.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].