This commit is contained in:
Kyle
2019-11-03 17:07:48 -08:00
parent 044d93aad0
commit 4b1e014317
4 changed files with 79 additions and 14 deletions

View File

@@ -114,6 +114,9 @@ function addToCardMaster(index, target) {
document.getElementById("imgPreview").src = window[nameArray[index]].image.src
return
}
if (document.getElementById("checkboxSecondary").checked) {
target += "Secondary"
}
if ((target == typeArray[index]) || (secondaryArray[index] && target.replace("Secondary", "")) == typeArray[index] || (typeArray[index] == "Full")) {
if (cardMasterTypes.includes(target)) {
cardMasterImages[cardMasterTypes.indexOf(target)] = window[nameArray[index]]
@@ -175,7 +178,6 @@ var currentlyWritingText = false
//Rewrites all the text!
function updateText() {
if (!currentlyWritingText) {
console.log(currentlyWritingText)
currentlyWritingText = true
setTimeout(updateTextInnerShell, 100)
}
@@ -289,9 +291,13 @@ function userEnterImage() {
}
//Removes an image from user input
function userRemoveImage() {
if (cardMasterTypes.includes(getSelectedTab("frameType")) && getSelectedTab("frameType") != "Full") {
cardMasterImages.splice(cardMasterTypes.indexOf(getSelectedTab("frameType")), 1)
cardMasterTypes.splice(cardMasterTypes.indexOf(getSelectedTab("frameType")), 1)
var targetToRemove = getSelectedTab("frameType")
if (document.getElementById("checkboxSecondary").checked) {
targetToRemove += "Secondary"
}
if (cardMasterTypes.includes(targetToRemove) && targetToRemove != "Full") {
cardMasterImages.splice(cardMasterTypes.indexOf(targetToRemove), 1)
cardMasterTypes.splice(cardMasterTypes.indexOf(targetToRemove), 1)
cardMasterUpdated()
}
}
@@ -323,12 +329,14 @@ function finishChangingVersion() {
document.getElementById("frameType").innerHTML = ""
document.getElementById("inputImageTypeOpacity").innerHTML = ""
for (var i = 0; i < version.typeOrder.length; i ++) {
tabSelectAddOption("frameType", version.typeOrder[i].replace("Secondary", " (right)"), version.typeOrder[i])
if (window[version.currentVersion + "Mask" + version.typeOrder[i]]) {
document.getElementById("inputImageTypeOpacity").innerHTML += "<option>" + version.typeOrder[i] + "</option>"
cardMasterOpacity[cardMasterOpacity.length] = version.typeOrder[i]
cardMasterOpacityValue[cardMasterOpacityValue.length] = 100
}
if (!version.typeOrder[i].includes("Secondary")) {
tabSelectAddOption("frameType", version.typeOrder[i], version.typeOrder[i])
if (window[version.currentVersion + "Mask" + version.typeOrder[i]]) {
document.getElementById("inputImageTypeOpacity").innerHTML += "<option>" + version.typeOrder[i] + "</option>"
cardMasterOpacity[cardMasterOpacity.length] = version.typeOrder[i]
cardMasterOpacityValue[cardMasterOpacityValue.length] = 100
}
}
}
document.getElementsByClassName("frameType")[0].className += " activeTab"
for (var i = 0; i < version.textList.length; i ++) {

View File

@@ -326,11 +326,60 @@ footer a:hover {
text-overflow: ellipsis;
text-indent: 0em;
}
.tab, button, select, option {
cursor: pointer;
}
/*Custom Checkboxes*/
.realCheckboxContainer {
margin-top: 0.45em
}
.checkboxContainer {
position: relative;
padding-left: 1.5em;
padding-top: 0.25em;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.checkboxContainer input {
position: absolute;
opacity: 0;
height: 0;
width: 0;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 1.2em;
width: 1.2em;
transition: 0.33s;
background-color: var(--clear-light);
border: 1px solid var(--light-color)
}
.checkboxContainer:hover input ~ .checkmark {
background-color: var(--clear-dark);
}
.checkboxContainer input:checked ~ .checkmark {
background-color: var(--dark-color);
}
.checkmark:after {
content: "X";
font: 1.2em gothammedium;
color: white;
position: absolute;
opacity: 0;
transition: 0.33s;
}
.checkboxContainer input:checked ~ .checkmark:after {
opacity: 1;
}
.checkboxContainer .checkmark:after {
left: 0.15em;
top: 0.08em;
}

View File

@@ -3,6 +3,7 @@
//============================================//
version.currentVersion = "m15"
version.typeOrder = ["Full", "FullSecondary", "Frame", "FrameSecondary", "Pinline", "PinlineSecondary", "Legendary", "LegendarySecondary", "Title", "TitleSecondary", "Type", "TypeSecondary", "Rules", "RulesSecondary", "PT", "RareStamp", "RareStampSecondary"]
//version.typeOrder = ["Full", "Frame", "Pinline", "Legendary", "Title", "Type", "Rules", "PT", "RareStamp", "RareStampSecondary"]
version.typeNotFull = ["Legendary", "LegendarySecondary", "PT", "RareStamp", "RareStampSecondary"]
version.artX = cwidth(58)
version.artY = cheight(118)
@@ -41,4 +42,4 @@ function m15BottomInfo() {
bottomInfoContext.writeText("\u2122 & \u00a9 " + date.getFullYear() + " Wizards of the Coast", cardWidth / 2, cheight(993 + copyrightShift), cwidth(322), 0, "mplantin", 17, "white", "oneLine=true,textAlign='right'")
updateCardCanvas()
}
setTimeout(m15BottomInfo, 250)
setTimeout(m15BottomInfo, 250)

View File

@@ -28,7 +28,14 @@
<div class="bar"></div>
<div class="tabContent editor displayed" id="optionFrame">
Select the part of the card frame:<br>
<div class="tab tabSelect" id="frameType"></div><br>
<div class="tab tabSelect" id="frameType"></div>
<div class="realCheckboxContainer">
<label class="checkboxContainer">
Right Half
<input type="checkbox" id="checkboxSecondary">
<span class="checkmark"></span>
</label>
</div>
Select the color:<br>
<div class="tab tabSelect" id="tabSelectColor"></div><br>
<div class="imageGrid">