started work on theme selector

This commit is contained in:
AUnicornWithNoLife 2021-07-08 21:18:25 +01:00
parent c2f219316f
commit 3951205c47
3 changed files with 30 additions and 0 deletions

View File

@ -73,6 +73,14 @@
<br>
<button onmousedown="reset();" id='reset'>Reset</button>
<br>
<br>
<br>
<select name="Theme" id="theme-sel">
</select>
</th>
</tr>
</table>

View File

@ -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);

View File

@ -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');
}