fix(parallax): prime parallax position with pre-Blazor init script to kill Server->WASM position pop

This commit is contained in:
daniel-c-harvey
2026-06-11 16:08:55 -04:00
parent e077b8ec7b
commit a2f9742f8a
3 changed files with 99 additions and 0 deletions
@@ -141,6 +141,14 @@ export function register(element: HTMLElement, options: RegisterOptions): string
setupAutoHeight(handle);
// Prime position synchronously so enhanced navigation and WASM handoff have
// zero-frame gap. The init script covers cold page load; this covers nav.
// Skip under reduced motion — parallax.ts never drives position then.
if (!reducedMotion()) {
element.setAttribute('data-parallax-active', '');
applyParallax(handle);
}
return id;
}