From d6e7f408afe0d9ef01147bf7b9b4070ddc022d41 Mon Sep 17 00:00:00 2001
From: liuisaac <80558145+liuisaac@users.noreply.github.com>
Date: Tue, 19 Nov 2024 21:03:03 -0800
Subject: [PATCH 1/3] added leaderboard poc and fixed withdrawl button
---
.../components/dataverse/Dashboard.js | 5 +-
.../components/dataverse/Leaderboard.js | 272 ++++++++++++++----
.../Companion/components/dataverse/Quiz.js | 4 +-
.../public/Companion/events/DataVerse2024.js | 36 +--
src/router.js | 5 +-
5 files changed, 246 insertions(+), 76 deletions(-)
diff --git a/src/pages/public/Companion/components/dataverse/Dashboard.js b/src/pages/public/Companion/components/dataverse/Dashboard.js
index b0a85b62..51dbdb4c 100644
--- a/src/pages/public/Companion/components/dataverse/Dashboard.js
+++ b/src/pages/public/Companion/components/dataverse/Dashboard.js
@@ -2,12 +2,11 @@ import React, { useEffect } from "react";
import { useLocation, useHistory } from "react-router-dom";
import { Typography } from "@material-ui/core";
import Quiz from "./Quiz";
-import Leaderboard from "./Leaderboard";
const useStyles = {
root: {
position: "relative",
- minHeight: "180vh",
+ minHeight: "100vh",
background: "linear-gradient(135deg, #3C1F62, #5A3D89, #2F3C53, #121C2C)",
color: "white",
padding: "20px",
@@ -82,8 +81,6 @@ const Dashboard = () => {
+
+
5o|~PfO`5ds zo`u7blZP$5XWgVzcm2G6vT-?L)s!qLJ59cIW%xk&2&MfwQ4Po;5!~(ogw9zEZP>@)W%sHB _>0$L9!TRiPD^(dstczEo$yUjb|~K9|1GJ3e9+RzZwMEAiL!e z=f%c3x>GTmBBfOus@#sYz3F{zDD7^e-AlAf&?&+*7!)Z!D3_=(gz3&8S_`wh6qEoH z`Zf+SeVFaY%WHbS=>7>w=C>Lr =g0*+VljhR$ACoTWX`v?6D8S6f{7(VgVp97mqRbd~CDg+WSq_OL|{Op^O1J+Nqa zcDS?A9NT$Rw)4>ixud(r=tL^+^}}AOp-Nd_c&Ha9qxcYRJ{}a*)XBM9d%f{}b4FYb z%cPhAF%4--hvK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~mJ7M7!VBRK??KFywM-)WyMBWJFhpSK&oi#yiJ+1t|zl4r- zBUfF>E2oNEJX5?+V?eh+(>wYl 3(*U=ihJwlz} z_!81*v-I}C)uM}V&ne1j_u)P8A<|4idF4ZHy)6F|(c#6_Ll*q1g7^o@Z^g)G@jf(H z$``Q`N3W2R4*3%AQB0i6(|#lIM%&X|9_tWURm-v8TxB_PZ5Qzy`MFXKS+JJ7a}?V? zWH(B;8e)6t*1I%k5eMeGU&QW1FIJ>?9u$s{`i|bvE)vPJY94CG?(#T(d2yaq5^o-Y zlNJeg*w)$3a(QS`TgzHm$auT$xWqlDDEAxXCEg>pGk!P9PvP}UIAT@b$a?PtzMJJ# zn{rNbd5M!8!m-PfF$rzmiI@dth%e$@?eDT8{YiuD8$<{?Abq^aVnzD1O=K9unDY;$ zmXBgamb!!FoJ03T&>3>h(bpQ*L65-MLpa8YZj)a8s)iW}9RTMX^(Z{B^+-$FYez<> zs6R8lK(6`?5k}rt%2zk0i)3-#2p89TSIMk(yt{~MXhjWiy!X)Ahsc&WS0zq+kHlN7 zIL{J^HxI#Sv?Sg%1gF^}@pZP}at~T@Hc`fW@!xAtvRhXs(yt0;PmY*hALP6VOuL6J zu+AO#^Ui-e>!LxN;Zcw{#Y`mL=3W0>-jBB{SX*8>eB#LR9STki;2hIn`7)-_fLM?p zCpm;8_CnhO%44h%eI r!gbpgOcp8+8!%)Cm&ZPbv20i5isZ~c#_y51 z$i#19y9e)}oR8Pejb%O!5>i2>i7nIS(`$K+i)YUo7wPo|BJ=E74ew4dj{NR-qF&UW z#qw8dyO2q~8{T*GEhlpBiQRN`(2t6jmfqZrcs$;Gg!lRu__-}wfz0dZBPkCd2jOMR hZ_Wn*`#41n@J@?0zpNB_!x92Sy*9nScNqQt{{T0sMt=YR literal 0 HcmV?d00001 diff --git a/src/index.scss b/src/index.scss index 852bb1fb..f120975a 100644 --- a/src/index.scss +++ b/src/index.scss @@ -75,6 +75,14 @@ font-display: auto; } +@font-face { + font-family: 'Audiowide'; + src: url('./assets/font/Audiowide-Regular.ttf') format('truetype'); + font-weight: 400; + font-style: normal; + font-display: swap; +} + .content { padding-top: 14px; margin-left: 110px; diff --git a/src/pages/public/Companion/components/dataverse/Dashboard.js b/src/pages/public/Companion/components/dataverse/Dashboard.js index 51dbdb4c..878e0094 100644 --- a/src/pages/public/Companion/components/dataverse/Dashboard.js +++ b/src/pages/public/Companion/components/dataverse/Dashboard.js @@ -1,51 +1,14 @@ import React, { useEffect } from "react"; import { useLocation, useHistory } from "react-router-dom"; -import { Typography } from "@material-ui/core"; import Quiz from "./Quiz"; -const useStyles = { - root: { - position: "relative", - minHeight: "100vh", - background: "linear-gradient(135deg, #3C1F62, #5A3D89, #2F3C53, #121C2C)", - color: "white", - padding: "20px", - textAlign: "center", // Centering the content - }, - heading: { - fontSize: "6rem", // Making the main heading bigger - fontWeight: "bold", // Making the text bold - marginTop: "40px", // Adding space above the heading - }, - subheading: { - fontSize: "1.5rem", // Increasing the font size for subheadings - fontWeight: "500", // Optional: make the subheading a bit lighter - }, - text: { - fontSize: "1.2rem", // Make other text a bit larger - }, - infoRow: { - display: "flex", // Align items in a row - justifyContent: "center", // Center the row - gap: "30px", // Space between the items - marginBottom: "20px", // Space below the row - }, - label: { - color: "#B0B0B0", // Gray color for labels - fontWeight: "500", // Optional: make labels a bit lighter - }, - value: { - background: "linear-gradient(to bottom, #FFFFFF, #7B7DFF)", // Gradient from white to light purple - WebkitBackgroundClip: "text", // Clip the background to the text - color: "transparent", // Make the text color transparent so the gradient shows through - fontWeight: "700", // Optional: make values bold - }, -}; const Dashboard = () => { + const startTime = new Date(); + const endTime = new Date(startTime.getTime() + 5 * 60000); const location = useLocation(); const history = useHistory(); - const { teamName, teamPoints, accessKey } = location.state || {}; + const { teamName, teamPoints } = location.state || {}; useEffect(() => { if (teamPoints == null || teamName == null) { @@ -54,36 +17,12 @@ const Dashboard = () => { }, [teamPoints, teamName, history]); return ( - - {teamPoints == null || teamName == null ? ( -+- Redirecting to Companion... - - ) : ( - <> -- Team Dashboard - - - {/* Flex container for the Team Name and Current Points */} ---- Team Name: - -- {teamName} - -- Current Points: - -- {teamPoints} - -- > - )} - ); }; diff --git a/src/pages/public/Companion/components/dataverse/Progress.js b/src/pages/public/Companion/components/dataverse/Progress.js new file mode 100644 index 00000000..968cf8e8 --- /dev/null +++ b/src/pages/public/Companion/components/dataverse/Progress.js @@ -0,0 +1,257 @@ +import React, { useState, useRef, useEffect } from "react"; +import { Box, IconButton, TextField } from "@mui/material"; +import ArrowForwardIcon from "@mui/icons-material/ArrowForward"; + +const CharacterInput = ({ onSubmit, numChars = 21 }) => { + const [chars, setChars] = useState(Array(numChars).fill("")); // Initialize with empty strings + const [isTyping, setIsTyping] = useState(false); // To track if any character is typed + const inputRefs = useRef([]); + + const placeholderText = "final question answer"; // Your placeholder phrase + + useEffect(() => { + // Dynamically adjust the number of refs based on numChars + inputRefs.current = inputRefs.current.slice(0, numChars); + }, [numChars]); + + const handleChange = (index, value) => { + if (value.length <= 1) { + const newChars = [...chars]; + newChars[index] = value; // Set the current character + setChars(newChars); + + // Set isTyping to true when any input is typed + if (!isTyping && value !== "") { + setIsTyping(true); + } + + // Automatically focus on the next input if the current one is filled + if (index < numChars - 1 && value.length === 1) { + inputRefs.current[index + 1]?.focus(); + } + + // Check if all characters are cleared, reset isTyping to false + if (newChars.every((char) => char === "")) { + setIsTyping(false); + } + } + }; + + const handleKeyDown = (index, e) => { + if (e.key === "Backspace") { + if (chars[index] === "" && index > 0) { + inputRefs.current[index - 1]?.focus(); + } else { + const newChars = [...chars]; + newChars[index] = ""; // Clear the current character + setChars(newChars); + } + } else if (e.key === "ArrowLeft" && index > 0) { + inputRefs.current[index - 1]?.focus(); + } else if (e.key === "ArrowRight" && index < numChars - 1) { + inputRefs.current[index + 1]?.focus(); + } + }; + + const handleSubmit = () => { + const input = chars.join(""); + if (input.length === numChars) { + onSubmit(input); + setChars(Array(numChars).fill("")); // Reset the input fields + setIsTyping(false); // Reset typing state + inputRefs.current[0]?.focus(); // Focus the first input + } + }; + + return ( + + + ); + }; + + + + +const ProgressBar = ({ teamScore, maxScore }) => { + const percentage = (teamScore / maxScore) * 100; + + return ( ++ {chars.map((char, index) => { + // If any input is typed, remove all placeholders; restore if all are cleared + const placeholderChar = isTyping && !chars.every((char) => char === "") + ? "" + : placeholderText[index] || ""; + + return ( + +(inputRefs.current[index] = el)} + value={char} + onChange={(e) => handleChange(index, e.target.value)} + onKeyDown={(e) => handleKeyDown(index, e)} + variant="standard" + autoComplete="off" // Disable autofill + inputProps={{ + maxLength: 1, + style: { + width: "25px", + textAlign: "center", + fontFamily: "monospace", + fontSize: "1.5rem", + padding: "2px 0px", + color: "white", + }, + }} + placeholder={placeholderChar} // Set the placeholder as the corresponding character + sx={{ + width: "25px", + "& .MuiInput-underline:before": { + borderBottomWidth: "2px", + borderBottomColor: char ? "#ffffff" : "#AAAAAA", + }, + "& .MuiInput-underline:hover:before": { + borderBottomColor: "#ffffff", + }, + "& .MuiInput-underline:after": { + borderBottomColor: "#ffffff", + }, + }} + /> + ); + })} + char === "")} + sx={{ + color: "#ffffff", + "&:hover": { + backgroundColor: "#ffffff", + color: "#000000", + }, + marginLeft: 2, + }} + > + ++ + ++ ); +}; + +const Percentage = ({ teamScore, maxScore }) => { + const percentage = Math.round((teamScore / maxScore) * 100); // Round to the nearest percent + + return ( ++ + {percentage}% + + + complete + ++ ); +}; + +const Progress = ({ teamScore, maxScore, onCharacterSubmit }) => { + return ( + <> + {" "} ++ {/* Percentage on the left */} + + {/* White Divider Line */} ++ + + {/* ProgressBar and CharacterInput stacked vertically */} ++ + ++ + + > + ); +}; + +export default Progress; diff --git a/src/pages/public/Companion/components/dataverse/Quiz.js b/src/pages/public/Companion/components/dataverse/Quiz.js index eccad799..95a3b062 100644 --- a/src/pages/public/Companion/components/dataverse/Quiz.js +++ b/src/pages/public/Companion/components/dataverse/Quiz.js @@ -1,172 +1,116 @@ import React, { useState } from "react"; import { Typography, Button, TextField, FormControl } from "@material-ui/core"; -import { LocalLeaderboardExample } from "./Leaderboard"; - -const QuizRoom = ({ roomNumber, goBack }) => { - const [answers, setAnswers] = useState(Array(5).fill("")); // Array to hold answers for 5 questions - - const quizData = { - 1: { - questions: [ - "What is the capital of France?", - "What is the largest country by area?", - "Who painted the Mona Lisa?", - "What is the smallest prime number?", - "What is the tallest mountain in the world?" - ], - correctAnswers: [ - "Paris", - "Russia", - "Leonardo da Vinci", - "2", - "Mount Everest" - ] - }, - 2: { - questions: [ - "Which planet is known as the Red Planet?", - "What gas do plants absorb from the atmosphere?", - "What is the chemical symbol for water?", - "Who developed the theory of relativity?", - "What is the speed of light?" - ], - correctAnswers: [ - "Mars", - "Carbon dioxide", - "H2O", - "Albert Einstein", - "299,792,458 m/s" - ] - }, - 3: { - questions: [ - "Who wrote 'To Kill a Mockingbird'?", - "What is the main language spoken in Brazil?", - "Who is known as the Father of Computers?", - "What is the hardest natural substance?", - "What is the boiling point of water in Celsius?" - ], - correctAnswers: [ - "Harper Lee", - "Portuguese", - "Charles Babbage", - "Diamond", - "100" - ] - } - }; - - const handleAnswerChange = (index, value) => { - const newAnswers = [...answers]; - newAnswers[index] = value; - setAnswers(newAnswers); - }; - - const checkAnswers = () => { - const { correctAnswers } = quizData[roomNumber]; - let score = 0; - - answers.forEach((answer, index) => { - if ( - answer.trim().toLowerCase() === - correctAnswers[index].trim().toLowerCase() - ) { - score += 1; - } - }); - - alert(`You scored ${score} out of ${correctAnswers.length}!`); - }; - - // Render the questions based on the room number - const renderQuiz = () => { - const { questions } = quizData[roomNumber]; - - return questions.map((question, index) => ( - -- )); - }; +import DataverseLogo from "../../../../../assets/2024/dataverse/Dataverse.png"; +import TimerDonut from "./Timer"; +import Progress from "./Progress"; +import QuizRoom from "./QuizRoom"; + +const useStyles = { + root: { + position: "relative", + minHeight: "100vh", + background: "linear-gradient(135deg, #0d1b61, #0a143b, #081027, #000000)", + color: "white", + padding: "20px", + textAlign: "center" + }, + heading: { + fontSize: "3rem", + fontWeight: "bold", + marginTop: "0px", + letterSpacing: "0.2em", + textShadow: "0px 0px 4px white" + }, + subheading: { + fontSize: "1.5rem", // Increasing the font size for subheadings + fontWeight: "500" // Optional: make the subheading a bit lighter + }, + text: { + fontSize: "1.2rem" // Make other text a bit larger + }, + infoRow: { + display: "flex", // Align items in a row + width: "200px", // Fixed width for the row + justifyContent: "space-between", // Distribute space between items + marginBottom: "20px", // Space below the row + marginTop: "20px" + }, + label: { + fontSize: "1rem", // Make other text a bit larger + color: "#FFFFFF", // Gray color for labels + fontWeight: "100" // Optional: make labels a bit lighter + }, + value: { + background: "#FFFFFF", // Gradient from white to light purple + WebkitBackgroundClip: "text", // Clip the background to the text + color: "transparent", // Make the text color transparent so the gradient shows through + fontWeight: "700" // Optional: make values bold + } +}; +const LeftHeader = ({ teamName, teamPoints }) => { return ( -{question} -- -handleAnswerChange(index, e.target.value)} - style={{ - marginTop: "10px" - }} - /> - -- Welcome to Quiz Room {roomNumber} + + +); }; const buttonCardStyle = { + width: "315px", margin: "10px", marginBottom: "200px", padding: "25px 50px", - fontSize: "18px", + fontSize: "20px", + fontFamily: "Audiowide", backgroundColor: "rgba(255, 255, 255, 0.05)", // Transparent background with 10% opacity borderColor: "white", // White borders color: "white", // White text color - height: "400px", // Increased height to make the button taller + height: "300px", // Increased height to make the button taller transition: "transform 0.3s ease, translateY 0.3s ease, opacity 0.3s ease", // Smooth transitions for transform and opacity display: "inline-block", - textAlign: "center", // Center text horizontally + textAlign: "center" // Center text horizontally }; -const button1Style = { - ...buttonCardStyle, - transform: "rotate(-30deg) translateY(100px)", // Start button 1 lower by 100px -}; - -const button3Style = { - ...buttonCardStyle, - transform: "rotate(30deg) translateY(100px)", // Start button 3 lower by 100px -}; - -const button2Style = { - ...buttonCardStyle, - opacity: 1, // Normal opacity for button 2 -}; - -const QuizDashboard = () => { +const QuizDashboard = ({ teamName, teamPoints, startTime, endTime }) => { const [selectedRoom, setSelectedRoom] = useState(null); const renderContent = () => { @@ -180,41 +124,72 @@ const QuizDashboard = () => { } return ( -+ DATA - {renderQuiz()} - - ++ CHALLENGE + +++++ Team + ++ {teamName} + ++++ Points + ++ {teamPoints} + +-- Quizzes - -- Select a quiz room to begin: - - - -