diff options
| -rw-r--r-- | client/button.js | 8 | ||||
| -rw-r--r-- | client/effects.js | 2 | ||||
| -rw-r--r-- | client/templates/photos.html | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/client/button.js b/client/button.js index d4336d5..f483e8e 100644 --- a/client/button.js +++ b/client/button.js @@ -105,6 +105,11 @@ function animate2() { delay += 400 * photos.length; delay += 2000; + var canvas = document.getElementById('canvas-final'); + var dataUrl = canvas.toDataURL(); + $('a.share-save').attr('href', dataUrl); + $('a.share-save').attr('download', new Date().getTime()); + _.delay(function() { $('h2.title').html('Done!<div class="sec">This is your icon!</div>'); $('div.final div.final-dominants').hide(); @@ -112,7 +117,6 @@ function animate2() { $('div.about-link').show(); }, delay + 2000); - } Template.layout.events({ @@ -210,7 +214,7 @@ Template.photos.events({ window.print(); }, 'click button.share-save': function (event) { - window.print(); + }, 'click button.share-print': function (event) { window.print(); diff --git a/client/effects.js b/client/effects.js index fd26bf7..f5898fe 100644 --- a/client/effects.js +++ b/client/effects.js @@ -84,6 +84,8 @@ Effects = (function() { Session.set(id + ':colors', cols); Session.set(id + ':palette', valued_centroids); Session.set(id + ':newcolors', newcols); + + canvas.style.position = 'static'; }); } diff --git a/client/templates/photos.html b/client/templates/photos.html index 7cd3055..be52338 100644 --- a/client/templates/photos.html +++ b/client/templates/photos.html @@ -55,7 +55,7 @@ <button class="share-print">Print</button> </div> </div> - <canvas id="canvas-all" style="display: none; height: 150px; width: 150px;"></canvas> + <canvas id="canvas-all" style="height: 150px; width: 150px;"></canvas> </div> </template> @@ -66,7 +66,7 @@ <template name="photo"> <div class="photo" style="display: none;"> <img id="img-{{id}}" class="instagram-photo" src="{{proxy images.thumbnail.url}}" crossorigin="anonymous"> - <canvas id="canvas-{{id}}" style="height: 150px; width: 150px;"></canvas> + <canvas id="canvas-{{id}}" style="position: absolute; left: -9999px; height: 150px; width: 150px;"></canvas> <div class="title">{{date}}</div> </div> </template> |
