Count Down to HV
<!DOCTYPE html>
<html lang="lt">
<head>
<meta charset="UTF-8">
<title>HV Gimimo Laikmatis</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f0f9ff;
color: #222;
text-align: center;
padding-top: 100px;
}
h1 {
font-size: 2.5em;
}
#countdown {
font-size: 2em;
margin-top: 20px;
color: #0b5394;
}
</style>
</head>
<body>
<h1>⏳ Iki Homo Virtualis gimimo liko:</h1>
<div id="countdown">Skaičiuojama...</div>
<script>
function updateCountdown() {
const now = new Date().getTime();
const target = new Date("2040-01-01T00:00:00").getTime();
const distance = target - now;
if (distance < 0) {
document.getElementById("countdown").innerHTML = "Homo Virtualis jau gimė!";
return;
}
const years = Math.floor(distance / (1000 * 60 * 60 * 24 * 365.25));
const days = Math.floor((distance % (1000 * 60 * 60 * 24 * 365.25)) / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("countdown").innerHTML =
`${years} metų, ${days} dienų, ${hours} val., ${minutes} min., ${seconds} sek.`;
}
setInterval(updateCountdown, 1000);
updateCountdown();
</script>
</body>
</html>

