friendship ended with social-app. php is my new best friend
1window.addEventListener('load', () => {
2 console.log('load');
3 document.querySelectorAll('button[data-theme]').forEach((elt) => {
4 elt.addEventListener('click', (e) => {
5 e.preventDefault();
6 const theme = e.target.getAttribute('data-theme');
7 document.body.setAttribute("data-theme", theme);
8 document.cookie = "sbs_theme="+theme+";";
9 });
10 });
11
12 document.querySelectorAll('button[data-font]').forEach((elt) => {
13 console.log(elt);
14 elt.addEventListener('click', (e) => {
15 e.preventDefault();
16 console.log('hi');
17 const font = e.target.getAttribute('data-font');
18 document.body.setAttribute("data-font", font);
19 document.cookie = "sbs_font="+font+";";
20 });
21 });
22});