From e5b145e7e9dd2283927f8cb0a3fa5cc5f9723edd Mon Sep 17 00:00:00 2001 From: Joonatan Korpela Date: Wed, 6 Nov 2024 22:50:09 +0200 Subject: [PATCH] chore: Small fixes --- .../src/app/[locale]/system-seven/content.tsx | 65 +++++++++++++++ .../src/app/[locale]/system-seven/page.tsx | 46 +++++++++++ .../[locale]/system-seven/system-seven.css | 82 +++++++++++++++++++ 3 files changed, 193 insertions(+) create mode 100644 apps/web/src/app/[locale]/system-seven/content.tsx create mode 100644 apps/web/src/app/[locale]/system-seven/page.tsx create mode 100644 apps/web/src/app/[locale]/system-seven/system-seven.css diff --git a/apps/web/src/app/[locale]/system-seven/content.tsx b/apps/web/src/app/[locale]/system-seven/content.tsx new file mode 100644 index 0000000..6a1438b --- /dev/null +++ b/apps/web/src/app/[locale]/system-seven/content.tsx @@ -0,0 +1,65 @@ +"use client"; +import { useEffect, useState } from "react"; +import "./system-seven.css"; + +const useCountdown = (date: Date) => { + const [timeLeft, setTimeLeft] = useState( + date.getTime() - new Date().getTime(), + ); + + useEffect(() => { + const timer = setTimeout(() => { + setTimeLeft(date.getTime() - new Date().getTime()); + }, new Date(timeLeft).getMilliseconds()); + + return () => { + clearTimeout(timer); + }; + }, [date, timeLeft]); + + const days = Math.floor(timeLeft / (1000 * 60 * 60 * 24)); + const hours = Math.floor((timeLeft / (1000 * 60 * 60)) % 24); + const minutes = Math.floor((timeLeft / 1000 / 60) % 60); + const seconds = Math.floor((timeLeft / 1000) % 60); + + return [days, hours, minutes, seconds]; +}; + +export default function SyseContent() { + const eventDate = new Date("2024-12-01T16:00:00.000+02:00"); + const [days, hours, minutes, seconds] = useCountdown(eventDate); + const f = (n: number) => `0${n.toString()}`.slice(-2); + const dateString = `${f(days)}:${f(hours)}:${f(minutes)}:${f(seconds)}`; + + return ( +
+
+
+

Day of Destruction

+

+ {dateString} +

+
+
+
+

+ Mind control machine instructions +

+

+ The mind control machine utilizes the fuksi crystal's power to + control the minds of Teekkaris. Please watch the video below before + operating the machine. +

+
+
+ +
+
+ ); +} diff --git a/apps/web/src/app/[locale]/system-seven/page.tsx b/apps/web/src/app/[locale]/system-seven/page.tsx new file mode 100644 index 0000000..bc3c76c --- /dev/null +++ b/apps/web/src/app/[locale]/system-seven/page.tsx @@ -0,0 +1,46 @@ +"use client"; + +import { Button, Input } from "@tietokilta/ui"; +import dynamic from "next/dynamic"; +import { useState } from "react"; + +const SyseContent = dynamic(() => import("./content")); + +export default function Page() { + const [loggedIn, setLoggedIn] = useState(false); + const [errorText, setErrorText] = useState(""); + + if (loggedIn) return ; + + return ( +
+

Login

+
{ + e.preventDefault(); + const form = e.target as HTMLFormElement; + const password = form.querySelector("input")?.value; + if (password === "masterseven") setLoggedIn(true); + else setErrorText("Incorrect password"); + }} + className="flex flex-col gap-4" + > +
+ + +
+
+ +
+

{errorText}

+
+
+ ); +} diff --git a/apps/web/src/app/[locale]/system-seven/system-seven.css b/apps/web/src/app/[locale]/system-seven/system-seven.css new file mode 100644 index 0000000..d833a37 --- /dev/null +++ b/apps/web/src/app/[locale]/system-seven/system-seven.css @@ -0,0 +1,82 @@ +.wrapper { + height: 70vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.header { + font-size: 3rem; + color: theme("colors.red.600"); + text-shadow: 0 0 1rem theme("colors.red.600"); + + @media not screen(md) { + font-size: 2rem; + } +} + +.time { + margin: 0rem; + font-size: 6rem; + color: theme("colors.red.600"); + text-shadow: 0 0 1rem theme("colors.red.600"); + + @media not screen(md) { + font-size: 4rem; + } +} + +.header-container { + display: flex; + padding: 2rem; + width: 40rem; + flex-direction: column; + align-items: center; +} + +.text-container { + display: flex; + padding: 2rem; + width: 60rem; + max-width: calc(100vw - 4rem); + flex-direction: column; + align-items: center; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.video-container { + padding-top: 10rem; + padding-bottom: 10rem; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.video { + max-width: calc(100vw - 4rem); + box-shadow: 0 0 2rem 0.5rem theme("colors.red.600"); +} + +a, +svg, +h2, +p, +span { + color: theme("colors.red.600"); +} + +img { + /* Filter that turns white to red */ + filter: invert(8%) sepia(96%) saturate(5343%) hue-rotate(354deg) + brightness(108%) contrast(103%) !important; +} + +img[alt~="Tietokilta"] { + /* For some reason the above filter doesn't work on this image */ + filter: invert(92%) sepia(96%) saturate(5343%) hue-rotate(354deg) + brightness(108%) contrast(103%) !important; +}