@14islands/r3f-scroll-rig
Version:
Progressively enhance any React website with WebGL using @react-three/fiber
28 lines (27 loc) • 992 B
TypeScript
import { MutableRefObject, ReactNode } from 'react';
import type { ScrollState } from '../hooks/useTrackerTypes';
interface IViewportScrollScene {
track: MutableRefObject<HTMLElement>;
children: (state: ViewportScrollSceneChildProps) => ReactNode;
margin?: number;
inViewportMargin?: string;
inViewportThreshold?: number;
visible?: boolean;
hideOffscreen?: boolean;
debug?: boolean;
orthographic?: boolean;
priority?: number;
hud?: boolean;
camera?: any;
}
export interface ViewportScrollSceneChildProps {
track: MutableRefObject<HTMLElement>;
margin: number;
priority: number;
scale: vec3;
scrollState: ScrollState;
inViewport: boolean;
}
declare function ViewportScrollScene({ track, margin, // Margin outside viewport to avoid clipping vertex displacement (px)
inViewportMargin, inViewportThreshold, priority, ...props }: IViewportScrollScene): JSX.Element;
export { ViewportScrollScene };