diff --git a/app/projects/[slug]/page.jsx b/app/projects/[slug]/page.jsx index fa1a6f0..f86173f 100644 --- a/app/projects/[slug]/page.jsx +++ b/app/projects/[slug]/page.jsx @@ -1,5 +1,6 @@ "use client"; import { useState, useEffect } from "react"; +import { motion } from "framer-motion"; import jsonData from "../../../json/data.json"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -9,9 +10,48 @@ import NotFound from "@/app/not-found"; import Image from "next/image"; import FixedButon from "@/components/FixedButton"; import { faChevronLeft } from "@fortawesome/free-solid-svg-icons"; +import { faChevronDown } from "@fortawesome/free-solid-svg-icons"; +import { faChevronUp } from "@fortawesome/free-solid-svg-icons"; + +function ScrollDownButton() { + const [isAtBottom, setIsAtBottom] = useState(false); + + const handleScroll = () => { + const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + if (scrollTop < document.documentElement.scrollHeight - document.documentElement.clientHeight) { + + window.scrollTo({ + top: document.documentElement.scrollHeight, + behavior: "smooth", + }); + setIsAtBottom(true); + + } else { + window.scrollTo({ + top: 0, + behavior: "smooth", + }); + setIsAtBottom(false); + } + }; + + return ( +