From 2e0966aa49f4bdb5bad69d0f9596f19338f4fbe8 Mon Sep 17 00:00:00 2001 From: aronmal Date: Wed, 8 Feb 2023 11:06:31 +0100 Subject: [PATCH] Added 'lobby' page made with tailwind --- leaky-ships/.prettierrc.json | 4 +- leaky-ships/pages/dev/lobby.tsx | 101 ++++++++++++++++++++++++++++++++ leaky-ships/styles/globals.css | 12 ++++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 leaky-ships/pages/dev/lobby.tsx diff --git a/leaky-ships/.prettierrc.json b/leaky-ships/.prettierrc.json index cce9d3c..7e66ab7 100644 --- a/leaky-ships/.prettierrc.json +++ b/leaky-ships/.prettierrc.json @@ -1,3 +1,5 @@ { - "semi": false + "semi": false, + "plugins": ["prettier-plugin-tailwindcss"], + "pluginSearchDirs": false } diff --git a/leaky-ships/pages/dev/lobby.tsx b/leaky-ships/pages/dev/lobby.tsx new file mode 100644 index 0000000..f141898 --- /dev/null +++ b/leaky-ships/pages/dev/lobby.tsx @@ -0,0 +1,101 @@ +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" +import { faCaretDown } from "@fortawesome/sharp-solid-svg-icons" +import classNames from "classnames" +import { useEffect, useState } from "react" + +export default function Home() { + const [enemy, setEnemy] = useState(false) + const [dots, setDots] = useState(0) + + useEffect(() => { + if (enemy) return + const interval = setInterval(() => setDots((e) => (e % 3) + 1), 1000) + return () => clearInterval(interval) + }) + + return ( +
+ +
+
+

Leaky

+

Ships

+
+
+
+
+ +

+ Game-PIN: 3169 +

+ +
+
+ +

setEnemy((e) => !e)} + > + VS +

+ {enemy ? ( + + ) : ( +

+ Warte auf Spieler 2 {Array.from(Array(dots), () => ".").join("")} +

+ )} +
+
+ +
+
+
+ ) +} + +function Icon({ src, text }: { src: string; text: string }) { + return ( +
+ {src} + {text} +
+ ) +} +function Player({ + src, + text, + primary, +}: { + src: string + text: string + primary: boolean +}) { + return ( +
+

+ {text} +

+
+ {src} + +
+
+ ) +} diff --git a/leaky-ships/styles/globals.css b/leaky-ships/styles/globals.css index b5c61c9..31f5c41 100644 --- a/leaky-ships/styles/globals.css +++ b/leaky-ships/styles/globals.css @@ -1,3 +1,15 @@ @tailwind base; @tailwind components; @tailwind utilities; + +@import url("https://fonts.googleapis.com/css2?family=Farro:wght@300;400;500;700&display=swap"); + +.pixelart { + image-rendering: pixelated; + image-rendering: -moz-crisp-edges; + image-rendering: crisp-edges; +} + +.farro { + font-family: "Farro", sans-serif; +}