<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temporizador</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #000;
color: #fff;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Courier New', monospace;
overflow: hidden;
}
#timer {
font-size: 80px;
font-weight: bold;
letter-spacing: 8px;
}
.link-container {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000;
align-items: center;
justify-content: center;
z-index: 10;
}
.link-container a {
color: #fff;
font-size: 40px;
text-decoration: none;
padding: 20px 40px;
border: 2px solid #fff;
}
@media (max-width: 768px) {
#timer {
font-size: 40px;
letter-spacing: 4px;
}
.link-container a {
font-size: 24px;
padding: 15px 30px;
}
}
</style>
</head>
<body>
<div id="timer">00:00:00:00</div>
<div class="link-container" id="linkContainer">
<a href="https://8-2.webnode.com.co/" target="_blank">ACCEDER</a>
</div>
<script>
// Fecha objetivo: 27 de agosto de 2025 a las 12:00 (hora local)
const targetDate = new Date(2025, 7, 27, 12, 0, 0).getTime();
const timer = document.getElementById('timer');
const linkContainer = document.getElementById('linkContainer');
function updateCountdown() {
const now = new Date().getTime();
const timeRemaining = targetDate - now;
// Si el tiempo restante es menor o igual a cero, mostrar el enlace
if (timeRemaining <= 0) {
clearInterval(countdownInterval);
timer.style.display = "none";
linkContainer.style.display = "flex";
return;
}
// Calcular días, horas, minutos y segundos
const days = Math.floor(timeRemaining / (1000 * 60 * 60 * 24));
const hours = Math.floor((timeRemaining % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((timeRemaining % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeRemaining % (1000 * 60)) / 1000);
// Formatear para mostrar siempre dos dígitos
const formatTime = (time) => time < 10 ? `0${time}` : time;
// Mostrar el resultado
timer.innerHTML = `${formatTime(days)}:${formatTime(hours)}:${formatTime(minutes)}:${formatTime(seconds)}`;
}
// Ejecutar la función inmediatamente y luego cada segundo
updateCountdown();
const countdownInterval = setInterval(updateCountdown, 1000);
</script>
</body>
</html>