Skip to content

Commit

Permalink
variable minutos
Browse files Browse the repository at this point in the history
se agrega la variable de minutos para customizarlo
  • Loading branch information
laconeo authored Mar 25, 2024
1 parent aae16b9 commit d5ef57c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
<body>
<h1>Contador Regresivo</h1>
<div id="counter">20:00</div>
<button id="startButton">Iniciar</button>
<button id="startButton" btn btn-primary btn-lg>Iniciar</button>
<div id="startCount">Veces Iniciado: 0</div>

<script>
let count = 0;
let running = false;
let interval;

let minutes = 20;
const startButton = document.getElementById('startButton');
const counterDisplay = document.getElementById('counter');

Expand All @@ -51,7 +51,7 @@ <h1>Contador Regresivo</h1>
}

function startTimer() {
let seconds = 2 * 60;
let seconds = minutes * 60;
interval = setInterval(() => {
seconds--;
if (seconds < 0) {
Expand All @@ -73,7 +73,7 @@ <h1>Contador Regresivo</h1>
counterDisplay.textContent = display;

// Actualizar el título de la página con el tiempo restante
document.title = display + " | Contador Regresivo";
document.title = display + " | Cuenta regresiva";

// Comunicarse con el Service Worker
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
Expand Down

0 comments on commit d5ef57c

Please sign in to comment.