Files
OpenBB/website/public/js/darkmode-ce906ea916.min.js
Artem Veremey e7e49538b0 Synchronize master and main (#705)
* hugo server

* Update test.yml

* Update test.yml

* Create gh-pages.yml

* Update gh-pages.yml

* Update config.toml

* Update config.toml

* update themes and public

* Update gh-pages.yml

* Update gh-pages.yml

* Update gh-pages.yml

* remove themes

* add themes

* Update gh-pages.yml

* Update config.toml

* Update config.toml

* remove

* re-add theme

* Update config.toml

* Update config.toml

* Update config.toml

* Update gh-pages.yml

* Update gh-pages.yml

* Update config.toml

* Update config.toml

* Update config.toml

* Update _index.md

* Update config.toml

* Update gh-pages.yml

* Update README.md

* Update README.md

Co-authored-by: didier <dro.lopes@campus.fct.unl.pt>
2021-08-23 09:03:23 +01:00

1 line
803 B
JavaScript
Vendored

const DARK_MODE="dark",LIGHT_MODE="light",AUTO_MODE="auto",THEME="hugo-geekdoc",TOGGLE_MODES=[AUTO_MODE,DARK_MODE,LIGHT_MODE];function toggle(e=[],t){return current=e.indexOf(t),max=e.length-1,next=0,current<max&&(next=current+1),next}(applyTheme=function(e=!0){let t=document.documentElement;var o=TOGGLE_MODES.includes(localStorage.getItem(THEME))?localStorage.getItem(THEME):AUTO_MODE;t.setAttribute("class","color-toggle-"+o),localStorage.setItem(THEME,o),o===AUTO_MODE?t.removeAttribute("color-mode"):t.setAttribute("color-mode",o),e||location.reload()})(),document.addEventListener("DOMContentLoaded",e=>{const t=document.getElementById("gdoc-dark-mode");t.onclick=function(){var e=localStorage.getItem(THEME),e=toggle(TOGGLE_MODES,e);localStorage.setItem(THEME,TOGGLE_MODES[e]),applyTheme(!1)}});