zero2one
v0.1.3
Published
Animation, animates from 0 to 1 in a specific time with a defined acceleration (easing) function
Downloads
1
Readme
About The Project
I started this project in 2012. Now I have completely rewritten the code.
Features
- Coded in vanilla JS.
- easing
- Zero2One is dependency-free
Usage
Quickstart
in your terminal
yarn add zero2one
# or
npm add zero2one
html element
<div id="demo"></div>
javascript
import Zero2One from "./node_modules/Zero2One/index.js";
const demo = document.getElementById("demo");
if (demo) {
const z2o = new Zero2One();
const start = 1900;
const end = 2023;
const duration = 2000;
const delta = end - start;
z2o.start(duration, 'Quad.easeIn', (propress) => {
demo.innerText = start + delta * propress << 0;
});
}
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact
Wolfgang Jungmayer - lemon3.at
Project Link: https://github.com/lemon3/zero2one