diff --git a/apps/site/src/app/(home)/sections/Countdown/Countdown.tsx b/apps/site/src/app/(home)/sections/Countdown/Countdown.tsx index 07d67487..46575812 100644 --- a/apps/site/src/app/(home)/sections/Countdown/Countdown.tsx +++ b/apps/site/src/app/(home)/sections/Countdown/Countdown.tsx @@ -1,14 +1,15 @@ "use client"; -import bg_map from "@/assets/images/maps/countdown.svg"; import Image from "next/image"; -import useWindow from "./useWindow"; +import { useEffect, useState } from "react"; -import styles from "./Countdown.module.scss"; +import useWindow from "./useWindow"; import CountdownClock from "./CountdownClock"; -import { useEffect, useState } from "react"; -import boat from "@/assets/icons/boat.png"; +import bg_map from "@/assets/images/maps/countdown.svg"; +import boat from "@/assets/icons/boat.svg"; + +import styles from "./Countdown.module.scss"; interface CountdownProps { schedule: { @@ -63,12 +64,12 @@ const Countdown: React.FC = ({ schedule }) => { before.endTime.getTime() > 0 ? curTime.getTime() < before.startTime.getTime() ? 0 - : ((before.endTime.getTime() - curTime.getTime()) / + : 100 - ((before.endTime.getTime() - curTime.getTime()) / (before.endTime.getTime() - before.startTime.getTime())) * 100 : 100; - const [w, h] = useWindow(); + const [w, ] = useWindow(); const totalLines = Math.floor(w / 66) > 7 ? Math.floor(w / 66) : 7; @@ -90,7 +91,7 @@ const Countdown: React.FC = ({ schedule }) => { if (curTime > hackEndTime) { return (
- bg_map + background map for countdown

Hacking has ended!

@@ -100,7 +101,7 @@ const Countdown: React.FC = ({ schedule }) => { return (
- bg_map + background map for countdown {w > 0 && (
{curTime >= hackStartTime ? ( diff --git a/apps/site/src/app/(home)/sections/Countdown/useWindow.tsx b/apps/site/src/app/(home)/sections/Countdown/useWindow.tsx index 8988f639..d67fa2d9 100644 --- a/apps/site/src/app/(home)/sections/Countdown/useWindow.tsx +++ b/apps/site/src/app/(home)/sections/Countdown/useWindow.tsx @@ -3,10 +3,10 @@ import { useEffect, useState } from "react"; export default function useWindow() { const [size, setSize] = useState([0, 0]); useEffect(() => { - setSize([window.innerWidth, window.innerHeight]); function setWindowSize() { setSize([window.innerWidth, window.innerHeight]); } + setWindowSize(); window.addEventListener("resize", setWindowSize); return () => window.removeEventListener("resize", setWindowSize); }, []); diff --git a/apps/site/src/assets/icons/boat.png b/apps/site/src/assets/icons/boat.png deleted file mode 100644 index 98ef637f..00000000 Binary files a/apps/site/src/assets/icons/boat.png and /dev/null differ diff --git a/apps/site/src/assets/icons/boat.svg b/apps/site/src/assets/icons/boat.svg new file mode 100644 index 00000000..5e52dd32 --- /dev/null +++ b/apps/site/src/assets/icons/boat.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +