Compare commits

..

4 Commits

@ -18,7 +18,7 @@
</head>
<body>
<div>
T &dash; <input type="text" id="time" size="12" placeholder="hh : mm : ss">
T &minus; <input type="text" id="time" size="8" placeholder="hh:mm:ss">
</div>
<script>
((t = document.querySelector("#time"), on = false, tmr = undefined) =>
@ -27,9 +27,10 @@
(e, s = t.value.split(':').reduce((a, x) => (60 * a) + +x)) => e.keyCode == 13 && !on
? (
on = true,
t.blur(),
tmr = setInterval(() => s == 0
? (on = false, clearInterval(tmr), t.value = "")
: t.value = (new Date(s-- * 1000)).toISOString().substr(11, 8).replace(/:/g, ' : '), 1000)
? (on = false, clearInterval(tmr), t.value = "", document.title = "TIMER")
: (t.value = (new Date(s-- * 1000)).toISOString().substr(11, 8).replace(/:/g, ':'), document.title = "TIMER " + t.value), 1000)
)
: 0
)

Loading…
Cancel
Save