From bd9a01491aeacb3640da8d6f175e2c3e38e95175 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Tue, 12 May 2026 03:59:04 +0200 Subject: [PATCH] Landing lage scroll snapping --- src/app/(home)/Home.css | 16 +++++++++++ src/app/(home)/page.tsx | 63 ++++++++++++++++++++++++----------------- 2 files changed, 53 insertions(+), 26 deletions(-) create mode 100644 src/app/(home)/Home.css diff --git a/src/app/(home)/Home.css b/src/app/(home)/Home.css new file mode 100644 index 0000000..6dc6217 --- /dev/null +++ b/src/app/(home)/Home.css @@ -0,0 +1,16 @@ +/* Force the body to never scroll */ +html, body { + overflow: hidden; + height: 100%; + margin: 0; + padding: 0; +} + +/* Optional: Hide scrollbar track for a cleaner UI while keeping functionality */ +.no-scrollbar::-webkit-scrollbar { + display: none; +} +.no-scrollbar { + -ms-overflow-style: none; + scrollbar-width: none; +} \ No newline at end of file diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx index 161aa5a..d124b68 100644 --- a/src/app/(home)/page.tsx +++ b/src/app/(home)/page.tsx @@ -6,6 +6,8 @@ import Link from "next/link"; import { useEffect, useRef, useState } from "react"; import { motion, Variants } from "framer-motion"; +import "./Home.css"; + const MotionLink = motion(Link); export const mistShowcase = [ @@ -140,7 +142,7 @@ function ShowSection({ return ( -
-
+ /* + 1. Move overflow-y-auto and snap-y to the ROOT div. + Now the entire screen is the scrollable "track". + */ +
+ {/* + THE RIGHT SIDE (MorphCode) + Using 'sticky' instead of 'fixed'. It will stay pinned to the + top/center while you scroll through the sections. + */} +
+
- + {/* + We use a key here to help React/Framer distinguish + morphing vs unmounting if needed + */} +
-
-
- {mistShowcase.map((show) => ( - - ))} -
+ {/* + THE SECTIONS + They now live in the main scroll flow. + */} +
+ {mistShowcase.map((show) => ( + + ))}
-
- {/*
- -
*/} + + {/* Scroll Indicator - Use fixed so it stays relative to screen */}