Starting Quizz
This commit is contained in:
@@ -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"}/>
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
9
webapp/src/components/content/game/questionbox/index.jsx
Normal file
9
webapp/src/components/content/game/questionbox/index.jsx
Normal 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;
|
||||
@@ -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 (
|
||||
|
||||
@@ -21,7 +21,7 @@ function GameTheme() {
|
||||
return(
|
||||
<div className="h-full w-full">
|
||||
<NavbarreGame />
|
||||
<GameScene theme={theme}/>
|
||||
<GameScene theme={theme} id={id}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user