File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Footer from "@/components/core/footer";
33import Navbar from "@/components/core/navbar" ;
44import { cookies } from "next/headers" ;
55import { getGithubStars } from "@/helper/getGithubStars" ;
6+ import ProgressBar from "@/components/ProgressBar" ;
67
78export default async function Home ( ) {
89 const starCount : number = await getGithubStars ( ) ;
@@ -13,6 +14,7 @@ export default async function Home() {
1314
1415 return (
1516 < >
17+ < ProgressBar start = { "origin-left" } />
1618 < Navbar starCount = { starCount } />
1719 < HomePage accountId = { accountId } />
1820 < Footer />
Original file line number Diff line number Diff line change 1+ "use client"
2+ import { motion , useScroll , useSpring } from "framer-motion" ;
3+
4+ const ProgressBar = ( { start} : { start : string } ) => {
5+ const { scrollYProgress } = useScroll ( ) ;
6+ const scaleX = useSpring ( scrollYProgress , {
7+ stiffness : 100 ,
8+ damping : 30 ,
9+ restDelta : 0.001 ,
10+ } ) ;
11+
12+ return (
13+ < motion . div
14+ className = { `fixed top-0 left-0 right-0 h-2 bg-primary ${ start } z-[51]` }
15+ style = { { scaleX } }
16+ />
17+ )
18+ }
19+
20+ export default ProgressBar
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Footer from "@/components/core/footer";
55import Navbar from "@/components/core/navbar" ;
66import { Forking , AppwriteSetup , DevSetup } from "@/components/core/contributionSections" ;
77import { motion , useScroll , useSpring } from "framer-motion" ;
8+ import ProgressBar from "@/components/ProgressBar" ;
89
910// Component to render the contribution guide with dynamic tabs
1011export default function Contribute ( ) {
@@ -75,10 +76,11 @@ export default function Contribute() {
7576 </ article >
7677 < article >
7778 < Tabs currentTab = { currentTab || "" } />
78- < motion . div
79+ { /* <motion.div
7980 className="fixed bottom-0 left-0 right-0 h-2 bg-primary origin-center"
8081 style={{ scaleX }}
81- />
82+ /> */ }
83+ < ProgressBar start = { "origin-center" } />
8284 </ article >
8385 </ section >
8486 < Footer />
You can’t perform that action at this time.
0 commit comments