zero2one
v0.1.4
Published
Animation, animates from 0 to 1 in a specific time with a defined acceleration (easing) function
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
# or
pnpm add zero2onehtml element
<div id="demo"></div>javascript
import Zero2One from "zero2one";
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, 'easeIn', (progress) => {
demo.innerText = start + delta * progress << 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
