Track movement and basic events with CSS custom properties
Add page events like tracking scroll position, mouse position, device orientation, and more to your CSS! See an example of momentum in use.
Add the js inside your <head>
tag.
All values are unitless meaning you will need to add your units to them. For example, calc(var(--scrolly)*1px)
results in a pixel value for the vertical scroll position.
To trigger element variables, add the class momentumcss
to your elemnt.