You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, this library focuses on interacting with DOM elements. However, since the smoothening/interpolation logic is independent of DOM, we can create an all-purpose smooth scrolling engine that can be used in DOM, canvas, and anywhere you want to smoothen the scrolling.
Note that the word "scrolling" here is an abstract concept that implies any interaction with mouse wheels or touch screens.
Proposal
In our next version, we want to split the core library into the following three packages:
@smooth-scrollbar/engine: this package is the target-agnostic scrolling engine that provides the basic smoothening(interpolation) algorithm and the rendering logic. You can think of it as [email protected] without event handlers. A minimal interface will be:
classSrollbarEngine{// sets or updates the sizes of container and contentsetSize(size){}// sets scrolling deltasetDelta(x,y){}// increase scrolling deltaaddDelta(x,y){}// scrolls to the specific position with easingscrollTo(x,y,duration,options){}// sets scrolling positionsetPosition(x,y){}// scrolling eventson(event,handler){}// the rendering loopprotectedrender(){}}
@smooth-scrollbar/event-handlers: the common event handlers including wheel, touch, and/maybe keyboard. (I'm not sure if this should be merged into the engine package.)
smooth-scrollbar: the DOM adapter that equals to [email protected]. We keep using this name for compatibility.
The text was updated successfully, but these errors were encountered:
is "scrollTo" possible with our current version? even if the event handler isn't available is there still a way to scroll to a specific position or id onClick
is "scrollTo" possible with our current version? even if the event handler isn't available is there still a way to scroll to a specific position or id onClick
Motivation
Currently, this library focuses on interacting with DOM elements. However, since the smoothening/interpolation logic is independent of DOM, we can create an all-purpose smooth scrolling engine that can be used in DOM, canvas, and anywhere you want to smoothen the scrolling.
Note that the word "scrolling" here is an abstract concept that implies any interaction with mouse wheels or touch screens.
Proposal
In our next version, we want to split the core library into the following three packages:
@smooth-scrollbar/engine
: this package is the target-agnostic scrolling engine that provides the basic smoothening(interpolation) algorithm and the rendering logic. You can think of it as[email protected]
without event handlers. A minimal interface will be:@smooth-scrollbar/event-handlers
: the common event handlers includingwheel
,touch
, and/maybekeyboard
. (I'm not sure if this should be merged into the engine package.)smooth-scrollbar
: the DOM adapter that equals to[email protected]
. We keep using this name for compatibility.The text was updated successfully, but these errors were encountered: