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 --- css/stats.css | 2 +- css/tutorial.css | 12 ++++++++++++ includes/header.php | 2 +- pages/tutorial.php | 16 +++++++++++----- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/css/stats.css b/css/stats.css index c36c1d0..e72fb6a 100644 --- a/css/stats.css +++ b/css/stats.css @@ -16,7 +16,7 @@ td, th { background: #000; transition:background .5s; -webkit-transition:background .5s; - -o-transition:color .5s; + -o-transition:color .5s; -moz-transition:color .5s; cursor: default; } diff --git a/css/tutorial.css b/css/tutorial.css index 971bfce..41a2ae4 100644 --- a/css/tutorial.css +++ b/css/tutorial.css @@ -17,6 +17,10 @@ a.next { float: right; margin: 0 10px; cursor: pointer; + transition:background .3s; + -webkit-transition:background .3s; + -o-transition:color .3s; + -moz-transition:color .3s; } a.next:hover { background-color: #446; @@ -33,3 +37,11 @@ a.next.disabled, a.next.disabled:hover { .hidden { display: none; } + +.flash { + background-color: #a95 !important; + transition:background .3s !important; + -webkit-transition:background .3s !important; + -o-transition:color .3s !important; + -moz-transition:color .3s !important; +} diff --git a/includes/header.php b/includes/header.php index 3943238..d56e20d 100644 --- a/includes/header.php +++ b/includes/header.php @@ -16,7 +16,7 @@ function htmlHeader($css = array()) { } ?> - + = 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