diff --git a/leaky-ships/components/BurgerMenu.tsx b/leaky-ships/components/BurgerMenu.tsx new file mode 100644 index 0000000..485535e --- /dev/null +++ b/leaky-ships/components/BurgerMenu.tsx @@ -0,0 +1,15 @@ +import React from "react" + +function BurgerMenu() { + return ( + + ) +} + +export default BurgerMenu diff --git a/leaky-ships/components/BorderTiles.tsx b/leaky-ships/components/Gamefield/BorderTiles.tsx similarity index 92% rename from leaky-ships/components/BorderTiles.tsx rename to leaky-ships/components/Gamefield/BorderTiles.tsx index eef503b..d55f3c1 100644 --- a/leaky-ships/components/BorderTiles.tsx +++ b/leaky-ships/components/Gamefield/BorderTiles.tsx @@ -1,6 +1,6 @@ import { CSSProperties, Dispatch, SetStateAction } from "react" -import { borderCN, cornerCN, fieldIndex } from "../lib/utils/helpers" -import { Position, MouseCursor } from "../interfaces/frontend" +import { borderCN, cornerCN, fieldIndex } from "../../lib/utils/helpers" +import { Position, MouseCursor } from "../../interfaces/frontend" type TilesType = { key: number diff --git a/leaky-ships/components/EventBar.tsx b/leaky-ships/components/Gamefield/EventBar.tsx similarity index 94% rename from leaky-ships/components/EventBar.tsx rename to leaky-ships/components/Gamefield/EventBar.tsx index cdb1353..897f2f6 100644 --- a/leaky-ships/components/EventBar.tsx +++ b/leaky-ships/components/Gamefield/EventBar.tsx @@ -1,5 +1,5 @@ import React, { Dispatch, SetStateAction } from "react" -import { Items, Target } from "../interfaces/frontend" +import { Items, Target } from "../../interfaces/frontend" import Item from "./Item" function EventBar({ diff --git a/leaky-ships/components/FogImages.tsx b/leaky-ships/components/Gamefield/FogImages.tsx similarity index 100% rename from leaky-ships/components/FogImages.tsx rename to leaky-ships/components/Gamefield/FogImages.tsx diff --git a/leaky-ships/components/Gamefield.tsx b/leaky-ships/components/Gamefield/Gamefield.tsx similarity index 95% rename from leaky-ships/components/Gamefield.tsx rename to leaky-ships/components/Gamefield/Gamefield.tsx index 8a9b630..3ca4420 100644 --- a/leaky-ships/components/Gamefield.tsx +++ b/leaky-ships/components/Gamefield/Gamefield.tsx @@ -6,7 +6,7 @@ import EventBar from "./EventBar" import HitElems from "./HitElems" import Labeling from "./Labeling" import Ships from "./Ships" -import useGameEvent from "../lib/hooks/useGameEvent" +import useGameEvent from "../../lib/hooks/useGameEvent" import Targets from "./Targets" function Gamefield() { diff --git a/leaky-ships/components/GamefieldPointer.tsx b/leaky-ships/components/Gamefield/GamefieldPointer.tsx similarity index 94% rename from leaky-ships/components/GamefieldPointer.tsx rename to leaky-ships/components/Gamefield/GamefieldPointer.tsx index c90cc9e..89473b0 100644 --- a/leaky-ships/components/GamefieldPointer.tsx +++ b/leaky-ships/components/Gamefield/GamefieldPointer.tsx @@ -3,7 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { CSSProperties } from "react" import classNames from "classnames" import { faRadar } from "@fortawesome/pro-thin-svg-icons" -import { Target, TargetList } from "../interfaces/frontend" +import { Target, TargetList } from "../../interfaces/frontend" export interface PointerProps extends Target, TargetList { imply: boolean diff --git a/leaky-ships/components/HitElems.tsx b/leaky-ships/components/Gamefield/HitElems.tsx similarity index 91% rename from leaky-ships/components/HitElems.tsx rename to leaky-ships/components/Gamefield/HitElems.tsx index 0a39749..c94d832 100644 --- a/leaky-ships/components/HitElems.tsx +++ b/leaky-ships/components/Gamefield/HitElems.tsx @@ -1,7 +1,7 @@ import { faBurst, faXmark } from "@fortawesome/pro-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { CSSProperties } from "react" -import { Hit } from "../interfaces/frontend" +import { Hit } from "../../interfaces/frontend" function HitElems({ hits }: { hits: Hit[] }) { return ( diff --git a/leaky-ships/components/Item.tsx b/leaky-ships/components/Gamefield/Item.tsx similarity index 100% rename from leaky-ships/components/Item.tsx rename to leaky-ships/components/Gamefield/Item.tsx diff --git a/leaky-ships/components/Labeling.tsx b/leaky-ships/components/Gamefield/Labeling.tsx similarity index 91% rename from leaky-ships/components/Labeling.tsx rename to leaky-ships/components/Gamefield/Labeling.tsx index 6244ed5..bbdf784 100644 --- a/leaky-ships/components/Labeling.tsx +++ b/leaky-ships/components/Gamefield/Labeling.tsx @@ -1,7 +1,7 @@ import classNames from "classnames" import { CSSProperties } from "react" -import { fieldIndex } from "../lib/utils/helpers" -import { Field } from "../interfaces/frontend" +import { fieldIndex } from "../../lib/utils/helpers" +import { Field } from "../../interfaces/frontend" function Labeling({ count }: { count: number }) { let elems: (Field & { diff --git a/leaky-ships/components/Ships.tsx b/leaky-ships/components/Gamefield/Ships.tsx similarity index 100% rename from leaky-ships/components/Ships.tsx rename to leaky-ships/components/Gamefield/Ships.tsx diff --git a/leaky-ships/components/Targets.tsx b/leaky-ships/components/Gamefield/Targets.tsx similarity index 92% rename from leaky-ships/components/Targets.tsx rename to leaky-ships/components/Gamefield/Targets.tsx index 6388a5b..38c2f29 100644 --- a/leaky-ships/components/Targets.tsx +++ b/leaky-ships/components/Gamefield/Targets.tsx @@ -1,5 +1,5 @@ import React from "react" -import { Target } from "../interfaces/frontend" +import { Target } from "../../interfaces/frontend" import GamefieldPointer, { PointerProps } from "./GamefieldPointer" function Targets({ diff --git a/leaky-ships/components/Lobby/Icon.tsx b/leaky-ships/components/Lobby/Icon.tsx new file mode 100644 index 0000000..ac663d5 --- /dev/null +++ b/leaky-ships/components/Lobby/Icon.tsx @@ -0,0 +1,25 @@ +function Icon({ + src, + text, + onClick, +}: { + src: string + text: string + onClick?: () => void +}) { + return ( + + ) +} + +export default Icon diff --git a/leaky-ships/components/Lobby/LobbyFrame.tsx b/leaky-ships/components/Lobby/LobbyFrame.tsx new file mode 100644 index 0000000..ad4852e --- /dev/null +++ b/leaky-ships/components/Lobby/LobbyFrame.tsx @@ -0,0 +1,61 @@ +import { useEffect, useState } from "react" +import Settings from "../SettingsFrame/Settings" +import Icon from "./Icon" +import Player from "./Player" + +function LobbyFrame() { + const [settings, setSettings] = useState(false) + 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 ( +
setEnemy((e) => !e)} + > + VS +
+ {enemy ? ( ++ Warte auf Spieler 2 {Array.from(Array(dots), () => ".").join("")} +
+ )} ++ {text} +
+setEnemy((e) => !e)} - > - VS -
- {enemy ? ( -- Warte auf Spieler 2 {Array.from(Array(dots), () => ".").join("")} -
- )} -- {text} -
-