forked from GithubMirrors/cardconjurer
		
	download
This commit is contained in:
		
							
								
								
									
										12
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								index.html
									
									
									
									
									
								
							@@ -184,7 +184,7 @@
 | 
				
			|||||||
				<div class="togglee">
 | 
									<div class="togglee">
 | 
				
			||||||
					Frame Rate
 | 
										Frame Rate
 | 
				
			||||||
					<input type="number" id="inputFPS" value="10" min="0" onchange="window.clearInterval(cardClockInterval); cardClockInterval = setInterval(cardClock, 1000 / document.getElementById('inputFPS').value)"></input>
 | 
										<input type="number" id="inputFPS" value="10" min="0" onchange="window.clearInterval(cardClockInterval); cardClockInterval = setInterval(cardClock, 1000 / document.getElementById('inputFPS').value)"></input>
 | 
				
			||||||
					<div onclick="downloadCardImage()" id="downloadCardImage" href="" download="card.jpg">Download</div>
 | 
										<a onclick="downloadCardImage(this)" id="downloadCardImage" href="" download="card.png">Download</a>
 | 
				
			||||||
				</div>
 | 
									</div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
			<!--END-->
 | 
								<!--END-->
 | 
				
			||||||
@@ -968,15 +968,17 @@ function resizeThings() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
//runs the autocrop function for the chosen set symbol
 | 
					//runs the autocrop function for the chosen set symbol
 | 
				
			||||||
function loadSetSymbol() {
 | 
					function loadSetSymbol() {
 | 
				
			||||||
	imgSetSymbol.crossOrigin = "anonymous"
 | 
						imgSetSymbol.crossOrigin = "Anonymous"
 | 
				
			||||||
	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!
 | 
					//Best for last - downloads the image!
 | 
				
			||||||
function downloadCardImage(el) {
 | 
					function downloadCardImage(linkElement) {
 | 
				
			||||||
	alert("This may not work because the canvas is 'tainted' - if you know how to avoid this please tell me")
 | 
					 | 
				
			||||||
	var cardImageData = canvas.toDataURL()
 | 
						var cardImageData = canvas.toDataURL()
 | 
				
			||||||
	el.href = cardImageData
 | 
						if (cardImageData == undefined) {
 | 
				
			||||||
 | 
							alert("Sorry, it seems that you cannot download your card. Please try using a different browser.")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						linkElement.href = cardImageData
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
<html>
 | 
					<html>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user