Preserve hosted website UX inside Archipelago, add isolated Business and owner-authorized native wallet setup, and include deployment handoff. Based on main with native signer import already accepted.
25 lines
757 B
JavaScript
25 lines
757 B
JavaScript
/*
|
|
* Top bar scroll state — shared with the main site's behaviour.
|
|
* Transparent while parked; past the first 80px the bar earns the
|
|
* translucent ground, hairline and blur. Toggles `is-scrolled`.
|
|
*/
|
|
const SCROLL_START = 80;
|
|
|
|
export function startNavScroll(bar = document.querySelector("[data-topbar]")) {
|
|
if (!bar) return () => {};
|
|
let frame = 0;
|
|
const apply = () => {
|
|
frame = 0;
|
|
bar.classList.toggle("is-scrolled", window.scrollY > SCROLL_START);
|
|
};
|
|
const onScroll = () => {
|
|
if (!frame) frame = requestAnimationFrame(apply);
|
|
};
|
|
apply();
|
|
window.addEventListener("scroll", onScroll, { passive: true });
|
|
return () => {
|
|
window.removeEventListener("scroll", onScroll);
|
|
if (frame) cancelAnimationFrame(frame);
|
|
};
|
|
}
|