Flipping JS

Table of Contents

  1. Description
  2. Documentation
  3. Demo

Description


A library to about Flipping containers. This include: This makes it easier for Developer to implement cards and book flipping.

Documentation


Getting Started


Javascript

After downloading the module into your project, you can import the library into your script.

            import { 
                mainContainer, flipCardHover, flipCardClick, bookAnimation, bookFlip
            } from './CardAndBookFlipping/Flipping.js';
        
            mainContainer({});
            flipCardHover({
                width: 350,
                height: 200,
                transitionLength: 1
            });
            flipCardClick({
                width: 350,
                height: 200,
                transitionLength: 1
            });
            bookFlip({
                width: 200,
                height: 275,
                transitionLength: 0.75
            });
            bookAnimation({
                width: 200,
                height: 275,
                transitionLength: 1
            });
            
Methods

  • mainContainer({})
  • Description: function to set up the container for cards or books

  • flipCardHover(options)
  • Description: function to configure hover card flipping

  • flipCardClick(options)
  • Description: function to configure click card flipping

  • bookFlip(options)
  • Description: function to configure hover book flipping

  • bookAnimation(options)
  • Description: function to configure hover for book animation

Options

  • Width: integer
  • Default: 250px
    Description: Width of the Card or Book

  • Height: integer
  • Default: 320px
    Description: Width of the Card or Book

  • Transition: integer
  • Default: 1s
    Description: Width of the Card or Book

HTML Usage
Main Container
    <div class="mainContainer">
        [Insert Card/Book code]
    </div>
Card Flip: onClick
    <div class="card clickCard">
        <div class="frontCard">
            ...
        </div>
        <div class="backCard">
            ...
        </div>
    </div>
Card Flip: onHover
    <div class="card hoverCard">
        <div class="frontCard">
            ...
        </div>
        <div class="backCard">
            ...
        </div>
    </div>
Adding and Removing Flipping Cards
    <div class="mainContainer allowEditCards"></div>
Book Animation: 3D Animation
    <div class="bookContainer">
        <div class="book" id="book1">
            <img src="[IMG SOURCE]" alt="">
        </div>
    </div>
Book Flip: Flip a page
    <div class="bookFlip">
        <div class="flip">
            <div class="frontCover">
                ...
            </div>

            <div class="backCover">
                ...
            </div>    
        </div>

        <div class="contentCover">
            ...
        </div>
    </div>

Demo


Card Flip: onClick

(DEMO: Showing flipping the front and the back of the card by clicking on it)

John Smith

(Click to read more)
Great reader

Sarah Smith

(Click to read more)
Great reader

Card Flip: onHover

(DEMO: Showing flipping the front and the back of the card by hovering on it)

Sarah Smith

(Hover to read more)
Great Reader

Adding and Removing Flipping Cards

(DEMO: Adding and removing Card with the complex hover and click flip card functionality )

John Smith's Review

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Excepturi ipsam inventore quibusdam (Click to read more)
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Excepturi ipsam inventore quibusdam (Click to read more)

Sarah Smith's Review

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Excepturi ipsam inventore quibusdam, aperiam incidunt natus quidem molestias nihil! (Click to read more)
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Excepturi ipsam inventore quibusdam, aperiam incidunt natus quidem molestias nihil! (Click to read more)

Book Animation: 3D Animation

(DEMO: Showing digital book in a book form )

Book Flip: Flip a page

(DEMO: Flip Book Page )

Quotes of the day

Fight

Content
Quotes of the day

Fight

Content
Quotes of the day

Fight

Content