aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorKushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com>2021-08-18 00:50:13 -0300
committerKushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com>2021-08-18 00:50:13 -0300
commitd460fa6316d3db4e68e6b4d4c7ee2d02d6505304 (patch)
treeb343013d9754cdaa61d30a407b28e3a01e53356d /static
parent9e782ba01620997becc3118433e3d1961a88b2c3 (diff)
it works
Diffstat (limited to 'static')
-rw-r--r--static/js/themes.js12
-rw-r--r--static/main.html13
2 files changed, 19 insertions, 6 deletions
diff --git a/static/js/themes.js b/static/js/themes.js
index 19bdbb4..3f1b906 100644
--- a/static/js/themes.js
+++ b/static/js/themes.js
@@ -26,5 +26,15 @@ function applyTheme() {
tags[i].disabled = true;
}
}
- setTheme(getCookie("theme") || "default");
+ let theme = getCookie("theme") || "default";
+ setTheme(theme);
+
+ // reflect this in the switcher
+ let switcher = document.getElementById("themeSwitcher");
+ for(var i = 0; i < switcher.options.length; i++) {
+ if (switcher.options[i].value === theme) {
+ switcher.selectedIndex = i;
+ break;
+ }
+ }
}
diff --git a/static/main.html b/static/main.html
index 9a88afc..794a602 100644
--- a/static/main.html
+++ b/static/main.html
@@ -41,11 +41,14 @@
{{ template "bottom" . }}
- <select onchange="setTheme(this.options[this.selectedIndex].value)">
- {{ range .Themes }}
- <option value="{{.}}">{{.}}</option>
- {{ end }}
- </select>
+ <div style="float: right;">
+ Theme:
+ <select id="themeSwitcher" onchange="setTheme(this.options[this.selectedIndex].value)">
+ {{ range .Themes }}
+ <option value="{{.}}">{{.}}</option>
+ {{ end }}
+ </select>
+ </div>
<div align="center" style="width: 500px; margin:0 auto; margin-top: 50px;">
<a href="/">[Home]</a><a href="/static/rules.html">[Rules]</a><a href="/static/faq.html">[FAQ]</a>