/* * parallax-init — synchronous pre-Blazor primer for ParallaxImage. * * Why this exists (the Server→WASM "position pop"): * App.razor uses InteractiveAuto. On a cold WASM cache the page renders * server-side, the Server circuit hydrates and parallax.js register()s * (setting data-parallax-active, which cancels the CSS view() animation), * then WASM takes over: Blazor disposes the Server component → DisposeAsync * → unregister() → data-parallax-active is REMOVED. For the multi-frame gap * until WASM's new instance re-register()s (its IntersectionObserver fires * asynchronously), the CSS animation resumes and drives background-position-y * to its own view()-timeline value, which differs from the JS math — that * brief reversion is the visible pop. * * This script runs ONCE, synchronously, after the DOM is parsed but before * Blazor boots, and sets data-parallax-active on every parallax window. That * attribute is never tied to a component instance, so it survives the * Server→WASM handoff — the CSS animation stays cancelled the whole time and * parallax.js remains the sole writer of background-position-y across both * render modes. register()/unregister() lifecycle is unchanged; on genuine * navigation the element leaves the DOM entirely, so a stale attribute is moot. * * Why plain JS, not TypeScript: * A synchronous pre-Blazor primer must be a classic