From 53296161399937092f8417ca43f6df16653b88bd Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Fri, 24 Jul 2020 17:32:37 -0700 Subject: [PATCH] restyle --- data/scripts/main.js | 4 ++-- data/scripts/palettes/dayRave.js | 6 ++++-- data/scripts/palettes/nightRave.js | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/data/scripts/main.js b/data/scripts/main.js index 8fb3cc7e..fd26014b 100644 --- a/data/scripts/main.js +++ b/data/scripts/main.js @@ -236,10 +236,10 @@ class cardText { } function scaleX(xToScale) { - return xToScale * cardWidth + return Math.round(xToScale * cardWidth) } function scaleY(yToScale) { - return yToScale * cardHeight + return Math.round(yToScale * cardHeight) } function drawCardObjects() { diff --git a/data/scripts/palettes/dayRave.js b/data/scripts/palettes/dayRave.js index 4ffa8563..ec0995d7 100644 --- a/data/scripts/palettes/dayRave.js +++ b/data/scripts/palettes/dayRave.js @@ -9,7 +9,9 @@ rootStyles.setProperty('--body-background', 'none') setCookie('colorPalette', 'dayRave') //Stops the hue shift when another palette is loaded -document.getElementById('inputColorPalette').addEventListener('change', removeEventListener, false) +if (document.getElementById('inputColorPalette') != null) { + document.getElementById('inputColorPalette').addEventListener('change', removeEventListener, false) +} function removeEventListener() { clearInterval(colorCycle) @@ -17,7 +19,7 @@ function removeEventListener() { } //Shifts the hue -var colorCycle = setInterval(shiftHue, 100) +var colorCycle = setInterval(shiftHue, 200) var currentHueRotation = 0 function shiftHue() { diff --git a/data/scripts/palettes/nightRave.js b/data/scripts/palettes/nightRave.js index 5cbf0d08..42a2995a 100644 --- a/data/scripts/palettes/nightRave.js +++ b/data/scripts/palettes/nightRave.js @@ -9,7 +9,9 @@ rootStyles.setProperty('--body-background', 'none') setCookie('colorPalette', 'nightRave') //Stops the hue shift when another palette is loaded -document.getElementById('inputColorPalette').addEventListener('change', removeEventListener, false) +if (document.getElementById('inputColorPalette') != null) { + document.getElementById('inputColorPalette').addEventListener('change', removeEventListener, false) +} function removeEventListener() { clearInterval(colorCycle) @@ -17,7 +19,7 @@ function removeEventListener() { } //Shifts the hue -var colorCycle = setInterval(shiftHue, 100) +var colorCycle = setInterval(shiftHue, 200) var currentHueRotation = 0 function shiftHue() {