120-timer

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ae129d84b66a0061629ec47a9fdd09cc6cd7a7a0
Author: minerva-jupiter <ryouturn@gmail.com>
Date:   Sat, 16 Aug 2025 00:21:42 +0000

first commit

Diffstat:
Aindex.html | 42++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+), 0 deletions(-)

diff --git a/index.html b/index.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html lang="ja"> + <head> + <meta charset="utf-8"> + <title>120-timer</title> + </head> + <body> + <header> + <h1>120-timer</h1> + <h3>by minerva_juppiter</h3> + </header> + <nav> + <a href="https://www.minervajuppiter.net">My Home Page</a> + / + <a href="https://github.com/minerva-jupiter/120-timer">repository</a> + </nav> + <article> + <h2><span id="sec"></span></h2> + <p>second left</p> + </article> + <script> + const sec = document.getElementById("sec"); + let startTime; + function initialise(){ + startTime = new Date(); + console.log("initialised") + } + function countdown(){ + const now = new Date(); + const leastTime = now.getTime() - startTime.getTime() + if(leastTime >= 120000){ + console.log("time is up"); + alert("time is up"); + }else{ + sec.innerHTML = Math.trunc(leastTime / 1000); + } + } + initialise(); + setInterval(countdown,1000); + </script> + </body> +</html>