UNPKG

@lagrange/animator

Version:

This library helps making parallax animations on scroll. It is built with performance in mind, as it doesn't need to relayout or paint to operate.

12 lines (8 loc) 274 B
import { SCREEN_TOP, SCREEN_CENTER, SCREEN_BOTTOM } from '../Constants'; export const screen = {}; export function updateScreen() { screen[SCREEN_TOP] = 0; screen[SCREEN_CENTER] = (window.innerHeight / 2); screen[SCREEN_BOTTOM] = window.innerHeight; } updateScreen();