viki-web-utils
Web utilities used by the Viki web app
Installation
npm install -S viki-web-utils
ScrollTrackable
Keeps track of the furthest point on page that user has scrolled to (in percentage). Returns most updated value everytime percentageSeen()
is called.
Usage
import Viki from 'viki-web-utils';
const tracker = new Viki.ScrollTrackable();
tracker.init();
console.log('percentage of page seen', tracker.percentageSeen())
console.log('percentage of page seen rounded to granularity of 10', tracker.percentageSeenRounded(10))
TabCounter
//todo
ResizeCounter
//todo
Development
Install dependencies
npm install
Run tests
npm run tests
Build for publishing
npm build
npm publish