From 45d98a5bf047339a1faf0bb7e2b21737a8f8777d Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Mon, 5 Jan 2026 23:03:46 -0600 Subject: [PATCH] checkpoint --- index.html | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 71cc639d..83982dbe 100644 --- a/index.html +++ b/index.html @@ -242,8 +242,9 @@ .toast { display: none; position: fixed; - bottom: 50%; - right: 50%; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); color: white; padding: 12px 24px; border-radius: 4px; @@ -642,19 +643,22 @@ }); } - function showToast(msg,success) { - const toast = document.getElementById('toast'); - toast.innerHTML = msg; - if(success) { - toast.classList.remove('show_failure'); - toast.classList.add('show_success'); - setTimeout(() => toast.classList.remove('show_success'), 3000); - } else { - toast.classList.remove('show_success'); - toast.classList.add('show_failure') - setTimeout(() => toast.classList.remove('show_failure'), 5000); - } - } + let toastTimer = null; + + function showToast(msg,success) { + const toast = document.getElementById('toast'); + if (toastTimer) clearTimeout(toastTimer); + toast.innerHTML = msg; + if(success) { + toast.classList.remove('show_failure'); + toast.classList.add('show_success'); + toastTimer = setTimeout(() => toast.classList.remove('show_success'), 3000); + } else { + toast.classList.remove('show_success'); + toast.classList.add('show_failure') + toastTimer = setTimeout(() => toast.classList.remove('show_failure'), 5000); + } + } window.onclick = function(event) { const modal = document.getElementById('pathModal');