Fix: timer text color

This commit is contained in:
2018-12-10 23:16:30 +09:00
parent 5bd5f0809e
commit 09b1fb100b
+23 -21
View File
@@ -22,6 +22,7 @@ function Timer() {
Timer.prototype.initVariables = function() {
this.isTimerGoingOn = false;
this.isTimeOver = false;
this.timeStart = 0
this.timeLeft = 0;
@@ -52,7 +53,7 @@ Timer.prototype.loadDataFromServer = function() {
// this.setTimerTextColor(0xffffff);
// }
this.setTimerTextColor(0xc04040);
this.setTimerTextColor(0x40c0c0);
}
Timer.prototype.makeTimer = function() {
@@ -107,15 +108,15 @@ Timer.prototype.makeResetButton = function() {
setting.fontStyle.fontSize = 40;
setting.setStrokeColor(
0x903030,
0x802020,
0x502020,
0x309090,
0x208080,
0x205050,
0x666666
);
setting.setButtonColor(
0xc04040,
0xa03030,
0x802020,
0x40c0c0,
0x30a0a0,
0x208080,
0x666666
);
setting.setTextColor(
@@ -144,15 +145,15 @@ Timer.prototype.makePlayButton = function() {
// blue tone
setting.setStrokeColor(
0x208080,
0x106060,
0x004040,
0x808020,
0x606010,
0x404000,
0x333333
);
setting.setButtonColor(
0x40c0c0,
0x30a0a0,
0x209090,
0xc0c040,
0xa0a030,
0x909020,
0x666666
);
setting.setTextColor(
@@ -250,7 +251,7 @@ Timer.prototype.setTimerTextColor = function(color) {
Timer.prototype.startTimer = function() {
this.isTimerGoingOn = true;
this.setTimerTextColor(0x40c0c0);
this.setTimerTextColor(0xc0c040);
this.updateTimeText();
ShowNotifyTimeOver(this.timeLeft * Timer.TIME_MILLISECONDS);
@@ -264,6 +265,8 @@ Timer.prototype.startTimer = function() {
}
Timer.prototype.pauseTimer = function() {
this.isTimeOver = false;
this.setTimerTextColor(0xa0a0a0);
this.updateTimeText();
@@ -281,7 +284,7 @@ Timer.prototype.resetTimer = function() {
this.pauseTimer();
this.isTimerGoingOn = false;
this.setTimerTextColor(0xc04040);
this.setTimerTextColor(0x40c0c0);
// this.loadDataFromServer();
}
@@ -301,17 +304,16 @@ Timer.prototype.tickTimeLeft = function() {
this.updateTimeText();
if(this.timeLeft < 0) {
this.setTimerTextColor(0xff0000);
if(!this.isTimeOver && this.timeLeft < 0)
this.timeOver();
}
}
Timer.prototype.timeOver = function() {
this.isTimeOver = true;
this.setTimerTextColor(0xc04040);
console.log("time over");
// this.startButton.disable();
// this.restartButton.disable();
// this.pauseButton.disable();
// xhr = new XMLHttpRequest();
// xhr.open('POST', 'delete_last_timestamp.php', true);