op-view-progress

0.0.5 • Public • Published

op-view-progress

Element's position on the screen / view. Progress is calculated in relation between node's top position, height and window's height. The value is:

  • -1 and less for items under viewport
  • -1 ... 0 ... 1 in the viewport, where 0 is for elements in the middle
  • 1 and more for items above viewport

Install

npm install op-view-progress
yarn add op-view-progress

Usage

import opViewProgress from 'op-view-progress';

Create instance:

const progress = new opViewProgress(domNode);

Update / tick:

progress.tick();

Get value:

progress.value;

Package Sidebar

Install

npm i op-view-progress

Weekly Downloads

2

Version

0.0.5

License

MIT

Unpacked Size

3.93 kB

Total Files

4

Last publish

Collaborators

  • daniel-novikov