Kinetica
Unprecedented kinetic engine.
Table of Contents
Features
- Designed with performance in mind
- Lightweight - 10.4 KB
- Mobile friendly - supports mouse events, touch events and pointer events
Dependencies
Install
Download dev or prod version and put it in your html
Usage
// start the digest loop // create kinetic instancevar kinetic = el: documentbody Vector: Vector // spawn itKinetic // implement scrollvar $target = document var position = 0 0 { $targetstyletransform = `translateY(px)`} { return positiony <= 0 && positiony > -5000 + windowinnerHeight} { if pointerslength === 1 var pointer = pointers0 var next = position if position = next } // subscribe to kinetickinetic
Examples
API
Development
Command | Description |
---|---|
npm run check |
Check standard code style by snazzy |
npm run build |
Wrap source code in UMD by rollup |
npm run min |
Minify code by UglifyJS |