Track entry, not animation progress
The useInView hook starts with a false boolean and observes the element attached to its ref. When the element crosses the configured threshold, the hook sets the boolean to true and disconnects the observer.
That state is not reset when the element leaves view. A reader scrolling upward therefore sees the section already present rather than starting its entrance again. The effect also disconnects during cleanup, covering a wrapper that leaves the page before its first entry.
Give CSS the transition between states
Reveal maps the boolean to an is-in class and accepts one of five typed delay options. CSS changes opacity and vertical position with those classes; React does not drive the intermediate frames.
The seabed-contour illustration uses the same entry hook at another threshold, then animates SVG strokes through CSS. The navigation's passive scroll listener is a separate behavior, so the one-time reveal design should not be described as removing all scroll listeners from the page.
Keep the fallback visible in the assessment
Reduced-motion rules set the reveal content to visible, remove its translation and disable the transition. The hook is still created, but readability in that mode does not wait for its visible class.
The normal reveal rule starts hidden, and the hook constructs IntersectionObserver without a support guard. Unsupported observers or failed JavaScript can therefore leave content hidden. That needs a visible-baseline or equivalent fallback and a browser check; neither was implemented or exercised in this read-only review.
Viewport reveal ownership
React observes a one-time entry; CSS selects the visual treatment.
React component
Browser observation
CSS presentation
Scroll or drag the background to move. Use the zoom buttons to resize.Arrow keys move between components. Enter selects.
Choose a component to explore
Select a numbered component on the map or use the component menu. Its details and connections will appear here.
No component selected.
All connections (8)
- 01 · Reveal wrapper → 02 · Viewport hookattach ref · Direct call
- 02 · Viewport hook → 03 · IntersectionObserverobserve · Direct call
- 03 · IntersectionObserver → 05 · Visible classfirst intersection · Async task
- 03 · IntersectionObserver → 04 · Observer disconnectionentry observed · Direct call
- 02 · Viewport hook → 04 · Observer disconnectioneffect cleanup · Direct call
- 05 · Visible class → 01 · Reveal wrapperrender class · Response / return
- 01 · Reveal wrapper → 06 · Normal motion branchnormal preference · Direct call
- 01 · Reveal wrapper → 07 · Reduced-motion branchreduced-motion preference · Direct call