Skip to content
Closed
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
27 changes: 27 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@tailwindcss/vite": "^4.1.13",
"lenis": "^1.3.11",
"lucide-react": "^0.542.0",
"postcss": "^8.5.6",
"react": "^19.1.1",
Expand All @@ -29,4 +30,4 @@
"globals": "^16.3.0",
"vite": "^7.1.2"
}
}
}
25 changes: 24 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import { useEffect } from "react";
import Lenis from "lenis";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Navbar from "./components/Navbar";
import Footer from "./components/Footer";
Expand All @@ -10,6 +11,28 @@ import CommunityPage from "./pages/CommunityPage";
import BackToTop from "./components/shared/BackToTop";

export default function App() {
useEffect(() => {
// Initialize Lenis for smooth scroll
const lenis = new Lenis({
duration: 0.8, // scroll speed (1.2s for smooth flow)
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), // default easing
smooth: true,
smoothTouch: false, // disable smooth on mobile for performance
});

// RAF loop
const raf = (time) => {
lenis.raf(time);
requestAnimationFrame(raf);
};
requestAnimationFrame(raf);

// Cleanup when component unmounts
return () => {
lenis.destroy();
};
}, []);

return (
<Router>
<div className="min-h-screen flex flex-col bg-gradient-to-br from-gray-100 to-indigo-50 dark:from-gray-900 dark:to-gray-800">
Expand Down