All Projects → terrilldent → flip.js

terrilldent / flip.js

Licence: MIT License
Mobile first, flat style JavaScript Page Flip Library

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to flip.js

react-page-swapper
An orchestrator that eases out the implementation of page transitions
Stars: ✭ 16 (-38.46%)
Mutual labels:  transition
dpar
Neural network transition-based dependency parser (in Rust)
Stars: ✭ 41 (+57.69%)
Mutual labels:  transition
django-logic
Django Logic - easy way to implement state-based business logic with pure functions
Stars: ✭ 44 (+69.23%)
Mutual labels:  transition
NiceDemo
iOS project, built on improved MVP architecture using Coordinator pattern for routing 😎
Stars: ✭ 54 (+107.69%)
Mutual labels:  transition
FiniteStateMachine
This project is a finite state machine designed to be used in games.
Stars: ✭ 45 (+73.08%)
Mutual labels:  transition
vue-router-view-transition
Properly time out-in transitions with scrollBehavior
Stars: ✭ 38 (+46.15%)
Mutual labels:  transition
onscroll-effect
A tiny JavaScript library to enable CSS animations when user scrolls.
Stars: ✭ 35 (+34.62%)
Mutual labels:  transition
vue-collapse-transition
Custom Vue transition to collapse elements horizontally or vertically. Works with both fixed and 'auto' width or height.
Stars: ✭ 72 (+176.92%)
Mutual labels:  transition
ux-lab
No description or website provided.
Stars: ✭ 49 (+88.46%)
Mutual labels:  transition
drain-js
Makes smooth transitions between two numbers.
Stars: ✭ 45 (+73.08%)
Mutual labels:  transition
react-scrolling-color-background
background with color transitioning as you scroll, declarative and easy to setup
Stars: ✭ 53 (+103.85%)
Mutual labels:  transition
anim8js
The ultimate animation library for javascript - animate everything!
Stars: ✭ 33 (+26.92%)
Mutual labels:  transition
animated
🌊 Implicit animations for JavaFX.
Stars: ✭ 79 (+203.85%)
Mutual labels:  transition
react-animations-from-scratch
medium.com/@alex_holachek/building-animations-in-react-from-scratch-c66a582c9b65
Stars: ✭ 19 (-26.92%)
Mutual labels:  transition
react-layout-transition
Trying to make layout transitions simple
Stars: ✭ 57 (+119.23%)
Mutual labels:  transition
STCubeTransition
A custom view transition that provides transition between 2 different views with 3D cube rotate effect.
Stars: ✭ 16 (-38.46%)
Mutual labels:  transition
utransition
A tiny (~2KB) library providing you an easy way to manage time-based transitions
Stars: ✭ 22 (-15.38%)
Mutual labels:  transition
AniX
🐿 Super easy and lightweight(<3kb) JavaScript animation library
Stars: ✭ 253 (+873.08%)
Mutual labels:  transition
Ease-Transitions-System
Unity system to easily test and apply ease transitions/tweens to component values
Stars: ✭ 31 (+19.23%)
Mutual labels:  transition
SHTransition
SHTransition is a simple library for viewcontroller transition animation in swift.
Stars: ✭ 35 (+34.62%)
Mutual labels:  transition

flip.js

Mobile first, flat style JavaScript Page Flip Library. Cross browser support, and works on most desktop browsers.

This library creates a page folding effect using a flat visual style. No curling effects are used, and shadows are kept to a minimum.

Examples

Basic Example

Advanced Example

Basic Example

First import the CSS and JS files from the '/dist' directory into your project.

The easiest way to get started is by calling flip.basic(element). It expects the provided element to have a single child containing all the pages in the book, as in the example below.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel='stylesheet' type='text/css' media='all' href='flip.css'>
</head>
<body>

<div id="book" class="flip-book">
    <div>
        <div><h1>Title Page</h1></div>
        <div><h2>Page Two Content</h2></div>
        <div>Page Three Content</div>
        <div>Page Four Content</div>
        <div>Page Fiv Content</div>
    </div>
</div>

<script type='text/javascript' src='flip-v1.0.0.js'></script>
<script type='text/javascript'>
    window.addEventListener( 'DOMContentLoaded', function(){
        flip.basic( 'book' );
    }, true );
</script>
</body>
</html>

Advanced Usage

Advanced usage example coming soon.

API

flip.basic(bookElement)

Creates a flip book using the contents of the provided element. Expects provided element to have a single child element that contains all the pages. This is wrapper, and the easiest way to build a book. No need to look at the rest of the API if this works for you.


flip.init(bookElement, firstPage)

Creates a flip book using the contents of the provided element. Expects provided element to have a single child element that contains all the pages. firstPage is an object created by flip.page.create().


flip.prime(nextPage)

Creates a flip book using the contents of the provided element. Expects provided element to have a single child element that contains all the pages.


flip.getStackHeight()

Returns the height of the page stack


flip.push(page)

Push a new page immediately onto the book, and transition it into view.


flip.pop()

Go back one page and pop the current page off the stack.


flip.close()

Close the book and return to the first page, removing all other pages from stack.


flip.page.create(pageContentElement, listener)

Creates a page for the book with the provided content element. The optional page event listener parameter expects an object with functions named the following (all optional):

```
{
    onObscure:      function(){},
    onStay:         function(){},
    onShowComplete: function(index){}
}
``` 

Limitations

Making changes to page content during a transition is not handled very well. The library creates a shadow copy of the original HTML for use while flipping. Modifying the page during transit can result in a partial rendering. It's best to modify pages after flipping is complete. You can register a callback for the end of various animation events with the API.

Build Instructions

You can build the library yourself using npm and grunt. Clone the repo, then run the grunt command from the root directory. It will produce output in the /dist/ folder.

npm install
grunt

Looking for a JavaScript Wizard?

This library was made by Terrill Dent. I am available for hire, or consulting. Get in touch and let's work together!

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].