Gathering detailed insights and metrics for smooth-scroll-operator
Gathering detailed insights and metrics for smooth-scroll-operator
Gathering detailed insights and metrics for smooth-scroll-operator
Gathering detailed insights and metrics for smooth-scroll-operator
A dead simple and lightweight smooth scroll animation utility. Scroll any element. Comes with bezier curve support and a small library of pre-defined easing functions. Animations respect clock.
npm install smooth-scroll-operator
Typescript
Module System
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
62 Commits
2 Watchers
7 Branches
1 Contributors
Updated on Jun 07, 2019
Latest Version
5.0.7
Package Id
smooth-scroll-operator@5.0.7
Unpacked Size
17.08 kB
Size
6.12 kB
File Count
9
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
A dead simple and lightweight library to animate the scroll of the window or any HTMLElement.
No need to ask, he's a smooth operator...
NPM:
1npm i smooth-scroll-operator
browser:
You can use either smooth-scroll-operator.umd.js
or smooth-scroll-operator.min.umd.js
from the latest release in a script
tag.
This includes all dependencies.
1<script src="smooth-scroll-operator.min.umd.js"></script> 2<script> 3 SmoothScrollOperator.scrollY(window, 500); 4</script>
1import sso from 'smooth-scroll-operator'; 2 3let el = document.querySelector('.myElement'); 4 5//scroll el to 500 6sso.scrollY(el, 500); 7 8// Scroll to y = 500, with a duration of 200ms, and a custom cubic-bezier easing function: 9sso.scrollY(el, 500, { 10 duration: 200, 11 easing: [0.42, 0.0, 0.58, 1.0] 12}); 13 14// Scroll to y = 500, with a duration of 200ms, and a pre-defined easing function. 15sso.scrollY(el, 500, { 16 duration: 200, 17 easing: sso.EASING.EASE_IN 18}); 19 20//scroll window 21sso.scrollY(window, 500); 22 23//Scroll and then pause animation 300ms later. 24let animation = sso.scrollY(el, 500); 25 26setTimeout(() => { 27 28 animation.pause(); 29 30}, 300); 31 32//resume 400ms later. 33setTimeout(() => { 34 35 animation.resume(); 36 37}, 400); 38 39//Scroll and then immediately stop animation 40let animation = sso.scrollY(window, 500); 41 42animation.stop();
scrollY({HTMLElement|window} el, {number} targetY, {object=} options)
Animates the scrolling of a given element (scrolls to target position). Returns an instance of DOMAnimate.
You can stop, pause, or resume the animation by calling .stop()
, .pause()
, or .resume()
, respectively, on the returned instance.
{HTMLElement} el
The element to scroll. Can be window
.
{number} targetY
The y position to animate/scroll to in pixels.
{object=} options
An optional map of parameters:
{integer} duration
Animation duration in milliseconds. (Default: 400
)
{array} easing
An array to pass to the cubic-bezier easing function. (Default: SmoothScrollOperator.EASE_IN_OUT
)
{function} onComplete
A callback function that is called when the animation is finished.
EASING
smooth-scroll-operator
ships with a small Bezier Curve library:
EASING.EASE
EASING.EASE_IN
EASING.EASE_OUT
EASING.EASE_IN_OUT
EASING.LINEAR
MIT. Free to use in all your things!
DO IT! PR's welcome. Need to add testing, linting, and support for scrollX
, or both x/y at the same time.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More