๐Ÿ“ฆ gaggle / double-buffer.js

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/gaggle/double-buffer.js.git
HTTPS git clone https://github.com/gaggle/double-buffer.js.git
SSH git clone git@github.com:gaggle/double-buffer.js.git
CLI gh repo clone gaggle/double-buffer.js
Jon Lauridsen Jon Lauridsen Merge pull request #5 from gaggle/update-dependencies afa8839 9 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ lib
๐Ÿ“ test
๐Ÿ“„ .editorconfig
๐Ÿ“„ .gitignore
๐Ÿ“„ .travis.yml
๐Ÿ“„ example.gif
๐Ÿ“„ karma.ci.conf.js
๐Ÿ“„ karma.conf.js
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ README.md

double-buffer.js

Build Status Coverage Status

Smoothly load images sequentially.

An image is first pre-loaded, then faded in on the front buffer. Once fully shown it's swapped to live permanently on the back buffer. At this point a new image can be faded in, leading to smooth fadein transitions.

Useful for galleries or backgrounds displaying potentially infinite images.

Here an inital image fades in, and another immediately fades in on top. Example

Install

npm install gaggle/double-buffer.js

Use

var DoubleBuffer = require("double-buffer.js") buffer = new DoubleBuffer(parent, undefined, {duration: 1000}) buffer.set("./clouds.jpg")