From fee6c70e7100d891925cf03188756d848ebc9a41 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sat, 20 Jun 2015 11:08:50 +0300 Subject: Add steps breadcrumbs --- client/button.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'client/button.js') diff --git a/client/button.js b/client/button.js index 4a9906a..5e1020f 100644 --- a/client/button.js +++ b/client/button.js @@ -2,6 +2,7 @@ function animate() { var delay = 0; // load + $('li#step1').addClass('active'); var photos = $('div.photo'); photos.each(function(i) { var self = this; @@ -14,7 +15,8 @@ function animate() { // pixelate _.delay(function () { - $('h4.step').text('(Step 2)'); + $('li#step1').removeClass('active'); + $('li#step2').addClass('active'); _.each(Session.get('photos'), function(x, i) { _.delay(function() { $('#img-'+x.id).hide() @@ -29,7 +31,8 @@ function animate() { // colorize _.delay(function() { - $('h4.step').text('(Step 3)'); + $('li#step2').removeClass('active'); + $('li#step3').addClass('active'); _.each(Session.get('photos'), function(x, i) { _.delay(function () { $('#img-'+x.id).hide() @@ -43,7 +46,8 @@ function animate() { delay += 2000; _.delay(function() { - $('h4.step').text('(Step 4)'); + $('li#step3').removeClass('active'); + $('li#step4').addClass('active'); $('div.photos').hide(); var palette = Effects.average(); @@ -81,7 +85,8 @@ function animate() { delay += 2000; _.delay(function() { - $('h4.step').text('(Step 5)'); + $('li#step4').removeClass('active'); + $('li#step5').addClass('active'); $('div.photos').hide(); $('div.final').show() @@ -162,6 +167,9 @@ Template.photos.events({ }) Template.photos.helpers({ + steps: function () { + return _.range(1,9); + }, photos: function () { return Session.get('photos'); } -- cgit v1.3.1