From 8a1637901df7fdec2f5e922eb51a3b0df95025e7 Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Sun, 21 Oct 2018 18:21:22 -0700 Subject: [PATCH] download button --- index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.html b/index.html index 730d6653..da08264e 100644 --- a/index.html +++ b/index.html @@ -152,6 +152,7 @@ Second Watermark Color
+
Download
@@ -866,5 +867,12 @@ function toggleVisibility(targetClass, self, selfClass, hiddenClass, shownClass) function loadSetSymbol() { imgSetSymbol.src = "https://raw.githubusercontent.com/ImKyle4815/MTG-Set-Symbols/master/setSymbols/" + document.getElementById("setSymbolCode").value.toUpperCase() + "_" + document.getElementById("setSymbolRarity").value.toUpperCase() + ".png" } + +//Best for last - downloads the image! +function downloadCardImage(el) { + alert("This may not work because the canvas is 'tainted' - if you know how to avoid this please tell me :)") + var cardImageData = canvas.toDataURL("image/jpg") + el.href = cardImageData +}