From 12eb673c902561bba82c6c752a5e8684db30d326 Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Sat, 24 Feb 2024 18:09:06 +0100 Subject: [PATCH] UI: Add timeout for success alert to give time for confetti --- src/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index a89e82d..b6e45a7 100644 --- a/src/main.js +++ b/src/main.js @@ -41,9 +41,11 @@ document.addEventListener("DOMContentLoaded", () => { const formData = new FormData(form); const formDataValue = formData.values(); const [email, country, zip] = Array(5).fill(formDataValue.next().value); - alert( - `Success!\nEmail: ${email}\nCountry: ${country}\nZIP: ${zip}\nPassword: [redacted]`, - ); + setTimeout(() => { + alert( + `Success!\nEmail: ${email}\nCountry: ${country}\nZIP: ${zip}\nPassword: [redacted]`, + ); + }, 600); } else { alert("Hold up, one or more fields are invalid! Try again"); }