From d73a80d98404c9e9f9edefdcbd68a2ae3b53c5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Gillstr=C3=B6m?= Date: Wed, 11 May 2016 18:51:39 +0200 Subject: [PATCH] Add ability to download directly in browser --- browser.js | 2 ++ index.html | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/browser.js b/browser.js index 0c4ad7b..6e67ee4 100644 --- a/browser.js +++ b/browser.js @@ -69,6 +69,8 @@ function reload (config) { background.onload = () => { var renderer = createRenderer(opts); + document.querySelector('.download').onclick = () => window.open(canvas.toDataURL(), '_blank') + if (opts.debugLuma) { renderer.debugLuma(); } else { diff --git a/index.html b/index.html index fce594c..1b02210 100644 --- a/index.html +++ b/index.html @@ -32,9 +32,14 @@ .seed-text { font-weight: 700; } + .download, .howto { font-size: 9px; } + .download:hover { + text-decoration: underline; + cursor: pointer; + } #fill { cursor: pointer; position: absolute; @@ -51,6 +56,7 @@
seed – 12380
tap to randomize
+
download image