view www/index.html @ 9:228ab74e8321

Add index.html
author Dennis C. M. <dennis@denniscm.com>
date Thu, 13 Mar 2025 18:27:25 +0000
parents
children
line wrap: on
line source

<!DOCTYPE html>
<html lang="es">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Redirección con Gin</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        .container {
            text-align: center;
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
        }

        h1 {
            margin-bottom: 20px;
        }

        .btn {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            margin: 10px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s ease;
        }

        .btn:hover {
            background-color: #45a049;
        }

        #tiempo-mostrar {
            font-size: 20px;
            margin-top: 10px;
        }
    </style>
</head>

<body>
    <div class="container">
        <h1>Minutos del timer</h1>
        <div>
            <button id="decrementar-btn" class="btn">-</button>
            <span id="tiempo-mostrar">0</span>
            <button id="incrementar-btn" class="btn">+</button>
        </div>
        <br>
        <form action="/timer" method="POST" id="form-timer">
            <input type="hidden" id="tiempo-oculto" name="time" value="0">
            <br>
            <button type="button" id="btn-auth" class="btn">Ir a Auth</button>
            <button type="submit" class="btn">Ir a Connect</button>
        </form>
    </div>

    <script>
        const disminuirBtn = document.getElementById('decrementar-btn');
        const aumentarBtn = document.getElementById('incrementar-btn');
        const mostrarTiempo = document.getElementById('tiempo-mostrar');
        const tiempoInput = document.getElementById('tiempo-oculto');
        const formTimer = document.getElementById('form-timer');
        const btnAuth = document.getElementById('btn-auth');

        let tiempo = 0;

        disminuirBtn.addEventListener('click', function () {
            if (tiempo > 0) {
                tiempo--;
                mostrarTiempo.textContent = tiempo;
                tiempoInput.value = tiempo;
            }
        });

        aumentarBtn.addEventListener('click', function () {
            tiempo++;
            mostrarTiempo.textContent = tiempo;
            tiempoInput.value = tiempo;
        });

        formTimer.addEventListener('submit', function () {
            tiempoInput.value = tiempo * 60;
        });

        btnAuth.addEventListener('click', function () {
            window.location.href = '/auth';
        });
    </script>

</body>

</html>