From c0d74166879bce4071d79dd1edb7251373378ace Mon Sep 17 00:00:00 2001 From: samanthathompson52 Date: Wed, 3 Apr 2024 19:18:44 -0400 Subject: [PATCH] Update help modal style and added tooltips --- client/src/App.css | 12 +++++++++++ client/src/components/Answer.tsx | 3 ++- client/src/components/Header.tsx | 3 ++- client/src/components/Help.tsx | 8 ++++---- client/src/components/Join.tsx | 34 +++++++++++++++++++++++++++----- client/tailwind.config.js | 4 ++-- 6 files changed, 51 insertions(+), 13 deletions(-) diff --git a/client/src/App.css b/client/src/App.css index 1443700..3eb3989 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -67,6 +67,10 @@ p { line-height: normal; } +span { + font-family: Mochiy Pop One; +} + /* Reset some default styles */ html, body { margin: 0; @@ -125,6 +129,14 @@ html, body { background-color: var(--orange); } +.tooltip { + @apply invisible absolute; +} + +.has-tooltip:hover .tooltip { + @apply visible z-50; +} + @media only screen and (max-width: 640px) { h1 { font-size: 2.2rem; diff --git a/client/src/components/Answer.tsx b/client/src/components/Answer.tsx index 14eafc4..c6c76aa 100644 --- a/client/src/components/Answer.tsx +++ b/client/src/components/Answer.tsx @@ -20,7 +20,8 @@ const Answer = ({sendJsonMessage, prompt, players, playerId, isHost}: {sendJsonM

{prompt} {isHost && -
+
+ Skip this prompt diff --git a/client/src/components/Header.tsx b/client/src/components/Header.tsx index 15365a7..466dc49 100644 --- a/client/src/components/Header.tsx +++ b/client/src/components/Header.tsx @@ -19,7 +19,8 @@ const Header = ({roomCode}: {roomCode:string}) => {
{roomCode !== "" && -
copyRoomCode()}> +
copyRoomCode()}> + Click here to copy
the game link!

Room Code:
{roomCode}

}
diff --git a/client/src/components/Help.tsx b/client/src/components/Help.tsx index ab23f6b..315d961 100644 --- a/client/src/components/Help.tsx +++ b/client/src/components/Help.tsx @@ -21,12 +21,12 @@ export default function Help({open, setOpen, title, text}: {open: boolean, setOp leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > - -
+ +
- - {title} + +

{title}

setOpen(false)} className="cursor-pointer h-7 w-7 absolute right-2 top-2" aria-hidden="true" />
diff --git a/client/src/components/Join.tsx b/client/src/components/Join.tsx index 133405a..2036965 100644 --- a/client/src/components/Join.tsx +++ b/client/src/components/Join.tsx @@ -13,6 +13,7 @@ const Join = ({sendJsonMessage, roomCode, setRoomCode}: {sendJsonMessage: any, r const roomParam = queryParameters.get("room") if (roomParam === undefined || roomParam === null) return; roomCodeInput(roomParam); + setType("join_room"); }); const createRoom = () => { @@ -30,6 +31,11 @@ const Join = ({sendJsonMessage, roomCode, setRoomCode}: {sendJsonMessage: any, r }); }; + const goBack = () => { + setType(""); + setRoomCode(""); + }; + const usernameInput = (inStr: string) => { if (!verifyInput(inStr, 10)) return; setUsername(inStr); @@ -52,15 +58,33 @@ const Join = ({sendJsonMessage, roomCode, setRoomCode}: {sendJsonMessage: any, r

Enter your name:

- usernameInput(e.target.value)} + usernameInput(e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + enterRoom(); + } + }} className="orange-input" />
{type === "join_room" &&

Enter room code:

- roomCodeInput(e.target.value)} + roomCodeInput(e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + enterRoom(); + } + }} className="orange-input" />
} @@ -73,7 +97,7 @@ const Join = ({sendJsonMessage, roomCode, setRoomCode}: {sendJsonMessage: any, r
-