diff options
Diffstat (limited to 'target/doc/theme.js')
-rw-r--r-- | target/doc/theme.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/target/doc/theme.js b/target/doc/theme.js new file mode 100644 index 0000000..6515f81 --- /dev/null +++ b/target/doc/theme.js @@ -0,0 +1,21 @@ +var themes = document.getElementById("theme-choices"); +var themePicker = document.getElementById("theme-picker"); +themePicker.onclick = function() { + if (themes.style.display === "block") { + themes.style.display = "none"; + themePicker.style.borderBottomRightRadius = "3px"; + themePicker.style.borderBottomLeftRadius = "3px"; + } else { + themes.style.display = "block"; + themePicker.style.borderBottomRightRadius = "0"; + themePicker.style.borderBottomLeftRadius = "0"; + } +}; +["dark","main"].forEach(function(item) { + var but = document.createElement('button'); + but.innerHTML = item; + but.onclick = function(el) { + switchTheme(currentTheme, mainTheme, item); + }; + themes.appendChild(but); +}); |