collapse/index.html

65 lines
1.4 KiB
HTML
Raw Permalink Normal View History

2024-07-13 03:04:25 +00:00
<!DOCTYPE html>
<html>
<head>
2024-07-13 03:05:07 +00:00
<title>Collapse</title>
2024-07-13 03:04:25 +00:00
<style>
body {
margin-top: 20px !important;
}
body, html {
height: 100%;
width: 100%;
margin: 0;
main, div {
max-width: fit-content;
margin-left: auto;
margin-right: auto;
}
}
</style>
</head>
<body>
<main>
<div id='c'>Soon</div>
</main>
<script>
function go() {
2024-07-13 04:54:22 +00:00
const reckoning = Date.parse("2025-08-17T00:00:00.000Z");
2024-07-13 03:04:25 +00:00
const countdown = document.getElementById('c');
function updateCountdown() {
let p = "";
let o = reckoning - Date.now();
let years, months, days, hours, minutes, seconds;
o-= (years = Math.floor(o / 31557600000)) * 31557600000;
o-= (months = Math.floor(o / 2629800000)) * 2629800000;
o-= (days = Math.floor(o / 86400000)) * 86400000;
o-= (hours = Math.floor(o / 3600000)) * 3600000;
o-= (minutes = Math.floor(o / 60000)) * 60000;
o-= (seconds = Math.floor(o / 1000)) * 1000;
if (years) p += `${years}Y `;
if (months) p += `${months}M `;
if (days) p += `${days}D `;
if (hours) p += `${hours}h `;
if (minutes) p += `${minutes}m `;
if (seconds) p += `${seconds}s `;
countdown.textContent = p.substring(0, p.length - 1);
}
updateCountdown();
setInterval(updateCountdown, 1000);
}
go();
</script>
</body>
</html>