update the loading issue

This commit is contained in:
2026-06-03 21:56:28 +05:30
parent 6b37649ed4
commit 123092f4b8
14 changed files with 340 additions and 145 deletions

View File

@@ -10,17 +10,24 @@ import Lenis from "lenis";
* SmoothScroll
* ---------------------------------------------------------------------------
* One global Lenis instance, driven by a SINGLE rAF source (GSAP's ticker) and
* kept locked to ScrollTrigger. Deliberately gated OFF on:
* - /miletruth — it stacks 3 pinned WebGL sections; JS scroll-smoothing there
* fights the pins and causes the very lag we're trying to remove. Native
* scroll is used on that route.
* kept locked to ScrollTrigger via `lenis.on("scroll", ScrollTrigger.update)`.
*
* Enabled on every route. /miletruth's three scroll-driven WebGL sections use a
* self-managed `position: fixed` pin (toggled from ScrollTrigger.onUpdate via
* `self.progress`) — NOT GSAP's pin-spacer — so Lenis driving real document
* scroll keeps their progress correct and just smooths the wheel input. (It was
* previously gated off here when those sections used GSAP pins; that no longer
* applies, and native scroll there felt noticeably janky next to every Lenis
* route.)
*
* Still gated OFF on:
* - touch devices — native momentum is smoother than emulated inertia.
* - prefers-reduced-motion.
*
* Re-evaluates on every route change: the effect cleanup destroys the previous
* instance, so entering /miletruth tears Lenis down and leaving it re-inits.
* instance and re-inits on the next route.
*/
const DISABLED_ROUTES = ["/miletruth"];
const DISABLED_ROUTES: string[] = [];
export default function SmoothScroll() {
const pathname = usePathname();