Coder Social home page Coder Social logo

imandel / flipbook.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from russellsamora/flipbook.js

0.0 0.0 0.0 10.91 MB

Scroll-based inline flipbook animation for the internet.

Home Page: https://russellgoldenberg.github.io/flipbook.js

License: MIT License

JavaScript 70.36% HTML 29.64%

flipbook.js's Introduction

flipbook.js

Scroll-based inline flipbook animation for the internet. Checkout the demo.

Installation

npm install flipbook

or

<script src="flipbook.min.js"></script>

Usage

	<div id='walk-cycle'></div>

	<script>
		flipbook({
			id: 'walk-cycle',
			path: 'frames/walk',
			filename: '%1d',
			extension: 'jpg',
			count: 86,
			speed: 0.5
		});
	</script>

Options

  • id (required) [String] The id of the element where the flipbook will be inserted.

  • path (required) [String] The relative path the directory where the images are.

  • filename (required) [String] The pattern of filename (%3d = 3 digits or 001, 002, etc, ex. 'images-%3d').

  • extension (required) [String] The type of image file (png or jpg).

  • count (required) [Number] Count of images in directory.

  • speed (optional) [Number 0 to 1] How fast the scroll advances the frames (0: slow, 1: fast). Defaults to 0.5.

  • cover (optional) [Boolean] If the flipbook should go full window height, and center-crop (like CSS's background-size: cover). Defaults to false.

  • loaded (optional) [Function] Callback function when the flipbook has loaded all images and is ready to play through. Defaults to none.

  • gif (optional) [Boolean] Autoplay the animation and loop like a gif without scroll interaction.

Helpful bits

Convert a video to image sequence with ffmpeg:

ffmpeg -i input.mp4 -r 12 frames/%d.png

License & Credit

MIT © Russell Goldenberg

Inspired by canvid and stack

flipbook.js's People

Contributors

imandel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.