{"size": 842, "ext": "js", "max_stars_repo_path": "static/js/dark-mode.js", "max_stars_repo_name": "recherst/canary", "max_stars_repo_stars_event_min_datetime": "2018-07-05T03:51:44.000Z", "max_stars_repo_stars_event_max_datetime": "2019-03-17T08:07:22.000Z", "max_issues_repo_path": "static/js/dark-mode.js", "max_issues_repo_name": "recherst/canary", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "static/js/dark-mode.js", "max_forks_repo_name": "recherst/canary", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.0666666667, "max_line_length": 94, "alphanum_fraction": 0.5285035629}

(function() {
    var toggle = document.getElementById("dark-mode-toggle");
    var darkTheme = document.getElementById("dark-mode-theme");

    if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
        // dark mode
        setTheme('dark');
    } else {
        setTheme('light');
    }
    // Add to support dark mode
    window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function(e) {
        if (e.matches) {
            setTheme('dark');
        } else {
            setTheme('light');
        }
    })

    function setTheme(mode) {
        if (mode == 'dark') {
            console.log("dark--");
            darkTheme.disabled = false;
        } else if (mode == 'light') {
            darkTheme.disabled = true;
            console.log("light--");
        }
    }
})();