Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
23
6 changes: 5 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import "styles/tailwind.css"

import SmoothScroll from "components/SmoothScroll"

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
<body>
<SmoothScroll>{children}</SmoothScroll>
</body>
</html>
)
}
31 changes: 31 additions & 0 deletions components/SmoothScroll.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use client"

import { ReactNode, useRef } from "react"
import gsap from "gsap"
import { ScrollTrigger } from "gsap/ScrollTrigger"
import { ScrollSmoother } from "gsap/ScrollSmoother"
import { useGSAP } from "@gsap/react"

gsap.registerPlugin(ScrollTrigger, ScrollSmoother)

export default function SmoothScroll({ children }: { children: ReactNode }) {
useGSAP(
() => {
ScrollSmoother.create({
wrapper: "#smooth-wrapper", // The element that will contain the smoothed content
content: "#smooth-content", // The element that will be smoothed
smooth: 1, // Adjust the smoothness of the scroll
effects: true, // Enable ScrollSmoother's built-in effects
})
},
{}
)

return (
<div id="smooth-wrapper">
<div id="smooth-content">
{children}
</div>
</div>
)
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"coupling-graph": "npx madge --extensions js,jsx,ts,tsx,css,md,mdx ./ --exclude '.next|tailwind.config.js|reset.d.ts|prettier.config.js|postcss.config.js|playwright.config.ts|next.config.js|next-env.d.ts|instrumentation.ts|e2e/|README.md|.storybook/|.eslintrc.js' --image graph.svg"
},
"dependencies": {
"@gsap/react": "^2.1.2",
"@next/bundle-analyzer": "^15.3.1",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-checkbox": "^1.3.1",
Expand All @@ -50,6 +51,7 @@
"@t3-oss/env-nextjs": "^0.10.1",
"@vercel/otel": "^1.12.0",
"class-variance-authority": "^0.7.0",
"gsap": "^3.14.2",
"lodash": "^4.17.21",
"next": "15.3.8",
"react": "^19.1.0",
Expand Down Expand Up @@ -121,5 +123,5 @@
"engines": {
"node": ">=20.0.0"
},
"packageManager": "pnpm@10.0.0"
"packageManager": "pnpm@10.28.0"
}
22 changes: 22 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.