rune-scroller
Version:
Lightweight, high-performance scroll animations for Svelte 5. ~2KB bundle, zero dependencies.
16 lines (15 loc) • 813 B
TypeScript
/**
* Animation type definitions and utilities
*/
/**
* Type-safe animation names
* Maps to CSS classes in animations.css
*/
export type AnimationType = 'fade-in' | 'fade-in-up' | 'fade-in-down' | 'fade-in-left' | 'fade-in-right' | 'zoom-in' | 'zoom-out' | 'zoom-in-up' | 'zoom-in-left' | 'zoom-in-right' | 'flip' | 'flip-x' | 'slide-rotate' | 'bounce-in';
/**
* Calculate rootMargin for IntersectionObserver from offset or custom rootMargin
* @param offset - Viewport offset (0-100). 0 = bottom of viewport touches top of element, 100 = top of viewport touches top of element
* @param rootMargin - Custom rootMargin string (takes precedence over offset)
* @returns rootMargin string for IntersectionObserver
*/
export declare function calculateRootMargin(offset?: number, rootMargin?: string): string;