Check out some samples!
![]()
@@ -254,12 +325,23 @@
font-family: mplantini;
src: url("data/fonts/mplantin-i.ttf");
}
+/*Color Palette*/
+:root {
+ --title-text-color: rgb(100, 200, 50); /*TITLE*/
+ --main-text-color: rgb(150, 150, 150); /*REGULAR*/
+ --input-text-color: rgb(100, 200, 50); /*INPUTS*/
+ --dark-text-color: rgb(96, 96, 96); /*DARK*/
+ --hover-text-color: rgb(100, 200, 50); /*HOVER*/
+ --section-background-color: rgba(0, 0, 0, 0.5); /*BACKGROUND*/
+ --section-border-color: rgba(128, 255, 128, 0.1); /*BORDER*/
+}
/*Applies to most elements (with rows and columns)*/
* {
text-align: center;
font-family: belerenb;
font-size: 22px;
- color: rgb(128, 128, 128);
+ color: var(--main-text-color);
+ user-select: none;
}
.row {
margin-bottom: 5;
@@ -278,21 +360,21 @@
}
/*Style for sections, togglers, and togglees*/
.section {
- border: 1px solid rgba(128, 255, 128, 0.1);
- background-color: rgba(0, 0, 0, 0.5);
+ border: 1px solid var(--section-border-color);
+ background-color: var(--section-background-color);
padding: 0px;
}
.toggler {
width: 100%;
}
.toggler:hover {
- color: rgb(128, 255, 128);
+ color: var(--hover-text-color);
}
.togglee {
width: 100%;
text-align: left;
border-width: 1px;
- border-color: rgba(128, 255, 128, 0.1);
+ border-color: var(--section-border-color);
border-style: dashed solid solid solid;
display: none;
}
@@ -300,25 +382,48 @@
display: block;
}
/*Specific input element styles*/
-input[type="text"], input[type="number"], textarea {
+.input {
text-align: left;
- color: black;
+ border: none;
+ background-color: var(--section-border-color);
+ color: var(--input-text-color);
width: 99%;
}
input[type="color"] {
+ border: none;
+ background-color: var(--section-border-color);
padding-top: 0px;
padding-bottom: 0px;
}
-select, option {
- color: black;
- width: 100%;
+/*Custom checkboxes!*/
+.checkbox {
+ top: 4px;
+ 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);
+}
+.checkbox input[type=checkbox]:checked + label {
+ background: var(--title-text-color);
+}
+.checkbox input {
+ opacity: 0;
+}
+.checkbox div {
+ white-space: pre;
+ position: absolute;
+ top: -8px;
+ left: 18px;
}
/*List of all mana symbols and their associated codes*/
-#symbolList {
- border: 1px solid rgba(128, 255, 128, 0.1);
- background-color: rgba(0, 0, 0, 0.5);
- padding-bottom: 10px;
-}
#symbolList img {
padding: 0px;
position: relative;
@@ -329,12 +434,17 @@ select, option {
/*Other*/
.title {
text-align: center;
- color: rgb(128,255,128);
+ color: var(--title-text-color);
font-family: belerenbsc;
font-size: 60px;
+ position: sticky;
+ top: 0px;
+ z-index: 1;
+ background-color: var(--section-background-color);
+ border: 1px solid var(--section-border-color);
}
.info, .info * {
- color: rgb(96,96,96);
+ color: var(--dark-text-color);
font-family: belerenbsc;
font-size: 16px;
}
@@ -347,16 +457,16 @@ html {
}
/*Hyperlinks*/
a:link {
- color: rgb(128,128,128);
+ color: var(--main-text-color);
}
a:visited {
- color: rgb(128,128,128);
+ color: var(--main-text-color);
}
a:hover {
- color: rgb(128,255,128);
+ color: var(--hover-text-color);
}
a:active {
- color: rgb(128,255,128);
+ color: var(--hover-text-color);
}
@@ -757,7 +867,7 @@ function drawPicture() {
//Draw Set Symbol
function drawSetSymbol() {
//scales the set symbol so that it fits in the correct area and centers it
- if (imgSetSymbol.src != "" && document.getElementById("checkboxSetSymbol").checked == true) {
+ if (imgSetSymbol.width > 0 && document.getElementById("checkboxSetSymbol").checked == true) {
var height = setSymbolHeight
var width = imgSetSymbol.width * (height / imgSetSymbol.height)
if (width > setSymbolWidth) {
@@ -1019,7 +1129,6 @@ function drawText(text, xCoord, yCoord) {
//Make things go back to normal :)
card.textAlign="left"
}
-
//Toggles the visibility of predetermined sections of the input boxes
function toggleSection(target) {
for (i = 0; i < target.parentElement.parentElement.childNodes.length; i++) {
@@ -1030,7 +1139,6 @@ function toggleSection(target) {
}
target.parentElement.childNodes[3].classList.toggle("shown")
}
-
//Resizes anything that may need to be resized
function resizeThings() {
if (window.innerWidth > 809 + 300 && cardWidth <= 749) {
@@ -1051,27 +1159,16 @@ function resizeThings() {
}
document.getElementById("symbolList").innerHTML = symbolList
}
-
-//Loads the set symbol from my seperate repository
+//Loads the set symbol from the gatherer site
function loadSetSymbol() {
- imgSetSymbol.crossOrigin = "Anonymous"
- imgSetSymbol.src = "https://raw.githubusercontent.com/ImKyle4815/MTG-Set-Symbols/master/setSymbols/" + document.getElementById("setSymbolCode").value.toUpperCase() + "_" + document.getElementById("setSymbolRarity").value.toUpperCase() + ".png"
+ imgSetSymbol.cropped = false
+ imgSetSymbol.src = "https://cors-anywhere.herokuapp.com/http://gatherer.wizards.com/Handlers/Image.ashx?type=symbol&set=" + document.getElementById("setSymbolCode").value.toUpperCase() + "&size=large&rarity=" + document.getElementById("setSymbolRarity").value.toUpperCase()
}
-
//Loads an image from URL
function imageURL(input, targetImage) {
targetImage.cropped = false
targetImage.src = "https://cors-anywhere.herokuapp.com/" + input.value
}
-
-//Best for last - downloads the image!
-function downloadCardImage(linkElement) {
- var cardImageData = canvas.toDataURL()
- if (cardImageData == undefined) {
- alert("Sorry, it seems that you cannot download your card. Please try using a different browser/device.")
- }
- linkElement.href = cardImageData
-}
//Randomizes the sample cards at the bottom of the page. Runs it here too
randomizeSampleCards(6)
function randomizeSampleCards(count) {
@@ -1087,5 +1184,13 @@ function randomizeSampleCards(count) {
document.getElementById("sampleCardB").src = "sampleCards/sample-card-" + cardNumbers[1] + ".png"
document.getElementById("sampleCardC").src = "sampleCards/sample-card-" + cardNumbers[2] + ".png"
}
+//Best for last - downloads the image!
+function downloadCardImage(linkElement) {
+ var cardImageData = canvas.toDataURL()
+ if (cardImageData == undefined) {
+ alert("Sorry, it seems that you cannot download your card. Please try using a different browser/device.")
+ }
+ linkElement.href = cardImageData
+}
-
+
\ No newline at end of file