diff options
author | raylu <raylu@mixpanel.com> | 2011-11-15 23:34:16 -0800 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2011-11-15 23:34:16 -0800 |
commit | f960f60b257b9a47405ed91f282a5e9ac182b668 (patch) | |
tree | 93579f0d9cec8d5982af5d10bcb84360620cb833 /pages/tutorial.php | |
parent | 55b25d5e66710298a50ecdcc8fb8db8cb3b2fb8a (diff) | |
download | pathery-f960f60b257b9a47405ed91f282a5e9ac182b668.tar.xz |
change flash on next button
Diffstat (limited to 'pages/tutorial.php')
-rw-r--r-- | pages/tutorial.php | 16 |
1 files changed, 11 insertions, 5 deletions
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!<br />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', '<p>I almost confused you! hehe.</p><p>Next?</p>');
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?<br />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.<br />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);
}
</script>
|