Homepage tailwindcss rework

This commit is contained in:
aronmal 2023-02-11 13:34:50 +01:00
parent a15da1bf7a
commit 44e3b58cb4
Signed by: aronmal
GPG key ID: 816B7707426FC612
7 changed files with 70 additions and 42 deletions

View file

@ -1,10 +1,12 @@
import { ReactNode } from "react"
function Icon({ function Icon({
src, src,
text, children,
onClick, onClick,
}: { }: {
src: string src: string
text: string children: ReactNode
onClick?: () => void onClick?: () => void
}) { }) {
return ( return (
@ -17,7 +19,7 @@ function Icon({
src={"/assets/" + src} src={"/assets/" + src}
alt={src} alt={src}
/> />
<span className="font-semibold">{text}</span> <span className="font-semibold">{children}</span>
</button> </button>
) )
} }

View file

@ -1,5 +1,5 @@
import { useEffect, useState } from "react" import { useEffect, useState } from "react"
import Settings from "../SettingsFrame/Settings" import Settings from "./SettingsFrame/Settings"
import Icon from "./Icon" import Icon from "./Icon"
import Player from "./Player" import Player from "./Player"
@ -17,15 +17,13 @@ function LobbyFrame() {
return ( return (
<div className="mx-32 flex flex-col self-stretch rounded-3xl bg-gray-400"> <div className="mx-32 flex flex-col self-stretch rounded-3xl bg-gray-400">
<div className="flex items-center justify-between border-b-2 border-slate-900"> <div className="flex items-center justify-between border-b-2 border-slate-900">
<Icon src="speech_bubble.png" text="Chat" /> <Icon src="speech_bubble.png">Chat</Icon>
<h1 className="font-farro text-5xl font-medium"> <h1 className="font-farro text-5xl font-medium">
Game-PIN: <span className="underline">3169</span> Game-PIN: <span className="underline">3169</span>
</h1> </h1>
<Icon <Icon src="gear.png" onClick={() => setSettings(true)}>
src="gear.png" Settings
text="Settings" </Icon>
onClick={() => setSettings(true)}
/>
</div> </div>
<div className="flex items-center justify-around"> <div className="flex items-center justify-around">
<Player <Player

View file

@ -0,0 +1,27 @@
import {
FontAwesomeIcon,
FontAwesomeIconProps,
} from "@fortawesome/react-fontawesome"
import { ReactNode } from "react"
function OptionButton({
icon,
action,
children,
}: {
icon: FontAwesomeIconProps["icon"]
action?: () => void
children: ReactNode
}) {
return (
<button
className="flex w-full flex-row items-center justify-between rounded-lg border-2 border-black bg-voidDark py-4 pr-8 pl-16 text-4xl text-grayish first:mt-8 last:mt-8"
onClick={action}
>
<span className="mx-auto">{children}</span>
<FontAwesomeIcon className="ml-12 w-10 text-4xl" icon={icon} />
</button>
)
}
export default OptionButton

View file

@ -5,43 +5,43 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { useState } from "react" import { useState } from "react"
import Logo from "../../components/Logo" import Logo from "../../components/Logo"
import BurgerMenu from "../../components/BurgerMenu" import BurgerMenu from "../../components/BurgerMenu"
import OptionButton from "../../components/OptionButton"
export default function Home() { export default function Home() {
const [heWantsToPlay, setHeWantsToPlay] = useState(false) const [heWantsToPlay, setHeWantsToPlay] = useState<boolean | null>(false)
return ( return (
<div id="box"> <div className="h-full bg-theme">
<BurgerMenu /> <BurgerMenu />
<div className="mx-auto flex h-full max-w-screen-md flex-col items-center justify-around">
<Logo /> <Logo />
{!heWantsToPlay ? ( {!heWantsToPlay ? (
<> <>
<div id="videoWrapper"> <div className="transition-color flex h-full max-h-80 w-full max-w-screen-sm items-center justify-center rounded-xl border-4 border-black bg-[#2227] duration-200">
<FontAwesomeIcon icon={faCirclePlay} /> <FontAwesomeIcon className="text-8xl" icon={faCirclePlay} />
</div> </div>
<button id="startButton" onClick={() => setHeWantsToPlay(true)}> <button
className="font-farro transition-color rounded-2xl border-b-8 border-orange-400 bg-warn px-24 pt-10 pb-8 text-5xl font-bold duration-100 active:border-t-8 active:border-b-0"
onClick={() => setTimeout(() => setHeWantsToPlay(true), 200)}
>
START START
</button> </button>
</> </>
) : ( ) : (
<div id="startBox"> <div className="gap flex w-full flex-col items-center rounded-xl border-4 border-black bg-grayish p-12 shadow-lg">
<button id="back" onClick={() => setHeWantsToPlay(false)}> <button
className="mt-[-1.5rem] w-40 self-start rounded-lg border-2 border-black bg-voidDark px-2 text-5xl text-grayish"
onClick={() => setHeWantsToPlay(false)}
>
<FontAwesomeIcon icon={faLeftLong} /> <FontAwesomeIcon icon={faLeftLong} />
</button> </button>
<div id="sameWidth"> <div className="flex flex-col items-center gap-12">
<button className="optionButton"> <OptionButton icon={faPlus}>Raum erstellen</OptionButton>
<span>Raum erstellen</span> <OptionButton icon={faUserPlus}>Raum beitreten</OptionButton>
<FontAwesomeIcon icon={faPlus} /> <OptionButton icon={faEye}>Zuschauen</OptionButton>
</button>
<button className="optionButton">
<span>Raum beitreten</span>
<FontAwesomeIcon icon={faUserPlus} />
</button>
<button className="optionButton">
<span>Zuschauen</span>
<FontAwesomeIcon icon={faEye} />
</button>
</div> </div>
</div> </div>
)} )}
</div> </div>
</div>
) )
} }

View file

@ -28,6 +28,7 @@ module.exports = {
theme: "#282c34", theme: "#282c34",
grayish: "#b1b2b5cc", grayish: "#b1b2b5cc",
warn: "#fabd04", warn: "#fabd04",
voidDark: "#000c",
"shield-gray": "#616161", "shield-gray": "#616161",
"shield-lightgray": "#989898", "shield-lightgray": "#989898",
}, },