0.2.4 • Published 5 years ago

float-js v0.2.4

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Float.js

A tiny (0.78kb gzipped), requestAnimationFrame powered, 60+fps decelerated parallax layer offsetting engine that reacts to the mouse position or device orientation.

Usage and Options

<div data-float='0.5'>
import FloatJS from 'float-js';

const float = new FloatJS({
  'attribute': 'data-float', // Defines attribute selector.
  'deceleration':       0.5, // Defines animation deceleration rate.
  'strength':           0.5, // Defines how much layers are offset.
  'precision':            1, // Decimal points for transform values.
  'direction':           -1  // 1 = linear, -1 = natural / inverted.
});

NPM

Available on npm: https://www.npmjs.com/package/float-js

License

MIT License

0.2.4

5 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago