0.0.7 • Published 6 years ago

track-helpers v0.0.7

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

TrackHelpers

Helpers for track.

Build Status

Installation

npm

npm install track-helpers

Usage

ScrollHelper

const ScrollHelper = require('track-helpers/lib/scroll_helper');

ScrollHelper.getPos();        // =>  Window scroll position.  `ex) {x: 100, y: 200}`
ScrollHelper.getPos(element); // =>  Element scroll position. `ex) {x: 100, y: 200}`

ScrollHelper.scroll({x: 100, y: 100});             // => Window scroll x=100, y=100
ScrollHelper.scroll({x: 100, y: 100}, 250);        // => Window scroll x=100, y=100 with 250ms animation.
ScrollHelper.scroll({x: 100, y: 100}, 0, element); // => Element scroll x=100, y=100

ScrollHelper.scrollTo(element);              // => Window scroll to Element
ScrollHelper.scrollTo(element, 250);         // => Window scroll to Element with 250ms animation.
ScrollHelper.scrollTo(element, 0, {x: -60}); // => Window scroll to Element with offset (x - 60)

HashHelper

const HashHelper = require('track-helpers/lib/hash_helper');

// Fash hash function. (non-cryptographic)
HashHelper.fast('ABCDEFGエヴァけもフレ'); // Return hex hash.
0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago