From f960f60b257b9a47405ed91f282a5e9ac182b668 Mon Sep 17 00:00:00 2001 From: raylu Date: Tue, 15 Nov 2011 23:34:16 -0800 Subject: change flash on next button --- pages/tutorial.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'pages/tutorial.php') diff --git a/pages/tutorial.php b/pages/tutorial.php index 36d6721..5e582c6 100644 --- a/pages/tutorial.php +++ b/pages/tutorial.php @@ -19,13 +19,11 @@ function challengeGo(mapid) { switch (mapid) { case '1': tv.unlock(); - flashelement('nextbtn', 15, null, 400); updateDsp(1, 'instructions', "Now that you see what's going on, let's move on to some puzzles."); break; case '2': if (moves >= 18) { - flashelement('nextbtn', 15, null, 400); updateDsp(1, 'instructions', "Great, that's 18 moves!
Lets move on to the next shall we?"); tv.unlock(); } else { @@ -37,7 +35,6 @@ function challengeGo(mapid) { case '3': if (moves >= 64) { - flashelement('nextbtn', 15, null, 400); updateDsp(1, 'instructions', '

I almost confused you! hehe.

Next?

'); tv.unlock(); } else { @@ -49,7 +46,6 @@ function challengeGo(mapid) { case '4': if (moves >= 45) { - flashelement('nextbtn', 15, null, 400); updateDsp(1, 'instructions', "Figure out how that teleport worked?
Play with it if you didn't"); tv.unlock(); } else { @@ -61,7 +57,6 @@ function challengeGo(mapid) { case '5': if (moves >= 75) { - flashelement('nextbtn', 15, null, 400); updateDsp(1, 'instructions', 'Look at you so pro.
Go play the game!'); //Unlock next button. } else { @@ -141,6 +136,7 @@ function TutorialView(low, high) { this.cur = low; this.nextbtn = document.getElementById('nextbtn'); this.prevbtn = document.getElementById('prevbtn'); + this.interval1 = this.interval2 = null; } TutorialView.prototype.showTutorial = function(num) { for (var i = this.low; i <= this.high; i++) { @@ -153,6 +149,8 @@ TutorialView.prototype.showTutorial = function(num) { startChallenge(num); } TutorialView.prototype.next = function() { + clearInterval(this.interval1); + clearInterval(this.interval2); if (this.nextbtn.className.indexOf(' disabled') > -1) return; this.showTutorial(++this.cur); @@ -176,6 +174,14 @@ TutorialView.prototype.prev = function() { } TutorialView.prototype.unlock = function(n) { this.nextbtn.className = this.nextbtn.className.replace('disabled', ''); + this.interval1 = setInterval(function() { + tv.nextbtn.className += ' flash'; + }, 1200); + setTimeout(function() { + this.interval2 = setInterval(function() { + tv.nextbtn.className = tv.nextbtn.className.replace('flash', ''); + }, 1200); + }, 600); } -- cgit v1.2.3