toggle star/dot on collector's info

This commit is contained in:
Kyle
2021-04-03 11:05:39 -07:00
parent 1ddf2dd3b1
commit 19f435b246
2 changed files with 20 additions and 2 deletions

View File

@@ -357,7 +357,7 @@ include('../globalHTML/header-1.php');
</div> </div>
</div> </div>
<div id='creator-menu-bottomInfo' class='hidden'> <div id='creator-menu-bottomInfo' class='hidden'>
<div class='readable-background padding'> <div class='readable-background padding margin-bottom'>
<h5 class='padding margin-bottom input-description'>Enter the card number, rarity, set code, language, and artist's name</h5> <h5 class='padding margin-bottom input-description'>Enter the card number, rarity, set code, language, and artist's name</h5>
<div class='padding input-grid'> <div class='padding input-grid'>
<input id='info-number' type='text' class='input' oninput='bottomInfoEdited();' placeholder='Number'> <input id='info-number' type='text' class='input' oninput='bottomInfoEdited();' placeholder='Number'>
@@ -367,6 +367,12 @@ include('../globalHTML/header-1.php');
<input id='info-artist' type='text' class='input' oninput='artistEdited(this.value);' placeholder='Artist'> <input id='info-artist' type='text' class='input' oninput='artistEdited(this.value);' placeholder='Artist'>
</div> </div>
</div> </div>
<div class='readable-background padding'>
<h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5>
<div class='padding'>
<button class='input padding' onclick='toggleStarDot();'>Toggle Star/Dot</button>
</div>
</div>
</div> </div>
<div id='creator-menu-import' class='hidden'> <div id='creator-menu-import' class='hidden'>
<div class='readable-background margin-bottom padding'> <div class='readable-background margin-bottom padding'>
@@ -440,5 +446,5 @@ include('../globalHTML/header-1.php');
</h4> </h4>
</div> </div>
</div> </div>
<script defer src='/js/creator-10.js'></script> <script defer src='/js/creator-11.js'></script>
<?php include('../globalHTML/footer.php'); ?> <?php include('../globalHTML/footer.php'); ?>

View File

@@ -1089,6 +1089,18 @@ function artistEdited(value) {
document.querySelector('#info-artist').value = value; document.querySelector('#info-artist').value = value;
bottomInfoEdited(); bottomInfoEdited();
} }
function toggleStarDot() {
for (var key of Object.keys(card.bottomInfo)) {
var text = card.bottomInfo[key].text
if (text.includes('*')) {
card.bottomInfo[key].text = text.replace('*', ' \u2022 ');
} else {
card.bottomInfo[key].text = text.replace(' \u2022 ', '*');
}
// console.log(textObject[1].text)
}
bottomInfoEdited();
}
//DRAWING THE CARD (putting it all together) //DRAWING THE CARD (putting it all together)
function drawCard() { function drawCard() {
cardContext.globalCompositeOperation = 'source-over'; cardContext.globalCompositeOperation = 'source-over';