flavor text

This commit is contained in:
Kyle
2020-08-17 16:24:44 -07:00
parent 0b4b2646a6
commit 2bd575c5fd
3 changed files with 15 additions and 2 deletions

View File

@@ -122,6 +122,7 @@
<input type="text" placeholder="Via URL" onchange="cardArt.src = 'https://cors-anywhere.herokuapp.com/' + this.value"> <input type="text" placeholder="Via URL" onchange="cardArt.src = 'https://cors-anywhere.herokuapp.com/' + this.value">
<input type="text" id="inputCardArtName" onchange="inputCardArtName(this.value)" placeholder="Via Card Name"> <input type="text" id="inputCardArtName" onchange="inputCardArtName(this.value)" placeholder="Via Card Name">
<input type="number" id="inputCardArtNameNumber" onchange="inputCardArtNameNumber(this.value)" value="" min="1" max="1" placeholder="Which Art From Card Name"> <input type="number" id="inputCardArtNameNumber" onchange="inputCardArtNameNumber(this.value)" value="" min="1" max="1" placeholder="Which Art From Card Name">
<input type="text" placeholder="Artist's Name" id="inputInfoArtist2" oninput="artistNameUpdated(this.value)" value="">
</div> </div>
<div> <div>
<div>X, Y, &amp; Zoom:</div> <div>X, Y, &amp; Zoom:</div>
@@ -141,7 +142,7 @@
<input type="text" placeholder="Rarity" id="inputInfoRarity" oninput="bottomInfoUpdated()" value="P"> <input type="text" placeholder="Rarity" id="inputInfoRarity" oninput="bottomInfoUpdated()" value="P">
<input type="text" placeholder="Set" id="inputInfoSet" oninput="bottomInfoUpdated()" value="MTG"> <input type="text" placeholder="Set" id="inputInfoSet" oninput="bottomInfoUpdated()" value="MTG">
<input type="text" placeholder="Language" id="inputInfoLanguage" oninput="bottomInfoUpdated()" value="EN"> <input type="text" placeholder="Language" id="inputInfoLanguage" oninput="bottomInfoUpdated()" value="EN">
<input type="text" placeholder="Artist's Name" id="inputInfoArtist" oninput="bottomInfoUpdated()" value=""> <input type="text" placeholder="Artist's Name" id="inputInfoArtist" oninput="artistNameUpdated(this.value)" value="">
</div> </div>
Remember that you must properly credit the artist before downloading your card! Remember that you must properly credit the artist before downloading your card!
</div> </div>

View File

@@ -118,6 +118,7 @@ function importSavedCard(localStorageKey = document.getElementById('inputCardToI
document.getElementById('inputInfoSet').value = importedCard.set document.getElementById('inputInfoSet').value = importedCard.set
document.getElementById('inputInfoLanguage').value = importedCard.language document.getElementById('inputInfoLanguage').value = importedCard.language
document.getElementById('inputInfoArtist').value = importedCard.artist document.getElementById('inputInfoArtist').value = importedCard.artist
document.getElementById('inputInfoArtist2').value = importedCard.artist
bottomInfoUpdated() bottomInfoUpdated()
//Mana Cost //Mana Cost
if (importedCard.manaCostList) { if (importedCard.manaCostList) {

View File

@@ -734,6 +734,7 @@ function inputCardArtName(cardArtNameInput) {
function inputCardArtNameNumber(cardArtNameNumberInput) { function inputCardArtNameNumber(cardArtNameNumberInput) {
cardArt.src = cardArtUrlList[cardArtNameNumberInput - 1] cardArt.src = cardArtUrlList[cardArtNameNumberInput - 1]
document.getElementById('inputInfoArtist').value = cardArtArtistList[cardArtNameNumberInput - 1] document.getElementById('inputInfoArtist').value = cardArtArtistList[cardArtNameNumberInput - 1]
document.getElementById('inputInfoArtist2').value = document.getElementById('inputInfoArtist').value
bottomInfoUpdated() bottomInfoUpdated()
} }
@@ -856,7 +857,11 @@ function inputCardNameNumberTextImport(index) {
var importCardTextResponse = savedImportResponse[index] var importCardTextResponse = savedImportResponse[index]
importText(beforeAfter(importCardTextResponse, '"name":"', '",'), 'Card Title') importText(beforeAfter(importCardTextResponse, '"name":"', '",'), 'Card Title')
importText(beforeAfter(importCardTextResponse, '"type_line":"', '",'), 'Card Type') importText(beforeAfter(importCardTextResponse, '"type_line":"', '",'), 'Card Type')
importText(beforeAfter(importCardTextResponse, '"oracle_text":"', '",').replace(/\\n/g, '\n').replace(/ \\"/g, ' \u201C').replace(/\\"/g, '\u201D').replace(/\(/g, '{i}(').replace(/\)/g, '){/i}'), 'Rules Text') var flavorText = '{flavor}' + beforeAfter(importCardTextResponse, '"flavor_text":"', '","')
if (flavorText.length < 10) {
flavorText = ''
}
importText((beforeAfter(importCardTextResponse, '"oracle_text":"', '",') + flavorText).replace(/\n\\"/g, '\n\u201C').replace(/{flavor}\\"/g, '{flavor}\u201C').replace(/\\n/g, '\n').replace(/ \\"/g, ' \u201C').replace(/\\"/g, '\u201D').replace(/\(/g, '{i}(').replace(/\)/g, '){/i}'), 'Rules Text')
if (importCardTextResponse.includes('"power":"')) { if (importCardTextResponse.includes('"power":"')) {
importText(beforeAfter(importCardTextResponse, '"power":"', '",') + '/' + beforeAfter(importCardTextResponse, '"toughness":"', '",'), 'Power/Toughness') importText(beforeAfter(importCardTextResponse, '"power":"', '",') + '/' + beforeAfter(importCardTextResponse, '"toughness":"', '",'), 'Power/Toughness')
} else { } else {
@@ -1011,6 +1016,12 @@ function notify(message, color) {
` `
}//notify('MessageGoesHere', '#aaffaadd') }//notify('MessageGoesHere', '#aaffaadd')
function artistNameUpdated(artistName) {
document.getElementById('inputInfoArtist').value = artistName
document.getElementById('inputInfoArtist2').value = artistName
bottomInfoUpdated()
}
//Must run last: //Must run last:
initialize() initialize()