mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
miniplane
This commit is contained in:
BIN
data/borders/miniPlane/artMask.png
Normal file
BIN
data/borders/miniPlane/artMask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
78
data/borders/miniPlane/border.js
Normal file
78
data/borders/miniPlane/border.js
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
//============================================//
|
||||||
|
// Miniplane Border //
|
||||||
|
//============================================//
|
||||||
|
//General Booleans
|
||||||
|
cardData.miracle = false
|
||||||
|
cardData.nyx = false
|
||||||
|
cardData.legendary = false
|
||||||
|
cardData.creature = false
|
||||||
|
cardData.rulesBox = false
|
||||||
|
cardData.pinline = false
|
||||||
|
cardData.titleTypeBoxes = false
|
||||||
|
cardData.rareStamp = false
|
||||||
|
//Specific Values
|
||||||
|
cardData.manaSymbolDirection = "none"
|
||||||
|
cardData.titleAlignment = "center"
|
||||||
|
cardData.titleX = cardWidth / 2
|
||||||
|
cardData.titleY = cheight(95)
|
||||||
|
cardData.titleFontSize = cwidth(42)
|
||||||
|
cardData.titleRight = cwidth(1000)
|
||||||
|
cardData.typeAlignment = "center"
|
||||||
|
cardData.typeX = cardWidth / 2
|
||||||
|
cardData.typeY = cheight(735)
|
||||||
|
cardData.typeFontSize = cwidth(32)
|
||||||
|
cardData.textX = cwidth(105)
|
||||||
|
cardData.textY = cheight(780)
|
||||||
|
cardData.textRight = cwidth(660)
|
||||||
|
cardData.setSymbolY = cheight(727)
|
||||||
|
cardData.setSymbolWidth = cwidth(55)
|
||||||
|
cardData.setSymbolHeight = cheight(33)
|
||||||
|
cardData.setSymbolX = cwidth(582)
|
||||||
|
cardData.watermarkWidth = cwidth(660)
|
||||||
|
cardData.watermarkHeight = cheight(210)
|
||||||
|
cardData.watermarkY = cheight(864)
|
||||||
|
cardData.cardArtX = cwidth(28)
|
||||||
|
cardData.cardArtY = cheight(46)
|
||||||
|
cardData.bottomInfoFunction = "bottomInfoPlanechase"
|
||||||
|
//Images
|
||||||
|
imgArtMask.load("data/borders/miniplane/imgArtMask.png")
|
||||||
|
imgFrameMask.load("data/borders/miniplane/imgFrameMask.png")
|
||||||
|
imgBorderMask.load("data/borders/miniplane/imgBorderMask.png")
|
||||||
|
//Loads the Colors
|
||||||
|
loadColors("white-White")
|
||||||
|
//Runs the things!
|
||||||
|
sectionTextFunction()
|
||||||
|
sectionFrameFunction()
|
||||||
|
sectionOtherFunction()
|
||||||
|
|
||||||
|
function bottomInfoPlanechase() {
|
||||||
|
var infoNumber = document.getElementById("inputInfoNumber").value
|
||||||
|
var infoRarity = document.getElementById("inputInfoRarity").value
|
||||||
|
var infoSet = document.getElementById("inputInfoSet").value
|
||||||
|
var infoLanguage = document.getElementById("inputInfoLanguage").value
|
||||||
|
var infoArtist = document.getElementById("inputInfoArtist").value
|
||||||
|
var infoCopyright = "CC \u2014 " + document.getElementById("inputInfoCopyright").value
|
||||||
|
if (infoCopyright == "CC \u2014 secretcode") {
|
||||||
|
var date = new Date()
|
||||||
|
var year = date.getFullYear()
|
||||||
|
infoCopyright = "\u2122 & \u00a9 " + year + " Wizards of the Coast"
|
||||||
|
} else if (infoCopyright == "CC \u2014 ") {
|
||||||
|
infoCopyright = ""
|
||||||
|
}
|
||||||
|
var infoNumberSetLanguage = infoNumber + " " + infoSet + " \u00b7 " + infoLanguage + " "
|
||||||
|
textContext.fillStyle = "white"
|
||||||
|
textContext.font = cheight(15) + "px gothammedium"
|
||||||
|
var infoNumberSetLanguageWidth = textContext.measureText(infoNumberSetLanguage).width
|
||||||
|
textContext.font = cheight(16) + "px mplantin"
|
||||||
|
var infoCopyrightWidth = textContext.measureText(infoCopyright).width
|
||||||
|
var bottomLineStart = cardWidth / 2 - (infoNumberSetLanguageWidth + infoCopyrightWidth) / 2
|
||||||
|
textContext.fillText(infoCopyright, bottomLineStart + infoNumberSetLanguageWidth, cheight(1029))
|
||||||
|
textContext.font = cheight(15) + "px gothammedium"
|
||||||
|
textContext.fillText(infoNumberSetLanguage, bottomLineStart, cheight(1029))
|
||||||
|
textContext.font = cheight(19) + "px belerenbsc"
|
||||||
|
var infoArtistStart = cardWidth / 2 - (textContext.measureText(infoArtist).width + cwidth(23)) / 2
|
||||||
|
imgArtistBrush.load("none", infoArtistStart, cheight(995), cwidth(21), cheight(13))
|
||||||
|
textContext.mask(imgArtistBrush, "none", textContext.fillStyle)
|
||||||
|
textContext.fillText(infoArtist, infoArtistStart + cwidth(23), cheight(1008))
|
||||||
|
drawCard()
|
||||||
|
}
|
BIN
data/borders/miniPlane/imgArtMask.png
Normal file
BIN
data/borders/miniPlane/imgArtMask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
BIN
data/borders/miniPlane/imgBorderMask.png
Normal file
BIN
data/borders/miniPlane/imgBorderMask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.0 KiB |
BIN
data/borders/miniPlane/imgFrameMask.png
Normal file
BIN
data/borders/miniPlane/imgFrameMask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
90
data/borders/miniPlane/old.js
Normal file
90
data/borders/miniPlane/old.js
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
//Mini Plane Border
|
||||||
|
//Anything to do with...
|
||||||
|
//Loading Images
|
||||||
|
imgFrameMask.src = borderPath + "frameMask.png"
|
||||||
|
imgBorderMask.src = borderPath + "borderMask.png"
|
||||||
|
//Card Size
|
||||||
|
//Card Title
|
||||||
|
var titleFont = cardHeight * 0.04 + "px belerenb" //34
|
||||||
|
var titleFontSpacing = cardWidth * 0.00014 + "px" //0.15
|
||||||
|
var titleX = cardWidth * 0.5000 //522
|
||||||
|
var titleY = cardHeight * 0.0614 //46
|
||||||
|
var titleAlign = "center"
|
||||||
|
//Mana Cost
|
||||||
|
var manaCostRadius = 0
|
||||||
|
var manaCostX = 0
|
||||||
|
var manaCostY = 0
|
||||||
|
//Card Type
|
||||||
|
var typeFont = cardHeight * 0.03 + "px belerenb" //26
|
||||||
|
var typeFontSpacing = "0px" //0
|
||||||
|
var typeX = cardWidth * 0.5000 //522
|
||||||
|
var typeY = cardHeight * 0.675 //508
|
||||||
|
var typeAlign = "center"
|
||||||
|
//Rules/Flavor Text
|
||||||
|
var textFont = "px mplantin"
|
||||||
|
var textFontSpacing = cardWidth * 0.0002 //0.2
|
||||||
|
var textX = cardWidth * 0.14 //124
|
||||||
|
var textY = cardHeight * 0.7223 //541
|
||||||
|
var textWidth = cardWidth * 0.87 //925
|
||||||
|
//Set Symbol
|
||||||
|
var setSymbolY = cardHeight * 0.6929 //519
|
||||||
|
var setSymbolRight = cardWidth * 0.776 //814
|
||||||
|
var setSymbolWidth = cardWidth * 0.0402 //42
|
||||||
|
var setSymbolHeight = cardHeight * 0.0320 //24
|
||||||
|
//Watermark
|
||||||
|
var watermarkWidth = cardWidth * 0.8787 //920
|
||||||
|
var watermarkHeight = cardHeight * 0.2000 //150
|
||||||
|
var watermarkY = cardHeight * 0.8225 //616
|
||||||
|
//Color Options
|
||||||
|
loadColors("white-Regular")
|
||||||
|
document.getElementById("secondColorSelection").innerHTML = document.getElementById("colorSelection").innerHTML
|
||||||
|
document.getElementById("thirdColorSelection").innerHTML = document.getElementById("colorSelection").innerHTML
|
||||||
|
//Other
|
||||||
|
var creatureBorder = false
|
||||||
|
var thirdBorder = false
|
||||||
|
var secondBorder = false
|
||||||
|
var artX = cardWidth * 0.0316 //33
|
||||||
|
var artY = cardHeight * 0.0441 //33
|
||||||
|
transparentBorder = true
|
||||||
|
//With all the new values in place, the program will update it's border images
|
||||||
|
finishTemplate()
|
||||||
|
//Any special functions go at the bottom
|
||||||
|
var uniqueFunctionName = "bottomInfoPlanechase"
|
||||||
|
function bottomInfoPlanechase() {
|
||||||
|
card.textAlign = "left"
|
||||||
|
card.fillStyle = document.getElementById("inputInfoColor").value
|
||||||
|
var bottomLineFirst = document.getElementById("inputNumber").value + " " + document.getElementById("inputSet").value + " \u00b7 " + document.getElementById("inputLanguage").value
|
||||||
|
var bottomLineSecond = document.getElementById("inputInfo").value
|
||||||
|
if (bottomLineSecond != "") {
|
||||||
|
if (bottomLineSecond == "secretcode") {
|
||||||
|
var date = new Date()
|
||||||
|
var year = date.getFullYear()
|
||||||
|
bottomLineSecond = "\u2122 & \u00a9 " + year + " Wizards of the Coast"
|
||||||
|
} else {
|
||||||
|
bottomLineSecond = "CC \u2014 " + document.getElementById("inputInfo").value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var artist = document.getElementById("inputArtist").value
|
||||||
|
//Artist
|
||||||
|
canvas.style.letterSpacing = cardWidth * -0.0002 + "px" //-0.2
|
||||||
|
card.font = "20px matrixbsc" //16
|
||||||
|
var artistLineWidth = (card.measureText(artist).width + cardWidth * 0.01724) / 2 //18
|
||||||
|
imgArtistBrush.imgValues(cardWidth / 2 - artistLineWidth, cardHeight * 0.9455, cardWidth * 0.0285, cardHeight * 0.013)
|
||||||
|
card.mask("imgArtMask,source-over", imgArtistBrush, card.fillStyle)
|
||||||
|
card.fillText(artist, cardWidth / 2 - artistLineWidth + cardWidth * 0.028, cardHeight * 0.9445 + textBaselineShift[0] * card.font.split("px")[0]) //18, 710
|
||||||
|
//Left and Right side
|
||||||
|
canvas.style.letterSpacing = "0px"
|
||||||
|
card.font = cardHeight * 0.016 + "px relaymedium" //14
|
||||||
|
var firstWidth = card.measureText(bottomLineFirst).width + cardWidth * 0.0144 //15
|
||||||
|
canvas.style.letterSpacing = cardWidth * -0.0007 + "px" //-0.7
|
||||||
|
card.font = cardHeight * 0.016 + "px mplantin" //14
|
||||||
|
var secondWidth = card.measureText(bottomLineSecond).width
|
||||||
|
|
||||||
|
canvas.style.letterSpacing = "0px"
|
||||||
|
card.font = cardHeight * 0.016 + "px relaymedium" //14
|
||||||
|
card.fillText(bottomLineFirst, cardWidth / 2 - ((secondWidth + firstWidth) / 2) - cardWidth * 0.0077, cardHeight * 0.9666 + textBaselineShift[0] * card.font.split("px")[0]) //8, 724
|
||||||
|
|
||||||
|
canvas.style.letterSpacing = cardWidth * -0.0007 + "px" //-0.7
|
||||||
|
card.font = cardHeight * 0.016 + "px mplantin" //14
|
||||||
|
card.fillText(bottomLineSecond, cardWidth / 2 - ((secondWidth + firstWidth) / 2) + firstWidth - cardWidth * 0.0077, cardHeight * 0.9666 + textBaselineShift[0] * card.font.split("px")[0]) //8, 724
|
||||||
|
}
|
BIN
data/borders/miniPlane/white/frame.png
Normal file
BIN
data/borders/miniPlane/white/frame.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 376 KiB |
35
data/main.js
35
data/main.js
@@ -44,7 +44,8 @@ var defaultCardData = {
|
|||||||
cardArtX:cwidth(58), cardArtY:cheight(118),
|
cardArtX:cwidth(58), cardArtY:cheight(118),
|
||||||
miracle:true, nyx:true, legendary:true, creature:true, rulesBox:true, pinline:true, rareStamp:true, titleTypeBoxes:true,
|
miracle:true, nyx:true, legendary:true, creature:true, rulesBox:true, pinline:true, rareStamp:true, titleTypeBoxes:true,
|
||||||
transparency:false,
|
transparency:false,
|
||||||
specialImageA:false, specialImageB:false
|
specialImageA:false, specialImageB:false,
|
||||||
|
bottomInfoFunction:"bottomInfoM15"
|
||||||
}
|
}
|
||||||
var cardData = {}
|
var cardData = {}
|
||||||
Object.assign(cardData, defaultCardData)
|
Object.assign(cardData, defaultCardData)
|
||||||
@@ -614,7 +615,14 @@ function sectionTextFunction() {
|
|||||||
textContext.fillText(document.getElementById("inputPowerToughness").value, cardData.ptX, cardData.ptY)
|
textContext.fillText(document.getElementById("inputPowerToughness").value, cardData.ptX, cardData.ptY)
|
||||||
textContext.textAlign = "left"
|
textContext.textAlign = "left"
|
||||||
}
|
}
|
||||||
//and all the rest (bottom info stuff)
|
if (cardData.bottomInfoFunction != "none") {
|
||||||
|
window[cardData.bottomInfoFunction]()
|
||||||
|
} else {
|
||||||
|
drawCard()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function bottomInfoM15() {
|
||||||
var infoNumber = document.getElementById("inputInfoNumber").value
|
var infoNumber = document.getElementById("inputInfoNumber").value
|
||||||
var infoRarity = document.getElementById("inputInfoRarity").value
|
var infoRarity = document.getElementById("inputInfoRarity").value
|
||||||
var infoSet = document.getElementById("inputInfoSet").value
|
var infoSet = document.getElementById("inputInfoSet").value
|
||||||
@@ -653,7 +661,6 @@ function sectionTextFunction() {
|
|||||||
}
|
}
|
||||||
textContext.fillText(infoCopyright, 700, copyrightY)
|
textContext.fillText(infoCopyright, 700, copyrightY)
|
||||||
textContext.textAlign = "left"
|
textContext.textAlign = "left"
|
||||||
drawCard()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sectionOtherFunction() {
|
function sectionOtherFunction() {
|
||||||
@@ -953,21 +960,27 @@ function getCookie(cookieName) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
function checkCookies() {
|
function checkCookies() {
|
||||||
if (getCookie("visited") != "true") {
|
if (getCookie("visited") != true) {
|
||||||
if (isMobile == true) {
|
if (isMobile == true) {
|
||||||
alert("Thanks for using Card Conjurer! Unfortunately some users have been experiencing difficulty on mobile devices when uploading pictures they took on that mobile device. An easy solution is to quickly edit that picture by cropping it slightly. Otherwise, images from URLs and other sources should work normally.")
|
alert("Thanks for using Card Conjurer! Unfortunately some users have been experiencing difficulty on mobile devices when uploading pictures they took on that mobile device. An easy solution is to quickly edit that picture by cropping it slightly. Otherwise, images from URLs and other sources should work normally.")
|
||||||
} else if (isChrome == false) {
|
} else if (isChrome == false) {
|
||||||
alert("Thanks for using Card Conjurer! Unfortunately different browsers treat custom fonts differently and it appears that you are using a browser other than Chrome. Everything may work perfectly, but if you notice that the text looks odd try switching to Chrome.")
|
alert("Thanks for using Card Conjurer! Unfortunately different browsers treat custom fonts differently and it appears that you are using a browser other than Chrome. Everything may work perfectly, but if you notice that the text looks odd try switching to Chrome.")
|
||||||
}
|
}
|
||||||
setCookie("visited", "true")
|
setCookie("visited", true)
|
||||||
} else {
|
} else {
|
||||||
console.log("Welcome back to Card Conjurer!")
|
console.log("Welcome back to Card Conjurer!")
|
||||||
}
|
if (getCookie("updated_2") != true) {
|
||||||
if (getCookie("updated_1") != "true") {
|
alert("Card Conjurer has been updated since your last visit. After reworking the system I haven't had time to add all the old border styles back, but feel free to contact me at CardConjurerMTG@gmail.com if you would like to request a border style or have any questions. \r\n\r\nNewest border style: Mini-Plane")
|
||||||
alert("Card Conjurer has been updated since your last visit. After reworking the system I haven't had time to add all the old border styles back, but feel free to contact me at CardConjurerMTG@gmail.com if you would like to request a border style or have any questions. \r\n\r\nNewest border style: Planeswalker (M15)")
|
setCookie("updated_1", true)
|
||||||
setCookie("updated_1", "true")
|
|
||||||
} else {
|
} else {
|
||||||
console.log("There are no new updates since your last visit.")
|
console.log("There are no new updates since your last visit.")
|
||||||
|
if (getCookie("donationRequest") != true) {
|
||||||
|
alert("Card Conjurer is now hosted with the custom domain cardconjurer.com! That means that running this website currently costs $10 per year. It's not much, but any donation, even if it's just dollar, would be greatly appreciated :) \r\n\r\nAnyways, thanks for using Card Conjurer! I hope you enjoy making some sweet custom Magic cards!")
|
||||||
|
setCookie("donationRequest", true)
|
||||||
|
} else {
|
||||||
|
console.log("I hope you enjoy making custom cards!")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -990,9 +1003,9 @@ loadScript("data/other/setCodeList.js")
|
|||||||
setTimeout(function(){sectionTextFunction()}, 250)
|
setTimeout(function(){sectionTextFunction()}, 250)
|
||||||
setTimeout(function(){sectionTextFunction()}, 500)
|
setTimeout(function(){sectionTextFunction()}, 500)
|
||||||
setTimeout(function(){sectionTextFunction()}, 1000)
|
setTimeout(function(){sectionTextFunction()}, 1000)
|
||||||
//Only for working on frames n' stuff :)
|
// Only for working on frames n' stuff :)
|
||||||
// setTimeout(function(){
|
// setTimeout(function(){
|
||||||
// document.getElementById("inputCardVersion").value = "planeswalker"
|
// document.getElementById("inputCardVersion").value = "miniplane"
|
||||||
// document.getElementById("inputCardVersion").onchange()
|
// document.getElementById("inputCardVersion").onchange()
|
||||||
// }, 500)
|
// }, 500)
|
||||||
|
|
||||||
|
@@ -89,6 +89,7 @@
|
|||||||
<span class="dropdown">
|
<span class="dropdown">
|
||||||
<select onchange="backToDefault(this.value)" id="inputCardVersion">
|
<select onchange="backToDefault(this.value)" id="inputCardVersion">
|
||||||
<option value="m15">M15</option>
|
<option value="m15">M15</option>
|
||||||
|
<option value="miniplane">Mini-Plane</option>
|
||||||
<option value="planeswalker">Planeswalker (M15)</option>
|
<option value="planeswalker">Planeswalker (M15)</option>
|
||||||
<option value="fullArtLandM15">Full Art Land (M15)</option>
|
<option value="fullArtLandM15">Full Art Land (M15)</option>
|
||||||
<option value="fullArtLandUnstable">Full Art Land (Unstable)</option>
|
<option value="fullArtLandUnstable">Full Art Land (Unstable)</option>
|
||||||
|
Reference in New Issue
Block a user