mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-16 00:02:48 +02:00
1 line
938 B
JavaScript
1 line
938 B
JavaScript
(()=>{"use strict";var e=document.getElementById("toggle-btn"),t=document.querySelector("body"),a=document.getElementById("text"),d=document.getElementById("mini-nav"),s=document.getElementById("nav"),l=localStorage.getItem("dark-mode"),o=function(){t.classList.add("dark-mode-theme"),d.classList.add("nav-dark"),s.classList.add("nav-dark"),d.classList.remove("nav-light"),s.classList.remove("nav-light"),e.classList.add("dark-mode-toggle"),e.style.color="rgb(177, 177, 177)",a.innerHTML="sombre",localStorage.setItem("dark-mode","enabled")};"enabled"===l&&o(),e.onclick=function(){"enabled"===(l=localStorage.getItem("dark-mode"))?(t.classList.remove("dark-mode-theme"),d.classList.remove("nav-dark"),s.classList.remove("nav-dark"),d.classList.add("nav-light"),s.classList.add("nav-light"),e.classList.remove("dark-mode-toggle"),e.style.color="rgb(83, 83, 83)",a.innerHTML="claire",localStorage.setItem("dark-mode","disabled")):o()}})(); |