This commit is contained in:
Kyle
2019-08-15 19:01:01 -07:00
parent 96783f1876
commit d6b497c020
2 changed files with 5 additions and 3 deletions

View File

@@ -94,6 +94,8 @@ function playerBox(playerBoxID, canvasRotation, wide) {
this.color = "#222222"
this.textColor = "#ffffff"
this.image = new Image()
this.image.customVarID = playerBoxID
this.image.onload = function() {drawPlayerBox(this.customVarID)}
//vars to make navigation easier
this.canvas.customVarID = playerBoxID
this.canvas.customVarContext = this.canvas.getContext("2d")
@@ -144,7 +146,7 @@ function loadImage(event, destination) {
reader.onload = function() {
var dataURL = reader.result
destination.src = dataURL
setTimeout(function(){drawPlayerBox(parseInt(document.getElementById("inputPlayer").value))}, 500)
// setTimeout(function(){drawPlayerBox(parseInt(document.getElementById("inputPlayer").value))}, 500)
}
reader.readAsDataURL(input.files[0])
}
@@ -173,7 +175,7 @@ function inputCardArtName(cardArtNameInput) {
}
function inputCardArtNameNumber(cardArtNameNumberInput) {
playerList[parseInt(document.getElementById('inputPlayer').value) - 1].image.src = cardArtUrlList[cardArtNameNumberInput - 1]
setTimeout(function(){drawPlayerBox(parseInt(document.getElementById("inputPlayer").value))}, 500)
// setTimeout(function(){drawPlayerBox(parseInt(document.getElementById("inputPlayer").value))}, 500)
}
document.getElementById("mainGrid").addEventListener("touchmove", function(event) {
event.preventDefault()

View File

@@ -70,7 +70,7 @@
<button onclick="updateBackgroundColor('#222222')">Default</button><br>
Image:<br>
<input type="file" accept="image/*" onchange="loadImage(event, playerList[parseInt(document.getElementById('inputPlayer').value) - 1].image)" placeholder="Via File Upload"><br>
<input type="text" placeholder="Via URL" onchange="playerList[parseInt(document.getElementById('inputPlayer').value) - 1].image.src = this.value;setTimeout(function(){drawPlayerBox(parseInt(document.getElementById('inputPlayer').value))}, 1000)"><br>
<input type="text" placeholder="Via URL" onchange="playerList[parseInt(document.getElementById('inputPlayer').value) - 1].image.src = this.value"><br>
<input id="inputCardArtName" onchange="inputCardArtName(this.value)" type="text" placeholder="Via Card Name"><br>
<input id="inputCardArtNameNumber" onchange="inputCardArtNameNumber(this.value)" type="number" value="1" min="1" max="1"><br><br>
Text Color:<br>