From 3951205c477426381d0fe3c4e3587d1ffc2392b9 Mon Sep 17 00:00:00 2001 From: AUnicornWithNoLife Date: Thu, 8 Jul 2021 21:18:25 +0100 Subject: [PATCH] started work on theme selector --- src/index.html | 8 ++++++++ src/theme.js | 17 +++++++++++++++++ src/var.js | 5 +++++ 3 files changed, 30 insertions(+) diff --git a/src/index.html b/src/index.html index 71dc5d6..fbd3084 100755 --- a/src/index.html +++ b/src/index.html @@ -73,6 +73,14 @@
+ +
+
+
+ + diff --git a/src/theme.js b/src/theme.js index a0beafc..13e4971 100755 --- a/src/theme.js +++ b/src/theme.js @@ -18,6 +18,23 @@ const themes = 'greyscale': new theme('#000000', '#555555', '#AAAAAA', '#FFFFFF', '#CCCCCC', '#333333', '#CCCCCC') } +const themenames = +[ + 'orange', + 'greyscale' +] + +function setupTheme() +{ + themenames.forEach(function(val) + { + var option = document.createElement("option"); + option.text = val; + + themesel.add(option); + }); +} + function setTheme(name) { root.style.setProperty('--theme-back', themes[name].back); diff --git a/src/var.js b/src/var.js index 109bee5..db2f2b4 100755 --- a/src/var.js +++ b/src/var.js @@ -6,6 +6,7 @@ var ptm; var tabloid; var gamemode; var root; +var themesel function load() { @@ -61,6 +62,8 @@ function load() gamemode = 1; + themesel = document.getElementById('theme-sel'); + root = document.documentElement; info['go'].innerHTML = "X's Go"; @@ -70,5 +73,7 @@ function load() function setup() { + setupTheme(); + setTheme('orange'); } \ No newline at end of file