From 9ce74a722738ef255e8328d8ca5fc48d26ff38aa Mon Sep 17 00:00:00 2001 From: aronmal Date: Sun, 12 Feb 2023 02:17:06 +0100 Subject: [PATCH] Fairly responsive start page --- leaky-ships/components/BurgerMenu.tsx | 8 +- leaky-ships/components/Logo.tsx | 38 ++- leaky-ships/components/OptionButton.tsx | 9 +- leaky-ships/pages/_app.tsx | 1 - leaky-ships/pages/dev/index.tsx | 19 +- leaky-ships/pages/dev/lobby.tsx | 2 +- leaky-ships/styles/globals.css | 10 + leaky-ships/styles/homepage.scss | 330 ------------------------ 8 files changed, 59 insertions(+), 358 deletions(-) delete mode 100644 leaky-ships/styles/homepage.scss diff --git a/leaky-ships/components/BurgerMenu.tsx b/leaky-ships/components/BurgerMenu.tsx index 9d30dbe..eebcfa3 100644 --- a/leaky-ships/components/BurgerMenu.tsx +++ b/leaky-ships/components/BurgerMenu.tsx @@ -1,13 +1,13 @@ import React from "react" -function BurgerMenu({ onClick }: { onClick: () => void }) { +function BurgerMenu({ onClick }: { onClick?: () => void }) { return ( ) } diff --git a/leaky-ships/pages/_app.tsx b/leaky-ships/pages/_app.tsx index b439e1a..d829621 100644 --- a/leaky-ships/pages/_app.tsx +++ b/leaky-ships/pages/_app.tsx @@ -1,7 +1,6 @@ import "../styles/App.scss" import "../styles/grid.scss" import "../styles/grid2.scss" -import "../styles/homepage.scss" import "../styles/globals.css" import type { AppProps } from "next/app" diff --git a/leaky-ships/pages/dev/index.tsx b/leaky-ships/pages/dev/index.tsx index 9ce2c9f..84d5bfc 100644 --- a/leaky-ships/pages/dev/index.tsx +++ b/leaky-ships/pages/dev/index.tsx @@ -11,30 +11,33 @@ export default function Home() { const [heWantsToPlay, setHeWantsToPlay] = useState(false) return (
-
+ {!heWantsToPlay ? ( <> -
- +
+
) : ( -
+
-
+
Raum erstellen Raum beitreten Zuschauen diff --git a/leaky-ships/pages/dev/lobby.tsx b/leaky-ships/pages/dev/lobby.tsx index b0b493d..d072b6c 100644 --- a/leaky-ships/pages/dev/lobby.tsx +++ b/leaky-ships/pages/dev/lobby.tsx @@ -12,8 +12,8 @@ export default function Home() { - +
) diff --git a/leaky-ships/styles/globals.css b/leaky-ships/styles/globals.css index cd7766b..d4323cc 100644 --- a/leaky-ships/styles/globals.css +++ b/leaky-ships/styles/globals.css @@ -21,3 +21,13 @@ .font-checkpoint { font-family: "CP_Font", sans-serif; } + +button { + cursor: none; +} + +@media (pointer: fine) { + button { + cursor: pointer; + } +} diff --git a/leaky-ships/styles/homepage.scss b/leaky-ships/styles/homepage.scss deleted file mode 100644 index d54cc1d..0000000 --- a/leaky-ships/styles/homepage.scss +++ /dev/null @@ -1,330 +0,0 @@ -@use "./mixins/display" as *; -@use "./mixins/effects" as *; -@use "./mixins/CP_Font" as *; -@import "./mixins/variables"; - -@import url("https://fonts.googleapis.com/css2?family=Farro:wght@300;400;500;700&display=swap"); - -#box { - min-height: 100%; - background-color: #282c34; - @include flex-col; - align-items: center; - justify-content: space-around; - - #navExpand { - @include flex; - align-items: center; - justify-content: center; - position: absolute; - top: 64px; - left: 64px; - width: 96px; - height: 96px; - background-color: $grayish; - border-radius: 8px; - box-shadow: 0 0 2px 2px #0008 inset; - - #burgerMenu { - @include pixelart; - height: 84px; - width: 84px; - } - } - - #shield { - @include flex-row; - justify-content: center; - height: 250px; - width: 700px; - background-image: url("/assets/shield.png"); - background-repeat: no-repeat; - background-size: contain; - - #width { - @include flex-col; - justify-content: space-between; - - h1 { - @include CP_Font; - margin: 3%; - width: 100%; - text-align: center; - font-size: 5.8em; - letter-spacing: 6px; - - &:first-child { - border-top: 5px solid black; - } - - &:last-child { - border-bottom: 5px solid black; - } - } - } - } - - #videoWrapper { - position: relative; - display: flex; - align-items: center; - justify-content: center; - height: 350px; - width: 700px; - background-color: #2227; - border: 4px solid black; - border-radius: 8px; - - svg { - font-size: 6em; - color: #231f20; - - path { - stroke: black; - stroke-width: 2px; - stroke-linejoin: round; - } - } - } - - #startButton { - font-family: "Farro", sans-serif; - font-weight: bold; - font-size: 3em; - color: black; - background-color: $warn; - border: none; - border-radius: 8px; - padding: calc(2rem + 8px) 6rem 2rem 6rem; - } - - #startBox { - display: flex; - flex-direction: column; - align-items: center; - background-color: $grayish; - box-shadow: 0 0 2px 2px #fffb inset, 0 0 2px 2px #fff2; - border: 4px solid black; - padding: 3rem; - border-radius: 8px; - min-width: 60vw; - gap: 2rem; - - #back { - font-size: 3em; - color: $grayish; - align-self: flex-start; - background-color: #000c; - border: none; - border-radius: 8px; - padding: 0 0.5rem; - margin-top: -1.5rem; - width: 10rem; - box-shadow: 0 0 2px 2px #fff6 inset; - border: 2px solid #000c; - } - - #sameWidth { - display: flex; - flex-direction: column; - align-items: center; - gap: 3rem; - - .optionButton { - @include flex-row; - justify-content: space-between; - align-items: center; - font-size: 2.5em; - color: $grayish; - background-color: #000c; - border: none; - border-radius: 8px; - padding: 1rem 2rem 1rem 4rem; - width: 100%; - box-shadow: 0 0 2px 2px #fff6 inset; - border: 2px solid #000c; - - &:last-child { - margin-top: 2rem; - } - - span { - margin: 0 auto; - } - - svg { - margin-left: 3rem; - font-size: 2em; - width: 2.5rem; - height: inherit; - } - } - } - } -} - -@media (max-width: 2000px) { - #box { - #shield { - height: 200px; - width: 560px; - - #width { - h1 { - font-size: 4.5em; - letter-spacing: 4px; - - &:first-child { - border-top: 4px solid black; - } - - &:last-child { - border-bottom: 4px solid black; - } - } - } - } - } -} - -@media (max-width: 1000px) { - #box { - #navExpand { - top: 32px; - left: 32px; - width: 80px; - height: 80px; - - #burgerMenu { - height: 64px; - width: 64px; - } - } - - #shield { - height: 160px; - width: 450px; - - #width { - h1 { - font-size: 3.6em; - letter-spacing: 3px; - - &:first-child { - border-top: 3px solid black; - } - - &:last-child { - border-bottom: 3px solid black; - } - } - } - } - - #videoWrapper { - height: 300px; - width: 600px; - } - } -} - -@media (max-width: 700px) { - #box { - justify-content: space-evenly; - - #navExpand { - top: 16px; - left: 16px; - width: 64px; - height: 64px; - - #burgerMenu { - height: 44px; - width: 44px; - } - } - - #shield { - height: 100px; - width: 280px; - - #width { - h1 { - font-size: 2.2em; - letter-spacing: 2px; - - &:first-child { - border-top: 2px solid black; - } - - &:last-child { - border-bottom: 2px solid black; - } - } - } - } - - #videoWrapper { - height: 250px; - width: 450px; - - svg { - font-size: 4em; - } - } - - #startButton { - font-size: 2em; - padding: calc(1rem + 8px) 3rem 1rem 3rem; - } - - #startBox { - max-width: 90vw; - padding: 2rem; - - #back { - margin-top: -1rem; - font-size: 2em; - width: 7rem; - padding: 0.125rem; - } - - #sameWidth { - max-width: 100%; - - .optionButton { - font-size: 2em; - padding: 1rem 2rem; - - svg { - margin-left: 2rem; - font-size: 1.5em; - width: 2rem; - } - } - } - } - } -} - -@media (max-width: 500px) { - #box { - #videoWrapper { - height: 150px; - width: 300px; - } - - #startBox { - #sameWidth { - .optionButton { - font-size: 1.5em; - - svg { - margin-left: 1rem; - font-size: 1em; - } - } - } - } - } -}