From 78d556074cdbd2198fbcbf55149be9898a9bcb31 Mon Sep 17 00:00:00 2001 From: Lucie Bader <167515375+Lucie-Bdr@users.noreply.github.com> Date: Sun, 23 Feb 2025 14:18:52 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20barre=20de=20d=C3=A9filement=20sta?= =?UTF-8?q?ts=20d=C3=A9sactiv=C3=A9es=20(changement=20onglet)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/stats.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/utils/stats.js b/src/utils/stats.js index 1ced5bf..1f1912c 100644 --- a/src/utils/stats.js +++ b/src/utils/stats.js @@ -87,6 +87,11 @@ if (document.hidden) { // log("[Stats] Changement d'onglet détecté"); resetAllTimers(); + } else { + // Vérifie si les statistiques sont désactivées et retire la bordure si nécessaire + if (!window.hasRunStats) { + removeViewportBorder(); + } } }); @@ -318,7 +323,7 @@ rect.setAttribute("stroke-width", "0.5"); rect.setAttribute("stroke-dasharray", "200 200"); rect.setAttribute("stroke-dashoffset", "400"); - rect.style.animation = "dashAnimation 6s ease-in-out infinite"; + rect.style.animation = "dashAnimation 20s ease-in-out infinite"; svg.appendChild(rect); document.body.appendChild(svg); @@ -326,8 +331,10 @@ // Fonction pour ajouter la bordure function addViewportBorder() { - if (!document.getElementById("border-svg")) { - injectBorder(); + if (window.hasRunStats) { + if (!document.getElementById("border-svg")) { + injectBorder(); + } } } // Fonction pour retirer la bordure -- GitLab