diff --git a/src/assets/2238431_1694.jpg b/src/assets/2238431_1694.jpg deleted file mode 100644 index 0eb8b83..0000000 Binary files a/src/assets/2238431_1694.jpg and /dev/null differ diff --git a/src/assets/background.webp b/src/assets/background.webp new file mode 100644 index 0000000..b82b4e7 Binary files /dev/null and b/src/assets/background.webp differ diff --git a/src/components/game/GameWrapper.jsx b/src/components/game/GameWrapper.jsx index 3c10bac..35d6ac3 100644 --- a/src/components/game/GameWrapper.jsx +++ b/src/components/game/GameWrapper.jsx @@ -1,6 +1,6 @@ import Image from "next/image" import Button from "@/components/Button" -import background from "@/assets/2238431_1694.jpg" +import background from "@/assets/background.webp" import { usePlayerContext } from "@/context/player" import { useSocketContext } from "@/context/socket" import { useState } from "react" diff --git a/src/components/game/states/Answers.jsx b/src/components/game/states/Answers.jsx index 30d6f5d..74ce17d 100644 --- a/src/components/game/states/Answers.jsx +++ b/src/components/game/states/Answers.jsx @@ -102,7 +102,7 @@ export default function Answers({
Time - {cooldown} + {cooldown}
Answers diff --git a/src/components/game/states/Prepared.jsx b/src/components/game/states/Prepared.jsx new file mode 100644 index 0000000..dca1c16 --- /dev/null +++ b/src/components/game/states/Prepared.jsx @@ -0,0 +1,31 @@ +import Circle from "@/components/icons/Circle" +import CricleCheck from "@/components/icons/CricleCheck" +import CricleXmark from "@/components/icons/CricleXmark" +import Rhombus from "@/components/icons/Rhombus" +import Square from "@/components/icons/Square" +import Triangle from "@/components/icons/Triangle" +import { usePlayerContext } from "@/context/player" +import { useEffect } from "react" +/*{ data: { number, total, question } }*/ +export default function Prepared() { + const { dispatch } = usePlayerContext() + + return ( +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ ) +} diff --git a/src/components/game/states/Question.jsx b/src/components/game/states/Question.jsx index 603c7eb..3d7805d 100644 --- a/src/components/game/states/Question.jsx +++ b/src/components/game/states/Question.jsx @@ -1,5 +1,4 @@ -import { useSocketContext } from "@/context/socket" -import { useEffect, useRef } from "react" +import { useRef } from "react" export default function Question({ data: { question } }) { const barRef = useRef(null) diff --git a/src/constants.js b/src/constants.js index d744316..af3d000 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1 +1 @@ -export const WEBSOCKET_URL = "http://localhost:3000" ///"https://rahoot.ralex.app" +export const WEBSOCKET_URL = "http://localhost:5157" ///"https://rahoot.ralex.app" diff --git a/src/context/socket.jsx b/src/context/socket.jsx index d47a78e..066b63f 100644 --- a/src/context/socket.jsx +++ b/src/context/socket.jsx @@ -2,7 +2,7 @@ import { io } from "socket.io-client" import { createContext, useContext, useState } from "react" import { WEBSOCKET_URL } from "@/constants" -export const socket = io("http://localhost:5157", { +export const socket = io(WEBSOCKET_URL, { path: "/ws/", //addTrailingSlash: false, transports: ["websocket"], diff --git a/src/pages/manager.jsx b/src/pages/manager.jsx index ed27938..730a26e 100644 --- a/src/pages/manager.jsx +++ b/src/pages/manager.jsx @@ -2,6 +2,7 @@ import Button from "@/components/Button" import GameWrapper from "@/components/game/GameWrapper" import Answers from "@/components/game/states/Answers" import Leaderboard from "@/components/game/states/Leaderboard" +import Prepared from "@/components/game/states/Prepared" import Question from "@/components/game/states/Question" import Start from "@/components/game/states/Start" import Wait from "@/components/game/states/Wait" @@ -90,12 +91,15 @@ export default function Manager() {
) : ( - - {gameStateComponent[state.status.name] && - createElement(gameStateComponent[state.status.name], { - data: state.status.data, - })} - + <> + + + {/*gameStateComponent[state.status.name] && + createElement(gameStateComponent[state.status.name], { + data: state.status.data, + })*/} + + )} ) diff --git a/src/styles/globals.css b/src/styles/globals.css index b9cd4cf..c068cc6 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -36,6 +36,20 @@ animation: show 0.5s ease-out; } +.anim-timer { + animation: timer 1s ease-out infinite; +} + +.anim-quizz { + animation: quizz 1s ease-out; + transform: perspective(1200px) rotateY(-15deg) rotateX(15deg) + translateZ(100px); +} + +.anim-quizz .button { + animation: quizzButton 1s ease-out; +} + @keyframes show { 0% { transform: scale(0); @@ -59,3 +73,38 @@ width: 100%; } } + +@keyframes timer { + 0% { + transform: scale(1); + } + 30% { + transform: scale(1.4) rotate(-6deg); + } + 60% { + transform: scale(0.8) rotate(6deg); + } + 80% { + transform: scale(1); + } +} + +@keyframes quizz { + 0% { + transform: scale(0) perspective(1200px) rotateY(-35deg) rotateX(15deg) + translateZ(100px); + } + 100% { + transform: scale(1) perspective(1200px) rotateY(-15deg) rotateX(15deg) + translateZ(100px); + } +} + +@keyframes quizzButton { + 0% { + transform: scale(0); + } + 100% { + transform: scale(1); + } +}