upgrayedd

This commit is contained in:
Kyle
2020-03-27 13:30:22 -07:00
parent 73b1de2b74
commit 583c617392
15 changed files with 144 additions and 149 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 KiB

View File

@@ -1,3 +1,5 @@
let rootStyles = document.documentElement.style
function setCookie(cookieName, cookieValue, cookieTime = (5 * 365 * 24 * 60 * 60 * 1000)) { //years*days*hours*minutes*seconds*milliseconds
var tempDate = new Date()
tempDate.setTime(tempDate.getTime() + cookieTime)
@@ -21,4 +23,13 @@ function checkCookies() {
if (getCookie('colorPalette') != undefined) {
loadScript('data/scripts/' + getCookie('colorPalette') + '.js')
}
}
function loadScript(scriptPath){
var script = document.createElement('script')
script.setAttribute('type','text/javascript')
script.setAttribute('src', scriptPath)
if (typeof script != 'undefined') {
document.getElementsByTagName('head')[0].appendChild(script)
}
}

View File

@@ -19,7 +19,6 @@ manaSymbolCodeList.forEach((item, index) => {manaSymbolImageList[index] = new Im
date = new Date()
var cornerCutout = new Image()
cornerCutout.src = 'data/images/cornerCutout.png'
let rootStyles = document.documentElement.style
function newCanvas(name) {
window[name + 'Canvas'] = document.createElement('canvas')
@@ -434,9 +433,11 @@ function writeText(textObjectList, targetContext) {
} else if (possibleCodeLower.includes('right')) {
textX += parseInt(possibleCodeLower.replace('right', ''))
currentLineWidth += parseInt(possibleCodeLower.replace('right', ''))
permanentLineShift += parseInt(possibleCodeLower.replace('right', ''))
} else if (possibleCodeLower.includes('left')) {
textX -= parseInt(possibleCodeLower.replace('left', ''))
currentLineWidth -= parseInt(possibleCodeLower.replace('left', ''))
permanentLineShift -= parseInt(possibleCodeLower.replace('left', ''))
} else if (possibleCodeLower.includes('up')) {
finishLine = true
paragraphSpace -= parseInt(possibleCodeLower.replace('up', '')) + textSize
@@ -685,38 +686,23 @@ function inputCardNameNumberTextImport(index) {
} else {
importText('', 'Power Toughness')
}
/*
if (importCardTextResponse.includes('"loyalty":"') && version.currentVersion == 'planeswalker') {
if (importCardTextResponse.includes('"loyalty":"') && currentVersion == 'planeswalker') {
importText(beforeAfter(importCardTextResponse, '"loyalty":"', '",'), 'Loyalty')
var abilityList = beforeAfter(importCardTextResponse, '"oracle_text":"', '",').replace(/ \\"/g, ' \u201C').replace(/\\"/g, '\u201D').split(/\\n/g)
for (var i = 0; i < abilityList.length; i++) {
var stringVersion = ''
switch(i) {
case 3:
stringVersion = 'Fourth'
break;
case 2:
stringVersion = 'Third'
break;
case 1:
stringVersion = 'Second'
break;
default:
stringVersion = 'First'
}
if (abilityList[i].slice(0, 4).includes(':')) {
importText(abilityList[i].split(/: (.+)?/)[1], stringVersion + ' Ability')
importText(abilityList[i].split(/: (.+)?/)[1], 'Ability ' + (i+1))
document.getElementById('inputPlaneswalker' + (i + 1) + 'Icon').value = abilityList[i].split(/: (.+)?/)[0]
} else {
importText('{left24}' + abilityList[i], stringVersion + ' Ability')
importText('{left' + parseInt(scaleX(24/750)) + '}' + abilityList[i], 'Ability ' + (i+1))
document.getElementById('inputPlaneswalker' + (i + 1) + 'Icon').value = ''
}
if (document.getElementById('inputPlaneswalker' + (i + 1)).value < 1) {
document.getElementById('inputPlaneswalker' + (i + 1)).value = 1
}
}
planeswalkerAbilities()
}
*/
document.getElementById('inputManaCost').value = beforeAfter(importCardTextResponse, '"mana_cost":"', '",')
document.getElementById('inputCardArtName').value = beforeAfter(importCardTextResponse, '"name":"', '",')
document.getElementById('inputSetCode').value = beforeAfter(importCardTextResponse, '"set":"', '",')
@@ -752,7 +738,7 @@ function toggleTabs(clickedElement, targetId) {
function downloadCardImage(linkElement) {
if (document.getElementById("inputInfoArtist").value.replace(/ /g, "") != "") {
linkElement.download = cardTextList[0].name.toLowerCase().replace(/ /g, "_") + ".png"
linkElement.download = cardTextList[0].text.toLowerCase().replace(/ /g, "_") + ".png"
if (linkElement.download == ".png") {
linkElement.download = "card.png"
}
@@ -767,15 +753,6 @@ function downloadCardImage(linkElement) {
linkElement.href = cardImageData
}
function loadScript(scriptPath){
var script = document.createElement('script')
script.setAttribute('type','text/javascript')
script.setAttribute('src', scriptPath)
if (typeof script != 'undefined') {
document.getElementsByTagName('head')[0].appendChild(script)
}
}
function hideFrameImages(frameClass) {
Array.from(document.getElementById('framePicker').children).forEach(element => {
if (!element.classList.contains(frameClass)) {

59
data/scripts/raveMode.js Normal file
View File

@@ -0,0 +1,59 @@
rootStyles.setProperty('--background-color', '#1c1c1c')
rootStyles.setProperty('--background-color-contrast', '#111')
rootStyles.setProperty('--interactable-color', '#333')
rootStyles.setProperty('--interactable-selected-color', '#555')
rootStyles.setProperty('--input-color', '#3a3a3a')
rootStyles.setProperty('--font-color', '#fff')
rootStyles.setProperty('--font-color-contrast', '#eee')
rootStyles.setProperty('--body-background', 'url(images/lowpoly.png)')
setCookie('colorPalette', 'darkMode')
//Cycles through a rainbow!
if (currentColorIndex == undefined) {
document.getElementById('inputColorPalette').addEventListener('change', function() {
clearInterval(raveMode)
})
}
var raveMode = setInterval(changeColor, 250)
var regularAdjust = 0//60
var lightAdjust = 64//100
var lightLead = 255
var currentColorIndex = 0
function changeColor() {
var colors = indexToColor(currentColorIndex)
var lightColors = indexToColor(currentColorIndex + lightLead)
rootStyles.setProperty('--background-color', 'linear-gradient(to bottom right, ' + "rgb(" + parseInt(colors[0] + regularAdjust) + "," + parseInt(colors[1] + regularAdjust) + "," + parseInt(colors[2] + regularAdjust) + ")" + ', ' + "rgb(" + parseInt(lightColors[0] + lightAdjust) + "," + parseInt(lightColors[1] + lightAdjust) + "," + parseInt(lightColors[2] + lightAdjust) + ")" + ')')
currentColorIndex += 2.5 * 153 / 180 //The second number is how many seconds it takes to do a full loop
}
function indexToColor(colorIndex) {
var red = 0, green = 0, blue = 0
var realColorIndex = colorIndex - Math.floor(colorIndex / 1530) * 1530
var colorStage = Math.floor(realColorIndex / 255)
switch(colorStage) {
case 0:
green = 255
red = realColorIndex - Math.floor(realColorIndex / 255) * 255
break
case 1:
red = 255
green = 255 - realColorIndex + Math.floor(realColorIndex / 255) * 255
break
case 2:
red = 255
blue = realColorIndex - Math.floor(realColorIndex / 255) * 255
break
case 3:
blue = 255
red = 255 - realColorIndex + Math.floor(realColorIndex / 255) * 255
break
case 4:
blue = 255
green = realColorIndex - Math.floor(realColorIndex / 255) * 255
break
case 5:
green = 255
blue = 255 - realColorIndex + Math.floor(realColorIndex / 255) * 255
break
}
return [red, green, blue]
}

View File

@@ -60,6 +60,7 @@ if (!loadedVersions.includes('planeswalker')) {
var lightColor = 'white'
var planeswalkerLightToDark = new Image()
var planeswalkerDarkToLight = new Image()
planeswalkerDarkToLight.onload = function(){planeswalkerAbilities()}
}
if (currentVersion != 'planeswalker') {
@@ -228,5 +229,4 @@ function invertPlaneswalkerColors() {
planeswalkerLightToDark.src = lightToDarkPlaneswalker.src
planeswalkerDarkToLight.src = darkToLightPlaneswalker.src
}
planeswalkerAbilities();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

View File

@@ -48,7 +48,7 @@
}
html {
font: 20pt roboto;
font: 20pt georgia;
background: var(--background-color);
color: var(--font-color);
background-attachment: fixed;
@@ -300,7 +300,7 @@ input[type='checkbox'], select, option, input[type='file'], button {
padding: 2rem;
background: var(--background-color-contrast);
color: var(--font-color-contrast);
font: 0.6rem 'open sans';
font: 0.6rem arial;
display: grid;
grid-template-columns: auto auto auto;
}
@@ -308,7 +308,8 @@ input[type='checkbox'], select, option, input[type='file'], button {
.fiveSampleCards {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
margin: 2rem 0;
margin-top: 1rem;
margin-bottom: 3rem;
}
.fiveSampleCards > div > img {
position: relative;