Smart, lightweight functions to animate browser scroll.
Smart, lightweight functions to animate browser scroll.
easeInOutCubic
animation timing; a soft acceleration and deceleration.For Node.js, to install scroll-animator
with npm, run:
npm install scroll-animator
For Deno and browsers, an example import map:
{
"imports": {
"scroll-animator/": "https://unpkg.com/[email protected]/"
}
}
Supported runtime environments:
^14.17.0 || ^16.0.0 || >= 18.0.0
.> 0.5%, not OperaMini all, not dead
.Consider polyfilling:
Non Deno projects must configure TypeScript to use types from the ECMAScript modules that have a // @ts-check
comment:
compilerOptions.allowJs
should be true
.compilerOptions.maxNodeModuleJsDepth
should be reasonably large, e.g. 10
.compilerOptions.module
should be "node16"
or "nodenext"
.The npm package scroll-animator
features optimal JavaScript module design. It doesn’t have a main index module, so use deep imports from the ECMAScript modules that are exported via the package.json
field exports
: