Starting Quizz

This commit is contained in:
2023-12-08 05:43:14 +01:00
parent 36f5e7dfa6
commit 49bc4f64fb
5 changed files with 34 additions and 7 deletions

View File

@@ -2,9 +2,9 @@ import Ammo from "../ammo";
import { get } from "../../../../modules/fetcher";
import { useEffect, useState } from "react";
function AmmoBox() {
function AmmoBox({game}) {
return(
<div className="fixed bottom-0 left-28 right-0 h-24 bg-blue-500 flex flex-row justify-between items-start">
<div className="fixed bottom-0 left-28 right-0 h-24 flex flex-row justify-between items-start">
<Ammo arg={"test"}/>
<Ammo arg={"test2"}/>
<Ammo arg={"test3"}/>

View File

@@ -1,9 +1,27 @@
import AmmoBox from "../ammobox";
import { post } from "../../../../modules/fetcher";
import { useEffect, useState } from "react";
import img from "../poseimg";
import QuestionBox from "../questionbox";
function GameScene({theme,id}) {
const [data,setData] = useState([]);
const token = localStorage.getItem('token');
useEffect(() => {
post('https://saucisson.justw.tf/api/games/create/'+id,{},token)
.then(res => {
setData(res.JSON);
})
.catch(err => console.log(err));
},[]);
function GameScene() {
return(
<main className="min-h-screen w-screen pl-44 bg-red-900 flex flex-row flex-wrap gap-12">
<AmmoBox />
<main className="min-h-screen w-screen pl-44 bg-red-900 flex flex-col justify-center items-center gap-12">
<QuestionBox question={"test"}/>
<img src={img[id]} alt="oponent" className="mt-12 w-48"/>
<AmmoBox game={data}/>
</main>
);
}

View File

@@ -0,0 +1,9 @@
function QuestionBox({question}) {
return(
<div className="fixed top-4 left-44 right-4 h-42 bg-slate-300 rounded-md">
{question}
</div>
);
}
export default QuestionBox;

View File

@@ -1,4 +1,4 @@
import Pose1 from "../../../../assets/home/baneer.jpg";
// import Pose1 from "../../../../assets/home/baneer.jpg";
import {Link} from "react-router-dom";
function HomeHero() {
return (

View File

@@ -21,7 +21,7 @@ function GameTheme() {
return(
<div className="h-full w-full">
<NavbarreGame />
<GameScene theme={theme}/>
<GameScene theme={theme} id={id}/>
</div>
);
}