Curriculum Vitæ / Resume cv.marc.beninca.link
at dev 72 lines 1.5 kB view raw
1// buttons 2 3const buttons = ["item", "link", "swap"]; 4 5for (let button of buttons) { 6 document.getElementById(button).addEventListener("click", () => { 7 document.body.classList.toggle(button); 8 }); 9} 10 11// theme 12 13let theme; 14 15function theme_get() { 16 theme = localStorage.getItem("theme"); 17 if (! theme) { 18 if (window.matchMedia("(prefers-color-scheme: dark)").matches) { 19 theme = "dark"; 20 } else { 21 theme = "light"; 22 } 23 } 24 theme_set(); 25} 26 27function theme_set() { 28 document.documentElement.setAttribute("data-theme", theme); 29 localStorage.setItem("theme", theme); 30} 31 32function theme_swap() { 33 theme = theme === "light" ? "dark" : "light"; 34 theme_set(); 35} 36 37document.getElementById("theme").addEventListener("click", () => { 38 theme_swap(); 39}); 40 41theme_get(); 42 43// 44 45const a = (t) => atob(`${t}=`); 46const ab = (t) => atob(`${t}==`); 47const qa = document.getElementById("qa"); 48 49qa.style.cursor = ab("cG9pbnRlcg"); 50const qa0 = ab("Lg"); 51 52const qa1 = [ 53 a("Y3Y"), 54].join(qa0); 55const qa2 = document.createElement(ab("c3Bhbg")); 56qa2.className = a("ZmEgZmEtYXQ"); 57const qa3 = [ 58 ab("bWFyYw"), 59 ab("YmVuaW5jYQ"), 60 ab("bGluaw"), 61].join(qa0); 62const qa4 = ab("IA") 63 64for (let kg of [qa1, qa4, qa2, qa4, qa3]) { 65 qa.append(kg); 66} 67qa.addEventListener("click", () => { 68 window.location.href = [ 69 atob("bWFpbHRv"), 70 [qa1, qa3].join(ab("QA")), 71 ].join(ab("Og")); 72});