diff --git a/package-lock.json b/package-lock.json index 290c65f6..737d6d39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "@material-ui/icons": "^4.11.3", "asciidoctor-emoji": "^0.5.0", "i18n": "^0.15.1", + "react-countdown": "^2.3.5", "react-router-dom": "^6.22.1" } }, @@ -663,6 +664,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-countdown": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/react-countdown/-/react-countdown-2.3.5.tgz", + "integrity": "sha512-K26ENYEesMfPxhRRtm1r+Pf70SErrvW3g4CArLi/x6MPFjgfDFYePT4UghEj8p2nI0cqVV7/JjDgjyr//U60Og==", + "dependencies": { + "prop-types": "^15.7.2" + }, + "peerDependencies": { + "react": ">= 15", + "react-dom": ">= 15" + } + }, "node_modules/react-dom": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", diff --git a/package.json b/package.json index a508ec7e..37679c9a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "@material-ui/icons": "^4.11.3", "asciidoctor-emoji": "^0.5.0", "i18n": "^0.15.1", + "react-countdown": "^2.3.5", "react-router-dom": "^6.22.1" } } diff --git a/webapp/src/components/GameMenu/GameMenu.css b/webapp/src/components/GameMenu/GameMenu.css new file mode 100644 index 00000000..f56fd2d4 --- /dev/null +++ b/webapp/src/components/GameMenu/GameMenu.css @@ -0,0 +1,33 @@ +.menuButton { + width: 40%; + height: 45px; + background: darkblue; + border: none; + outline: none; + border-radius: 40px; + box-shadow: 0 0 10px black; + cursor:pointer; + font-size: 16px; + color: white; + font-weight: 700; + margin: 0.5em; + text-align: center; +} + +.countdown { + font-weight: 500; + margin: 3em; +} + +.topPanel{ + display: flex; + flex-direction: row; + align-items: center; +} +.divMenu { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; +} \ No newline at end of file diff --git a/webapp/src/components/GameMenu/GameMenu.js b/webapp/src/components/GameMenu/GameMenu.js index d9961bdc..ed5a392c 100644 --- a/webapp/src/components/GameMenu/GameMenu.js +++ b/webapp/src/components/GameMenu/GameMenu.js @@ -1,28 +1,32 @@ import "../../custom.css"; import { Link } from "react-router-dom"; +import {useTranslation} from "react-i18next"; + export default function GameMenu() { + const[t, i18n] = useTranslation("global"); + return (
Question counter: {numQuestion}
+{t("questionView.question_counter")} {numQuestion}
> ); } diff --git a/webapp/src/locales/en/messages_en.properties b/webapp/src/locales/en/messages_en.properties new file mode 100644 index 00000000..970112c4 --- /dev/null +++ b/webapp/src/locales/en/messages_en.properties @@ -0,0 +1,18 @@ +# messages_en.properties +navbar.title = Know and Win! +button.language = Español +instructionsTitle=WIQ Instructions +objective=Objective: +objectiveDescription=The objective of the game is to answer as many questions correctly as possible. +howToPlay=How to Play: +howToPlayDescription1=The game consists of a series of questions. +howToPlayDescription2=Read each question carefully. +howToPlayDescription3=Choose the correct answer from the options provided. +howToPlayDescription4=Click or tap on your selected answer to submit it. +scoring=Scoring: +scoringDescription1=Each correct answer earns you x points. +scoringDescription2=Incorrect answers do not deduct points. +timeLimit=Time Limit: +timeLimitDescription=Some game modes may have a time limit for answering each question. Be quick and accurate to maximize your score. +haveFun=Have Fun!: +haveFunDescription=Enjoy the game and test your knowledge. Good luck! diff --git a/webapp/src/translations/en/global.json b/webapp/src/translations/en/global.json index 30b70e9b..b7f7248d 100644 --- a/webapp/src/translations/en/global.json +++ b/webapp/src/translations/en/global.json @@ -41,6 +41,16 @@ "repeat_password_placeholder": "Repeat password", "register_button": "Register", "login_link": "Do you have an account? Login here." + }, + "gameMenu":{ + "history_button":"View Historical Data", + "new_game_button":"Create New Game", + "title":"Game Menu" + }, + "questionView":{ + "seconds":"seconds", + "question_counter":"Question counter :", + "end_countdown":"Time's up!" } } diff --git a/webapp/src/translations/es/global.json b/webapp/src/translations/es/global.json index d43e113f..3277d13a 100644 --- a/webapp/src/translations/es/global.json +++ b/webapp/src/translations/es/global.json @@ -45,6 +45,15 @@ "repeat_password_placeholder": "Repetir contraseña", "register_button": "Registrarse", "login_link": "¿Ya tienes una cuenta? Inicia sesión aquí." + }, + "gameMenu":{ + "history_button":"Ver Historial", + "new_game_button":"Crear nuevo juego", + "title":"Menú del Juego" + },"questionView":{ + "seconds":"segundos", + "question_counter":"Número de pregunta : ", + "end_countdown":"¡Se acabó el tiempo!" }