Skip to content

Commit 1822e70

Browse files
committed
smooth scrolling implemented
1 parent 637764b commit 1822e70

File tree

7 files changed

+55
-4299
lines changed

7 files changed

+55
-4299
lines changed

app/about/page.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import fetchData from "@/lib/sanity/fetchData";
1010
import fetchTeam from "@/lib/sanity/fetchTeam";
1111
import Carousel from "@/components/ui/Carousel";
1212

13-
export const revalidate = 2592000;
13+
export const revalidate = 60;
1414

1515
export default async function About() {
1616
const team = await fetchTeam();

app/layout.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import Footer from "@/components/Footer";
22
import Header from "@/components/Header";
33
import Providers from "@/providers";
44
import "@/styles/globals.css";
5+
import SmoothScrolling from "@/components/SmoothScrolling";
6+
57
export const viewport = {
68
themeColor: "#000000",
79
};
@@ -28,11 +30,13 @@ export default async function Layout({ children }) {
2830
return (
2931
<html lang="en">
3032
<body className="flex min-h-screen flex-col bg-darker text-lightest ">
31-
<Providers>
32-
<Header />
33-
{children}
34-
<Footer />
35-
</Providers>
33+
<SmoothScrolling>
34+
<Providers>
35+
<Header />
36+
{children}
37+
<Footer />
38+
</Providers>
39+
</SmoothScrolling>
3640
</body>
3741
</html>
3842
);

app/storygram/page.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import StorygramCards from "@/components/StorygramCards";
22
import fetchData from "@/lib/sanity/fetchData";
33
import Pagination from "@/components/Pagination";
44

5+
export const revalidate = 0;
6+
57
export default async function Storygram({ searchParams }) {
68
const pageSize = 8;
79
const currentPage = parseInt(searchParams.page || "1", 10);

components/SmoothScrolling.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use client";
2+
import { ReactLenis } from "lenis/react";
3+
4+
function SmoothScrolling({ children }) {
5+
return (
6+
<ReactLenis root options={{ lerp: 0.1, duration: 1.5, smoothWheel: true }}>
7+
{children}
8+
</ReactLenis>
9+
);
10+
}
11+
12+
export default SmoothScrolling;

package-lock.json

Lines changed: 30 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"axios": "^1.7.4",
1717
"dayjs": "^1.11.12",
1818
"framer-motion": "^11.3.28",
19+
"lenis": "^1.3.15",
1920
"lodash": "^4.17.21",
2021
"next": "14.2.3",
2122
"postcss": "8.4.21",

0 commit comments

Comments
 (0)