From 8737812cd4f69ee8356f1563ba91f572e67f183b Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Wed, 19 Oct 2016 18:13:45 +0200 Subject: [PATCH] update with better display --- timer/index.htm | 9 ++++++++- timer/style.css | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/timer/index.htm b/timer/index.htm index 194a07a..3c067cc 100644 --- a/timer/index.htm +++ b/timer/index.htm @@ -30,8 +30,15 @@ function update() { timer = timer-10; + min = Math.floor(timer/60); + if(timer<0) { + min = Math.ceil(timer/60); + if(timer>-60) + min = '-'+min; + } + sec = ((timer%60)?(Math.abs(timer%60)):'00'); document.getElementById('tim').innerHTML = Math.ceil(timer/60); - document.getElementById('timsmall').innerHTML = Math.floor(timer/60)+':'+((timer%60)?(timer%60):'00'); + document.getElementById('timsmall').innerHTML = min+':'+sec; if(timer<= 0) document.getElementById('tim').className='shutup'; diff --git a/timer/style.css b/timer/style.css index 22d4056..48be83f 100644 --- a/timer/style.css +++ b/timer/style.css @@ -8,10 +8,15 @@ body { } -#set { +#setting { position:absolute; left:5px; top:5px; +height:20px; +} + +input { +height:20px; } -- 2.43.0