From ab58456a4a8174f2e7dbe96b4898ff53699938a5 Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Sun, 4 Nov 2018 11:37:33 -0800 Subject: [PATCH] fixed transparency --- index.html | 187 +++++++++++++++++++++++++++-------------------------- 1 file changed, 94 insertions(+), 93 deletions(-) diff --git a/index.html b/index.html index 2b121df8..24562570 100644 --- a/index.html +++ b/index.html @@ -37,8 +37,8 @@
-
@@ -46,8 +46,8 @@
-
@@ -55,8 +55,8 @@
-
@@ -66,28 +66,28 @@
-
-
-
-
-
-
-
-
Border Color
-
-
@@ -201,8 +201,8 @@
-
@@ -211,8 +211,8 @@
-
Set Code @@ -230,8 +230,8 @@

-

@@ -255,8 +255,8 @@
-
@@ -401,21 +401,21 @@ input[type="color"] { /*Custom checkboxes!*/ .checkbox { top: 4px; - position: relative; + position: relative; } .checkbox label { - display: inline-block; - width: 20px; - height: 20px; - border-radius: 100%; - position: absolute; - top: 0px; - left: 0px; - z-index: 1; - background: var(--section-border-color); + display: inline-block; + width: 20px; + height: 20px; + border-radius: 100%; + position: absolute; + top: 0px; + left: 0px; + z-index: 1; + background: var(--section-border-color); } .checkbox input[type=checkbox]:checked + label { - background: var(--title-text-color); + background: var(--title-text-color); } .checkbox input { opacity: 0; @@ -428,10 +428,10 @@ input[type="color"] { } /*Custom select box (dropdown)*/ .dropdown { - position: relative; - display: inline-block; - width: 100%; - padding: 0px; + position: relative; + display: inline-block; + width: 100%; + padding: 0px; } .dropdown select { width: inherit; @@ -452,8 +452,8 @@ input[type="color"] { position: absolute; pointer-events: none; color: var(--title-text-color); - right: 10px; - top: 38%; + right: 10px; + top: 38%; } /*List of all mana symbols and their associated codes*/ #symbolList img { @@ -576,48 +576,50 @@ document.getElementById("secondWatermarkColorSelection").innerHTML = document.ge //Runs ten times every second (main loop) function cardClock() { - //Insures that the corners of the final image are transparent - card.globalCompositeOperation = "source-over" - drawMask(document.getElementById("inputColor").value, 0, 0, cardWidth, cardHeight, card, imgCardMask, false, false) - card.globalCompositeOperation = "source-atop" - //Draws the card image, then... - drawPicture() - //draws the card frame on top - if (transparentBorder == false) { - drawMask(imgBorder, 0, 0, cardWidth, cardHeight, card, imgArtMask, false, false) - } else { - card.drawImage(imgBorder, 0, 0, cardWidth, cardHeight) - } - //draws the set symbol, mana cost, and watermark - drawSetSymbol() - drawManaCost() - drawWatermark() - //writes all the text: name, type, rules... - writeText() - //m15 and 8th edition have different info at the bottom of the cards and require completely different functions - if (m15Info == true) { - bottomInfoM15() - } else if (eighthInfo == true) { - bottomInfo8th() - }else if (planechaseInfo == true) { - bottomInfoPlanechase() - } - //A shiny foil overlay! - if(document.getElementById("checkboxFoil").checked == true) { - card.drawImage(imgFoil, 0, 0, cardWidth, cardHeight) - } - //These are for pinpointing coordinates while adjusting values for new border types - //Vertical Line - // card.beginPath() - // card.moveTo(688, 0) - // card.lineTo(688, 1044) - // card.stroke() - //Horizontal Line - // card.beginPath() - // card.moveTo(0, setSymbolY) - // card.lineTo(749, setSymbolY) - // card.stroke() + //fixes the global alpha just incase... + card.globalAlpha = 1 + //Insures that the corners of the final image are transparent + card.globalCompositeOperation = "source-over" + drawMask(document.getElementById("inputColor").value, 0, 0, cardWidth, cardHeight, card, imgCardMask, false, false) + card.globalCompositeOperation = "source-atop" + //Draws the card image, then... + drawPicture() + //draws the card frame on top + if (transparentBorder == false) { + drawMask(imgBorder, 0, 0, cardWidth, cardHeight, card, imgArtMask, false, false) + } else { + card.drawImage(imgBorder, 0, 0, cardWidth, cardHeight) } + //draws the set symbol, mana cost, and watermark + drawSetSymbol() + drawManaCost() + drawWatermark() + //writes all the text: name, type, rules... + writeText() + //m15 and 8th edition have different info at the bottom of the cards and require completely different functions + if (m15Info == true) { + bottomInfoM15() + } else if (eighthInfo == true) { + bottomInfo8th() + }else if (planechaseInfo == true) { + bottomInfoPlanechase() + } + //A shiny foil overlay! + if(document.getElementById("checkboxFoil").checked == true) { + card.drawImage(imgFoil, 0, 0, cardWidth, cardHeight) + } + //These are for pinpointing coordinates while adjusting values for new border types + //Vertical Line + // card.beginPath() + // card.moveTo(688, 0) + // card.lineTo(688, 1044) + // card.stroke() + //Horizontal Line + // card.beginPath() + // card.moveTo(0, setSymbolY) + // card.lineTo(749, setSymbolY) + // card.stroke() +} //Sets up the initial clock var cardClockInterval = setInterval(cardClock, 1000 / document.getElementById("inputFPS").value) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -934,7 +936,6 @@ function drawWatermark() { drawMask(document.getElementById("watermarkColorSelection").value, x, y, width, height, card, imgWatermark, false, false) } } - card.globalAlpha = 1 } //Mana cost function drawManaCost() {