Sha256: 05d4656e3e09314693ce5cce140911adea7db627619b1ab01619a25cce727fbd

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

function setLightMode() {
    body=document.body;
    var light_mode=localStorage.getItem("light_mode");
    var theme_color_meta=document.querySelector('meta[name="theme-color"]');
    if (light_mode=="dark") {
        body.classList.remove("light");
        body.classList.add("dark");
        document.getElementById("body").classList.remove("lily-mode-light");
        document.getElementById("body").classList.add("lily-mode-dark");
        theme_color_meta.setAttribute("content","#343e8f");
    } else {
        body.classList.remove("dark");
        body.classList.add("light");
        document.getElementById("body").classList.remove("lily-mode-dark");
        document.getElementById("body").classList.add("lily-mode-light");
        theme_color_meta.setAttribute("content","#dee0ff");
    }
}
function changeLightMode() {
    var light_mode=localStorage.getItem("light_mode");
    if (light_mode=='dark')
        light_mode='light';
    else
        light_mode='dark';
    localStorage.setItem('light_mode',light_mode);
    setLightMode();
    document.body.classList.add("transition");
    window.setTimeout(()=>{
        document.body.classList.remove("transition");
    },500);
}
function scrollToTop() {
    var elm=document.body||document.documentElement;
    elm.scrollIntoView();
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-theme-lily-3.0.3.1.3 assets/js/lily.js