diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-06-17 22:52:38 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-06-17 22:52:38 +0300 |
| commit | 4cf9ab8ddf79155b022e42abfd885af4c23b2114 (patch) | |
| tree | 10974405700b197eef0e3e97785011a730fcf8f8 /client/button.js | |
| parent | 6c049ad68cca652a38189df8fdd2d3c9d8642e60 (diff) | |
Dominants
Diffstat (limited to 'client/button.js')
| -rw-r--r-- | client/button.js | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/client/button.js b/client/button.js index 6691063..62e27e3 100644 --- a/client/button.js +++ b/client/button.js @@ -43,10 +43,33 @@ function animate() { delay += 2000; _.delay(function() { - Effects.average(); - }, delay); + $('h4.step').text('(Step 4)'); + $('div.photos').hide(); + + var palette = Effects.average(); + + $('div#dominant1').css('background', 'rgba(' + palette[0][0] + ',' + palette[0][1] + ',' + palette[0][2] + ',1)'); + $('div#dominant2').css('background', 'rgba(' + palette[1][0] + ',' + palette[1][1] + ',' + palette[1][2] + ',1)'); + + $('div#dominant1').siblings('h5').text('#' + + palette[0][0].toString(16).toUpperCase() + + palette[0][1].toString(16).toUpperCase() + + palette[0][2].toString(16).toUpperCase() + ) + $('div#dominant2').siblings('h5').text('#' + + palette[1][0].toString(16).toUpperCase() + + palette[1][1].toString(16).toUpperCase() + + palette[1][2].toString(16).toUpperCase() + ) + + $('div.dominants').show(); + }, delay + 2000); + + delay += 2000; _.delay(function() { + $('div.dominants').hide(); + $('div.photos').show(); _.each(Session.get('photos'), function(x, i) { _.delay(function () { Effects.averageColor(x.id); |
