From 54f7a5285fa72eb12c1af14862ed79c2a8a6665a Mon Sep 17 00:00:00 2001 From: thaaoblues Date: Sat, 4 Jan 2025 16:41:36 +0100 Subject: [PATCH] ptits fix --- css/gift.css | 32 -------------------------------- css/index.css | 1 + js/main.js | 9 +++++---- 3 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 css/gift.css diff --git a/css/gift.css b/css/gift.css deleted file mode 100644 index 7a165ab..0000000 --- a/css/gift.css +++ /dev/null @@ -1,32 +0,0 @@ -.gift { - width: 50px; - height: 50px; - background-color: red; - border-radius: 10px; - position: absolute; - animation: moveGift 5s infinite linear; - cursor: pointer; -} - -@keyframes moveGift { - 0% { - top: 0; - left: 0; - } - 25% { - top: 0; - left: calc(100% - 50px); - } - 50% { - top: calc(100% - 50px); - left: calc(100% - 50px); - } - 75% { - top: calc(100% - 50px); - left: 0; - } - 100% { - top: 0; - left: 0; - } -} \ No newline at end of file diff --git a/css/index.css b/css/index.css index f97ef65..6802504 100644 --- a/css/index.css +++ b/css/index.css @@ -78,6 +78,7 @@ position: absolute; left:0%; top: 0%; + max-width: 100vw; } #close_rick{ diff --git a/js/main.js b/js/main.js index 8e75500..fe62956 100644 --- a/js/main.js +++ b/js/main.js @@ -24,7 +24,7 @@ async function remplirMagasinTechnologies(){ const table= document.getElementById("table_magasin_technologies_body") - let data = await fetch("../bdd/arbre.json") + let data = await fetch("./bdd/arbre.json") data = await data.json() @@ -103,7 +103,7 @@ async function remplirMagasinCollegues(){ const table= document.getElementById("table_magasin_collegues_body") - let data = await fetch("../bdd/arbre.json") + let data = await fetch("./bdd/arbre.json") data = await data.json() @@ -404,13 +404,14 @@ function cadeauClickCallback(){ } } - // enlève le cadeau - div_cadeau.style.display = "none"; + // génère un nouveau timer pour le prochain cadeau à afficher ! setTimeout(genererCadeau, Math.random() * 10000 + 20000); // Premier affichage aléatoire entre 20 et 30 secondes }) + // enlève le cadeau avant que le callback soit executé pour ne pas voir le cadeau sur l'alert + div_cadeau.style.display = "none"; }