<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Countdown Timer</title>
</head>
<body>
    <div id="countdown"></div>

    <script>
        // Set the countdown end time (e.g., 5 minutes from now)
        const countdownDuration = 1 * 60 * 1000; // 5 minutes in milliseconds
        let endTime = localStorage.getItem('countdownEndTime');

        if (!endTime) {
            endTime = new Date().getTime() + countdownDuration;
            localStorage.setItem('countdownEndTime', endTime);
        }

        function updateCountdown() {
            const now = new Date().getTime();
            const distance = endTime - now;

            if (distance < 0) {
                document.getElementById('countdown').innerHTML = "EXPIRED";
                localStorage.removeItem('countdownEndTime');
                return;
            }

            const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
            const seconds = Math.floor((distance % (1000 * 60)) / 1000);

            document.getElementById('countdown').innerHTML = minutes + "m " + seconds + "s ";
        }

        setInterval(updateCountdown, 1000);
    </script>
</body>
</html>
