diff --git a/public/fonts/minecraft-five-bold.ttf b/public/fonts/minecraft-five-bold.ttf new file mode 100644 index 00000000..9fed1821 Binary files /dev/null and b/public/fonts/minecraft-five-bold.ttf differ diff --git a/src/components/DonateButton.tsx b/src/components/DonateButton.tsx index 02b5a079..0cf6ba03 100644 --- a/src/components/DonateButton.tsx +++ b/src/components/DonateButton.tsx @@ -1,17 +1,49 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { IconHeart } from "@tabler/icons-react"; import { supporters } from "@/data/supporters"; const DonateButton = () => { const [isHovered, setIsHovered] = useState(false); + const [isNearBottom, setIsNearBottom] = useState(false); const supporterCount = supporters.length; + useEffect(() => { + const handleScroll = () => { + const scrollTop = Math.max( + document.documentElement.scrollTop, + document.body.scrollTop, + ); + const viewportHeight = window.innerHeight; + const fullHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight, + ); + setIsNearBottom(fullHeight - (scrollTop + viewportHeight) < 200); + }; + + handleScroll(); + document.addEventListener("scroll", handleScroll, true); + window.addEventListener("resize", handleScroll); + const resizeObserver = new ResizeObserver(handleScroll); + resizeObserver.observe(document.body); + return () => { + document.removeEventListener("scroll", handleScroll, true); + window.removeEventListener("resize", handleScroll); + resizeObserver.disconnect(); + }; + }, []); + return ( -
setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} + initial={false} + animate={{ opacity: isNearBottom ? 0 : 1 }} + transition={{ duration: 0.3, ease: "easeOut" }} + style={{ pointerEvents: isNearBottom ? "none" : "auto" }} + aria-hidden={isNearBottom} > { )} -
+ ); }; diff --git a/src/components/PopularTools.tsx b/src/components/PopularTools.tsx index 0c0a7c19..c1ce23c3 100644 --- a/src/components/PopularTools.tsx +++ b/src/components/PopularTools.tsx @@ -75,7 +75,7 @@ const PopularTools = () => {