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

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)
}
}