{children}
diff --git a/app/page.tsx b/app/page.tsx
index d304177..e1f60b9 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -13,7 +13,7 @@ export default async function Home() {
@@ -32,7 +32,7 @@ export default async function Home() {
diff --git a/components/CustomScrollbar.tsx b/components/CustomScrollbar.tsx
new file mode 100644
index 0000000..69a4307
--- /dev/null
+++ b/components/CustomScrollbar.tsx
@@ -0,0 +1,58 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+
+export default function CustomScrollbar() {
+ const [scrollbarHeight, setScrollbarHeight] = useState(0);
+ const [scrollbarTop, setScrollbarTop] = useState(0);
+ const [isVisible, setIsVisible] = useState(false);
+ const timeoutRef = useRef();
+
+ useEffect(() => {
+ const updateScrollbar = () => {
+ const windowHeight = window.innerHeight;
+ const documentHeight = document.documentElement.scrollHeight;
+ const scrollTop = window.scrollY;
+
+ const scrollbarHeight = (windowHeight / documentHeight) * windowHeight;
+ const scrollbarTop = (scrollTop / documentHeight) * windowHeight;
+
+ setScrollbarHeight(scrollbarHeight);
+ setScrollbarTop(scrollbarTop);
+
+ setIsVisible(true);
+
+ if (timeoutRef.current) {
+ clearTimeout(timeoutRef.current);
+ }
+
+ timeoutRef.current = setTimeout(() => {
+ setIsVisible(false);
+ }, 1000);
+ };
+
+ window.addEventListener("scroll", updateScrollbar);
+ window.addEventListener("resize", updateScrollbar);
+ updateScrollbar();
+
+ return () => {
+ window.removeEventListener("scroll", updateScrollbar);
+ window.removeEventListener("resize", updateScrollbar);
+ if (timeoutRef.current) {
+ clearTimeout(timeoutRef.current);
+ }
+ };
+ }, []);
+
+ return (
+
+
+
+ );
+}
diff --git a/components/SmoothScroll.tsx b/components/SmoothScroll.tsx
index d4dd1b4..e09b03d 100644
--- a/components/SmoothScroll.tsx
+++ b/components/SmoothScroll.tsx
@@ -2,6 +2,7 @@
import Lenis from "@studio-freight/lenis";
import { useEffect } from "react";
+import CustomScrollbar from "./CustomScrollbar";
export default function SmoothScroll({
children,
@@ -30,5 +31,10 @@ export default function SmoothScroll({
};
}, []);
- return <>{children}>;
+ return (
+ <>
+ {children}
+
+ >
+ );
}
diff --git a/components/navbar.tsx b/components/navbar.tsx
index eaf6f25..8a66f90 100644
--- a/components/navbar.tsx
+++ b/components/navbar.tsx
@@ -27,11 +27,11 @@ export function Navbar() {
return (
diff --git a/components/CustomScrollbar.tsx b/components/CustomScrollbar.tsx
new file mode 100644
index 0000000..69a4307
--- /dev/null
+++ b/components/CustomScrollbar.tsx
@@ -0,0 +1,58 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+
+export default function CustomScrollbar() {
+ const [scrollbarHeight, setScrollbarHeight] = useState(0);
+ const [scrollbarTop, setScrollbarTop] = useState(0);
+ const [isVisible, setIsVisible] = useState(false);
+ const timeoutRef = useRef();
+
+ useEffect(() => {
+ const updateScrollbar = () => {
+ const windowHeight = window.innerHeight;
+ const documentHeight = document.documentElement.scrollHeight;
+ const scrollTop = window.scrollY;
+
+ const scrollbarHeight = (windowHeight / documentHeight) * windowHeight;
+ const scrollbarTop = (scrollTop / documentHeight) * windowHeight;
+
+ setScrollbarHeight(scrollbarHeight);
+ setScrollbarTop(scrollbarTop);
+
+ setIsVisible(true);
+
+ if (timeoutRef.current) {
+ clearTimeout(timeoutRef.current);
+ }
+
+ timeoutRef.current = setTimeout(() => {
+ setIsVisible(false);
+ }, 1000);
+ };
+
+ window.addEventListener("scroll", updateScrollbar);
+ window.addEventListener("resize", updateScrollbar);
+ updateScrollbar();
+
+ return () => {
+ window.removeEventListener("scroll", updateScrollbar);
+ window.removeEventListener("resize", updateScrollbar);
+ if (timeoutRef.current) {
+ clearTimeout(timeoutRef.current);
+ }
+ };
+ }, []);
+
+ return (
+
+
+
+ );
+}
diff --git a/components/SmoothScroll.tsx b/components/SmoothScroll.tsx
index d4dd1b4..e09b03d 100644
--- a/components/SmoothScroll.tsx
+++ b/components/SmoothScroll.tsx
@@ -2,6 +2,7 @@
import Lenis from "@studio-freight/lenis";
import { useEffect } from "react";
+import CustomScrollbar from "./CustomScrollbar";
export default function SmoothScroll({
children,
@@ -30,5 +31,10 @@ export default function SmoothScroll({
};
}, []);
- return <>{children}>;
+ return (
+ <>
+ {children}
+
+ >
+ );
}
diff --git a/components/navbar.tsx b/components/navbar.tsx
index eaf6f25..8a66f90 100644
--- a/components/navbar.tsx
+++ b/components/navbar.tsx
@@ -27,11 +27,11 @@ export function Navbar() {
return (
+
+
+ );
+}
diff --git a/components/SmoothScroll.tsx b/components/SmoothScroll.tsx
index d4dd1b4..e09b03d 100644
--- a/components/SmoothScroll.tsx
+++ b/components/SmoothScroll.tsx
@@ -2,6 +2,7 @@
import Lenis from "@studio-freight/lenis";
import { useEffect } from "react";
+import CustomScrollbar from "./CustomScrollbar";
export default function SmoothScroll({
children,
@@ -30,5 +31,10 @@ export default function SmoothScroll({
};
}, []);
- return <>{children}>;
+ return (
+ <>
+ {children}
+