fand / vfx-js

WebGL effects made easy.
https://amagi.dev/vfx-js
626 stars 19 forks source link

feat: add intersecion options #85

Closed fand closed 4 weeks ago

fand commented 4 weeks ago

This PR adds VFXProps.intersection to control transition shader behavior. These property changes how element are considered to be entered to / left from the viewport.

type VFXProps = {
    /**
     * Options to control transition behaviour.
     * These properties work similarly to the IntersectionObsrever options.
     */
    intersection?: {
        /** Threshold for the element to be considered "entered" to the viewport. */
        threshold?: number;

        /** Margin of the viewport to be used in intersection calculcation. */
        rootMargin?: RectOpts;
    };
};

Changes

vercel[bot] commented 4 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-vfx-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 14, 2024 9:13pm