1
mirror of https://github.com/jakejarvis/dark-mode.git synced 2025-06-27 16:45:40 -04:00

Update README

This commit is contained in:
2021-08-05 08:12:49 -04:00
parent cfa1f575e3
commit 6bf29bca6f
2 changed files with 21 additions and 24 deletions

View File

@ -47,13 +47,16 @@
<p><a href="https://github.com/jakejarvis/dark-mode" target="_blank" rel="noopener">View the source code</a> or <a href="https://jarv.is/notes/dark-mode/" target="_blank" rel="noopener">read the post</a>.</p>
<script src="../dist/dark-mode.js"></script> <!-- or use CDN: https://unpkg.com/@jakejarvis/dark-mode/dist/dark-mode.min.js -->
<script src="../dist/dark-mode.min.js"></script> <!-- or use CDN: https://unpkg.com/@jakejarvis/dark-mode/dist/dark-mode.min.js -->
<script>
window.darkMode.init({
toggle: document.querySelector(".dark-mode-toggle"),
onInit: function (t) {
t.style.visibility = "visible";
onInit: function (e) {
e.style.visibility = "visible";
console.log("Toggle is visible now that we know user has JS enabled.");
},
onChange: function (t) {
console.log("Set theme to " + t);
}
});
</script>