diff --git a/public/dark.module.css b/public/dark.css similarity index 100% rename from public/dark.module.css rename to public/dark.css diff --git a/public/index.html b/public/index.html index ffd429f..90142d9 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,8 @@ - + + diff --git a/public/light.module.css b/public/light.css similarity index 100% rename from public/light.module.css rename to public/light.css diff --git a/public/main.js b/public/main.js index becf214..b8fde47 100644 --- a/public/main.js +++ b/public/main.js @@ -1,8 +1,6 @@ -import * as light from './light.module.css'; -import * as dark from './dark.module.css'; document.addEventListener('DOMContentLoaded', function () { loading() - var hold, external, timeout, ac, last + var hold, external, timeout, ac, last, darklight = document.getElementById('darkcss').getAttribute('href') document.getElementById('instance').addEventListener('keydown', function (event) { if (event.key && !event.ctrlKey && !event.altKey && !event.shiftKey) { if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) { @@ -130,12 +128,12 @@ document.addEventListener('DOMContentLoaded', function () { event.preventDefault() event.stopPropagation() }) - document.getElementById('darklight').addEventListener('click', function(event) { - if(event.target.innerText === '☼') { - document.getElementById('css').setAttribute('href', light.meta.url) + document.getElementById('darklight').addEventListener('click', function (event) { + if (event.target.innerText === '☼') { + document.getElementById('darkcss').setAttribute('href', '') event.target.innerText = '☽' } else { - document.getElementById('css').setAttribute('href', dark.meta.url) + document.getElementById('darkcss').setAttribute('href', darklight) event.target.innerText = '☼' } })