aboutsummaryrefslogtreecommitdiffstats
path: root/theme.js
diff options
context:
space:
mode:
authorTeddy Wing2020-07-04 18:00:45 +0200
committerTeddy Wing2020-07-04 18:14:31 +0200
commit52e6473446d3fa3ab03586ce66d45cb99493c0a1 (patch)
treeb985878838a6925170e12abcd8390cd29890dd5b /theme.js
parent95637c5ca6c803bec78687a55afcc2d3f2bf6ff4 (diff)
downloadfastcgi-conduit-gh-pages.tar.bz2
Generate docs v0.1.0gh-pages
Diffstat (limited to 'theme.js')
-rw-r--r--theme.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/theme.js b/theme.js
new file mode 100644
index 0000000..ebd1a87
--- /dev/null
+++ b/theme.js
@@ -0,0 +1 @@
+var themes=document.getElementById("theme-choices");var themePicker=document.getElementById("theme-picker");function showThemeButtonState(){themes.style.display="block";themePicker.style.borderBottomRightRadius="0";themePicker.style.borderBottomLeftRadius="0"}function hideThemeButtonState(){themes.style.display="none";themePicker.style.borderBottomRightRadius="3px";themePicker.style.borderBottomLeftRadius="3px"}function switchThemeButtonState(){if(themes.style.display==="block"){hideThemeButtonState()}else{showThemeButtonState()}};function handleThemeButtonsBlur(e){var active=document.activeElement;var related=e.relatedTarget;if(active.id!=="themePicker"&&(!active.parentNode||active.parentNode.id!=="theme-choices")&&(!related||(related.id!=="themePicker"&&(!related.parentNode||related.parentNode.id!=="theme-choices")))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;["dark","light"].forEach(function(item){var but=document.createElement('button');but.textContent=item;but.onclick=function(el){switchTheme(currentTheme,mainTheme,item,true)};but.onblur=handleThemeButtonsBlur;themes.appendChild(but)}) \ No newline at end of file