Skip to content
Snippets Groups Projects
Commit c5acbd80 authored by romain's avatar romain
Browse files

ajout page de fin score

parent b233064c
Branches
No related tags found
No related merge requests found
......@@ -6,6 +6,9 @@
<title>OUCEQUECE le quizz à ne pas louper</title>
<style>
.rectangle-arrondi:hover {
background-color: #45a049;
}
img {
display: block;
margin-left: auto;
......@@ -90,6 +93,8 @@
const responsejson2 = await response2.json();
const resp = JSON.stringify(responsejson2)
const vrairesp= JSON.parse(resp);
if (vrairesp.answer==false){
document.getElementById("resultat").innerText = "Faux c'était " + vrairesp.correctAnswer + " score : "+ vrairesp.score;
next();
......@@ -127,6 +132,12 @@
const responsejson3 = await response3.json();
const newresp = JSON.stringify(responsejson3)
const newquestions= JSON.parse(newresp);
if (!("question" in newquestions)){
localStorage.setItem("transferscore", newquestions.score);
setTimeout(() => {
window.location.href = "http://localhost/frontend/score.html";}, 2000);
}
const reponse=newquestions.answers;
const img=newquestions.imageIndex;
document.getElementById("a1").innerText = reponse[0];
......
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="css2.css">
<meta charset="UTF-8">
<title>OUCEQUECE le quizz à ne pas louper</title>
<link href="https://fonts.googleapis.com/css2?family=Chewy&display=swap" rel="stylesheet">
<style>
h6{
position:fixed;
width: 550px;
margin-left: 900px;
font-family: 'Chewy', cursive;
font-size: 90px;
top:150px;
}
</style>
</head>
<body>
<h1> OUCÉQUECÉ</h1>
<h2>Résultat final : </h2>
<h6 id="score"></h6>
<div class="image-slider">
<div class="images">
<img src="1.jpg" >
<img src="3.jpg">
<img src="2.jpg">
<img src="1.jpg">
</div>
</div>
</body>
<script>
const score = localStorage.getItem("transferscore");
document.getElementById("score").innerText=score;
</script>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment