diff --git a/chisiamo.html b/chisiamo.html index 545b25b..694d95d 100644 --- a/chisiamo.html +++ b/chisiamo.html @@ -39,5 +39,7 @@ - PhotoTransport.06

Se vuoi mandarci foto scrivimi su discord: leo_craft1_6426, oppure manda una mail a: (la mail sarà disponibile a momenti)

+

ER-TPL è in vita da:

+
\ No newline at end of file diff --git a/scripts/ertpl.js b/scripts/ertpl.js index 47cd637..49794ef 100644 --- a/scripts/ertpl.js +++ b/scripts/ertpl.js @@ -13,6 +13,7 @@ function changeUrlToFallback(aid,imgid,path) { document.getElementById(aid).href = "https://drive.vichingo455.freeddns.org/apps/files_sharing/publicpreview/w8Nr4jZN3g6z3pn?file=" + path + "&x=1920&y=1080&a=true"; } catch {} } + function changeUrlToFallbackNoTrue(aid,imgid,path) { try { document.getElementById(imgid).src = "https://drive.vichingo455.freeddns.org/apps/files_sharing/publicpreview/w8Nr4jZN3g6z3pn?file=" + path + "&x=1920&y=1080"; @@ -20,4 +21,30 @@ function changeUrlToFallbackNoTrue(aid,imgid,path) { try { document.getElementById(aid).href = "https://drive.vichingo455.freeddns.org/apps/files_sharing/publicpreview/w8Nr4jZN3g6z3pn?file=" + path + "&x=1920&y=1080"; } catch {} -} \ No newline at end of file +} + +const startDate = new Date("2024-12-22T15:49:00"); + +function updateTimer() { + const now = new Date(); + const diff = now - startDate; + + if (diff < 0) { + document.getElementById("timer").innerHTML = "La data è nel futuro!"; + return; + } + + const seconds = Math.floor(diff / 1000) % 60; + const minutes = Math.floor(diff / 1000 / 60) % 60; + const hours = Math.floor(diff / (1000 * 60 * 60)) % 24; + const days = Math.floor(diff / (1000 * 60 * 60 * 24)); + + document.getElementById("timer").innerHTML = + days + " giorni " + + hours + " ore " + + minutes + " minuti " + + seconds + " secondi"; + } + +updateTimer(); +setInterval(updateTimer, 1000); \ No newline at end of file