From 70755cc2de001b691d285aceed008341c30b307c Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 6 Oct 2024 02:17:19 +0200 Subject: [PATCH] css darklight --- public/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/main.js b/public/main.js index e3e6ad3..ae1d16c 100644 --- a/public/main.js +++ b/public/main.js @@ -1,3 +1,5 @@ +import * as light from './light.css'; +import * as dark from './main.css'; document.addEventListener('DOMContentLoaded', function () { loading() var hold, external, timeout, ac, last @@ -130,10 +132,10 @@ document.addEventListener('DOMContentLoaded', function () { }) document.getElementById('darklight').addEventListener('click', function(event) { if(event.target.innerText === '☼') { - document.getElementById('css').setAttribute('href', 'light.css') + document.getElementById('css').setAttribute('href', light.meta.url) event.target.innerText = '☽' } else { - document.getElementById('css').setAttribute('href', 'main.css') + document.getElementById('css').setAttribute('href', dark.meta.url) event.target.innerText = '☼' } })