X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=score.js;h=3f0a4d055daad4353f9d96ceffedd3adaf9679f8;hb=a5e8345fcfe628521d5d6e1e359456c9cb7e8ec0;hp=1d28e4cf2308015377b98626ea629003bb7e3b4c;hpb=669e31b69caa47917904c68ff80b2583094d8628;p=ultimatescore diff --git a/score.js b/score.js index 1d28e4c..3f0a4d0 100644 --- a/score.js +++ b/score.js @@ -164,7 +164,20 @@ function update_clock() let sec = elapsed % 60; if (sec < 10) sec = "0" + sec; - document.getElementById('clock').innerHTML = min + ":" + sec; + let text = min + ":" + sec; + + // This is a hack around the fact that Exo has variable-width numerals. + // It doesn't look fantastic, but for the clock, it's better not to have + // the text jumping around. + let html = ""; + for (let i = 0; i < text.length; ++i) { + if (text.charAt(i) === ':') { + html += ':'; + } else { + html += "
" + text.charAt(i) + "
"; + } + } + document.getElementById('clock').innerHTML = html; } function goalA() @@ -202,7 +215,7 @@ function update_score() document.getElementById('score').innerHTML = scoreA + " â€“ " + scoreB; } -/* called by caspar only */ +/* called by the Nageru theme only */ function play() { document.getElementById('manualcontrols').style.display = 'none';