From 2130dd3ca1719512df20c5274dc7382e9b442e9a Mon Sep 17 00:00:00 2001 From: Joonatan Korpela Date: Wed, 6 Nov 2024 22:50:09 +0200 Subject: [PATCH] feat: Add syse page --- apps/web/src/app/[locale]/[...path]/page.tsx | 2 + .../src/app/[locale]/system-seven/content.tsx | 65 +++++++++++++++ .../src/app/[locale]/system-seven/page.tsx | 41 ++++++++++ .../[locale]/system-seven/system-seven.css | 82 +++++++++++++++++++ 4 files changed, 190 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]/[...path]/page.tsx b/apps/web/src/app/[locale]/[...path]/page.tsx index e36312e..b566e99 100644 --- a/apps/web/src/app/[locale]/[...path]/page.tsx +++ b/apps/web/src/app/[locale]/[...path]/page.tsx @@ -99,6 +99,8 @@ function Content({ content }: { content?: EditorState }) { } async function Page({ params: { path } }: Props) { + if (path.join("/") === "system-seven") return; + const locale = await getCurrentLocale(); const page = await getPage(path, locale); 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..97bbd68 --- /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..1fe471a --- /dev/null +++ b/apps/web/src/app/[locale]/system-seven/page.tsx @@ -0,0 +1,41 @@ +"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); + + if (loggedIn) return ; + + return ( +
+

Login

+
{ + e.preventDefault(); + const form = e.target as HTMLFormElement; + const password = form.querySelector("input")?.value; + if (password === "masterseven") setLoggedIn(true); + }} + className="flex flex-col gap-4" + > +
+ + +
+
+ +
+
+
+ ); +} 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; +}