mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-26 21:04:58 -05:00
download button
This commit is contained in:
@@ -152,6 +152,7 @@
|
|||||||
<input type="checkbox" id="checkboxSecondWatermarkColor"> Second Watermark Color <select id="secondWatermarkColorSelection"></select></input>
|
<input type="checkbox" id="checkboxSecondWatermarkColor"> Second Watermark Color <select id="secondWatermarkColorSelection"></select></input>
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="toggle" onclick="downloadCardImage()" id="downloadCardImage" href="" download="card.jpg">Download</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -866,5 +867,12 @@ function toggleVisibility(targetClass, self, selfClass, hiddenClass, shownClass)
|
|||||||
function loadSetSymbol() {
|
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"
|
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
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<html>
|
<html>
|
||||||
|
Reference in New Issue
Block a user