diff --git a/webapp/src/components/game/Game.js b/webapp/src/components/game/Game.js deleted file mode 100644 index 5516fe74..00000000 --- a/webapp/src/components/game/Game.js +++ /dev/null @@ -1,120 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { Container, Typography, Box, LinearProgress} from '@mui/material'; -import './FirstGame.css'; -import 'react-circular-progressbar/dist/styles.css'; -import axios from 'axios'; -import { useLocation, useNavigate } from 'react-router-dom'; -import Button from '../Button'; -import GoBackButton from '../GoBackButton'; -import { Footer } from '../footer/Footer'; -import { Nav } from '../nav/Nav'; -import {shuffleArray} from '../Util' - -var questions = []; -var points = 0; -var load = true; - -const Game = () => { - - const [remTime, setRemTime] = useState(0); - - - useEffect(() => { - const time = setInterval(() => { - setRemTime((progress) => { - if(progress === 100){ - newQuestion(); - return 0; - } - const diff = 4; - return load? Math.min(progress + diff, 100) : progress; - }); - }, 400); - - return () => { - clearInterval(time); - }; - }); - - - const esperar = (ms) => { - return new Promise(resolve => setTimeout(resolve, ms)); - }; - - const getQuestions = async () => { - - }; - - const gameStore = async () => { - try { - var username = localStorage.getItem("username") - console.log(username) - console.log(questions) - const response = await axios.post(`${apiEndpoint}/storeGame`, { id, username, points, questions}); - questions = [] - points = 0 - console.log(response) - } catch (error) { - console.error(error) - } - }; - - const newQuestion = async () => { - - }; - - const checkAnswer = async (option) => { - - }; - - - return ( - <> -