From e45407f8ff1419d8e94f6b2e31ada9875c60fc14 Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Sun, 19 Aug 2018 17:14:59 -0700 Subject: [PATCH] Add files via upload --- KCI/KylesCardImager.html | 203 ++++++++++++++++++++++++++------------- 1 file changed, 134 insertions(+), 69 deletions(-) diff --git a/KCI/KylesCardImager.html b/KCI/KylesCardImager.html index 21eacd9f..e730f790 100644 --- a/KCI/KylesCardImager.html +++ b/KCI/KylesCardImager.html @@ -6,100 +6,120 @@ -
Kyle's Card Imager
+
Kyle's Card Imager
- +
+
- -

-
+
+
+
Card Border
+ +
Name, Mana Cost, Type
+ +
Rules Text
+ +
Card Art
+ +
Other Information
+ +
Set Symbol and Watermark
+ -
-
For Terms of Use and Disclaimer, see the Github page.
+
+
+
For Terms of Use and Disclaimer, see the Github page.
@@ -153,33 +175,62 @@ font-family: mplantini; src: url("data/fonts/mplantin-i.ttf"); } -button { - color: rgb(128,255,128); - font-family: belerenbsc; - font-size: 20px; - background-color: rgb(96,96,96); -} -.wrapper * { - color: rgb(255,255,255); - font-family: mplantin; - font-size: 18px; - background-color: rgb(96,96,96); -} -#title { +.title { text-align: center; color: rgb(128,255,128); font-family: belerenbsc; font-size: 60px; } -#info { +.info { text-align: center; color: rgb(96,96,96); font-family: belerenbsc; font-size: 16px; } +.toggle { + text-align: center; + color: rgb(255, 255, 255); + font-family: belerenbsc; + font-size: 20px; + width: 408px; + padding: 5px; + border: 1px solid rgb(128, 255, 128); +} +.toggle:hover { + color: rgb(128, 255, 128); +} +.toggleShown { + color: rgb(128, 255, 128); + border-color: rgb(128, 255, 128); + border-style: solid solid hidden solid; +} +.hidden { + display: none; + font-size: 100px; +} +.shown { + padding: 5px; + border-width: 1px; + border-color: rgb(128, 255, 128); + border-style: dashed solid solid solid; +} +} +.shown * { + color: rgb(255,255,255); + font-family: mplantin; + font-size: 15px; +} +.column { + float: left; +} +.row:after{ + content: ""; + display: table; + clear: both; +} body { color: rgb(255,255,255); - font-family: belerenbsc; + font-family: mplantin; font-size: 18px; background-color: rgb(56,56,56); } @@ -354,6 +405,8 @@ function drawSetSymbol() { width = setSymbolWidth height = imgSetSymbol.height * (width / imgSetSymbol.width) } + height *= document.getElementById("setSymbolSize").value / 100 + width *= document.getElementById("setSymbolSize").value / 100 var y = setSymbolY - height / 2 var x = setSymbolRight - width card.drawImage(imgSetSymbol, x, y, width, height) @@ -435,6 +488,7 @@ function writeText() { } //Bottom info on M15 cards function bottomInfoM15() { + var shiftInfo = 445 card.fillStyle = "white" canvas.style.letterSpacing = "0.8px" card.font = "19.5px relaymedium" @@ -446,15 +500,24 @@ function bottomInfoM15() { card.font = "19.5px relaymedium" card.fillText(document.getElementById("inputNumber").value, 49, m15InfoY - 20) card.fillText(document.getElementById("inputRarity").value, artistBrushShift - 1, m15InfoY - 20) + if (445 < artistBrushShift + card.measureText(document.getElementById("inputRarity").value).width && document.getElementById("creatureCheckbox").checked == false) { + shiftInfo = artistBrushShift + card.measureText(document.getElementById("inputRarity").value).width + 5 + } canvas.style.letterSpacing = "-0.1px" card.font = "24px matrixbsc" card.fillText(document.getElementById("inputArtist").value, artistBrushShift + 21, m15InfoY + 2) - canvas.style.letterSpacing = "0px" - card.font = "17px mplantin" - if (document.getElementById("creatureCheckbox").checked == true) { - card.fillText("KCI — " + document.getElementById("inputInfo").value, 445, m15InfoY) - } else { - card.fillText("KCI — " + document.getElementById("inputInfo").value, 445, m15InfoY - 18) + if (445 < artistBrushShift + 21 + card.measureText(document.getElementById("inputArtist").value).width && document.getElementById("creatureCheckbox").checked == true) { + shiftInfo = artistBrushShift + card.measureText(document.getElementById("inputArtist").value).width + 26 + } + //This is where "KCI —" is hardcoded. The only reason is to prevent users from easily typing in the trademark and copyright that's usually on real cards. It's also there so I can see if a card was created with my program, it makes me feel good :) + if (document.getElementById("inputInfo").value != "") { + canvas.style.letterSpacing = "0px" + card.font = "17px mplantin" + if (document.getElementById("creatureCheckbox").checked == true) { + card.fillText("KCI — " + document.getElementById("inputInfo").value, shiftInfo, m15InfoY + 3) + } else { + card.fillText("KCI — " + document.getElementById("inputInfo").value, shiftInfo, m15InfoY - 17) + } } } //Bottom info on 8th edition cards @@ -553,16 +616,18 @@ function rulesText(text, x, y) { } } -//Just a series of alerts that explains how to use the program -function howTo() { - window.alert("First, select a border, a color, and select whether or not you want to include a Power/Toughness, Legendary Border, Rare Stamp, or Foil Overlay.") - window.alert("Then, fill in all the details such as the card name, type, text, etc...") - window.alert("When typing in the mana cost use the following format: '3 g u'") - window.alert("The symbols are labeled w u b r g, add a prefix of 'p' for phyrexian mana, or a prefix of '2' for colorless hybrid mana. For regular hybrid mana, make sure to use the correct order. For example, 'gu' is correct for Green/Blue hybrid mana while 'ug' is incorrect. You can also use numbers 0-20, 'c' for colorless (diamond) mana, 't' for tap, 'untap' for untap, 'e' for energy, and 'snow' for snow mana.") - window.alert("the same codes used in the mana cost are also used in the rules text. Just put a '<' before each code and a '>' after each code. For example, '<3>' would display the three mana symbol, the phyrexian green mana symbol, and the tap symbol. In addition to mana symbols, you can use '' to start italicized text and '' to end it. '' will skip to the next line and allow for extra spacing when you increase the Pixels Between Paragraphs, and '' will ignore the Pixels Between Paragraphs. These other codes require a space (' ') before and after the carrots. ('<' and '>')") - window.alert("To upload the card image, the set symbol, or the watermark, click the associated 'Choose File' button and navigate to your desired image. Below the Image selector, you may adjust the Zoom, Left, and Up values to scale or move the card image. If you upload your own set symbols or watermarks, it is recommended that you crop these images have transparent backgrounds and are cropped sufficiently.") - window.alert("Remember to properly credit any artwork that you upload!") - window.alert("Thank you for using Kyle's Card Imager, remember that all this code is free but donations are greatly appreciated!") +//Toggles the visibility of predetermined sections of the input boxes +function toggleVisibility(targetClass, self, selfClass, hiddenClass, shownClass) { + var alreadyShown = document.getElementsByClassName(selfClass) + if (alreadyShown.length >= 1 && alreadyShown[0] != self) { + alreadyShown[0].click() + } + self.classList.toggle(selfClass) + var elementList = document.getElementsByClassName(targetClass) + for (i = 0; i < elementList.length; i ++) { + elementList[i].classList.toggle(hiddenClass) + elementList[i].classList.toggle(shownClass) + } } \ No newline at end of file