A TypeScript plugin for BetterScroll that provides enhanced mouse wheel scrolling capabilities with configurable speed, direction, easing, and boundary damping on PC platforms.
Overall
score
98%
Build a smooth navigation manager for a single-page application that provides programmatic scrolling capabilities to navigate to different sections of a long-form content page.
The navigation manager should:
All scrolling should be smooth and animated using the better-scroll library's programmatic scroll control methods.
@generates
/**
* Creates a navigation manager for smooth scrolling
* @param wrapperElement - The wrapper element for the scrollable area
*/
export function createNavigationManager(wrapperElement: HTMLElement): NavigationManager;
export interface NavigationManager {
/**
* Scrolls to an absolute position
* @param x - Horizontal position
* @param y - Vertical position
* @param time - Animation duration in milliseconds (optional, defaults to 0)
* @param easing - Easing function (optional)
*/
scrollToPosition(x: number, y: number, time?: number, easing?: any): void;
/**
* Scrolls by a relative offset from current position
* @param deltaX - Horizontal offset
* @param deltaY - Vertical offset
* @param time - Animation duration in milliseconds (optional, defaults to 0)
* @param easing - Easing function (optional)
*/
scrollByOffset(deltaX: number, deltaY: number, time?: number, easing?: any): void;
/**
* Scrolls to bring an element into view
* @param element - The target element or selector
* @param time - Animation duration in milliseconds (optional, defaults to 0)
* @param offsetX - Horizontal offset adjustment (optional, defaults to 0)
* @param offsetY - Vertical offset adjustment (optional, defaults to 0)
* @param easing - Easing function (optional)
*/
scrollToTarget(element: HTMLElement | string, time?: number, offsetX?: number, offsetY?: number, easing?: any): void;
/**
* Destroys the navigation manager and cleans up resources
*/
destroy(): void;
}Provides smooth scrolling capabilities with programmatic control methods including scrollTo, scrollBy, and scrollToElement.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-better-scroll--mouse-wheeldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10