Answer the question
In order to leave comments, you need to log in
How is it done, a timer in the tab title?
I click on start with keyboard control and if you look at the shortcut of the browser tab, then there is a countdown.
https://htdt.github.io/digital_trip/
Answer the question
In order to leave comments, you need to log in
Feature from this site...
DT.Game.prototype.updateTimer = function (dtime) {
var sec, min;
this.timer += dtime;
sec = Math.floor(this.timer);
if (sec > Math.floor(this.timer - dtime) ) {
min = Math.floor(sec / 60);
sec = sec % 60;
sec = sec < 10 ? '0' + sec.toString() : sec;
DT.$title.html(min + ':' + sec + ' in digital trip');
}
};
const BASE_TITLE = 'bla bla';
function onProgress(persent) {
document.title = `${persent}% ${BASE_TITLE}`;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question