switch to DOM based variant adding

This commit is contained in:
Harvey Tindall
2021-12-30 23:52:53 +00:00
parent 0f0355fd01
commit acc8892f26
12 changed files with 2506 additions and 742 deletions
+4 -3
View File
@@ -1,4 +1,4 @@
import { toggleTheme, loadTheme } from "./modules/theme.js";
import { nightwind } from "./modules/theme.js";
import { lang, LangFile, loadLangSelector } from "./modules/lang.js";
import { Modal } from "./modules/modal.js";
import { Tabs } from "./modules/tabs.js";
@@ -9,7 +9,8 @@ import { ProfileEditor } from "./modules/profiles.js";
import { _get, _post, notificationBox, whichAnimationEvent, toggleLoader } from "./modules/common.js";
import { Updater } from "./modules/update.js";
loadTheme();
let theme = new nightwind();
const themeButton = document.getElementById('button-theme') as HTMLSpanElement;
const switchThemeIcon = () => {
const icon = themeButton.childNodes[0] as HTMLElement;
@@ -28,7 +29,7 @@ const switchThemeIcon = () => {
}
};
themeButton.onclick = () => {
toggleTheme();
theme.toggle();
switchThemeIcon();
}
switchThemeIcon();