This commit is contained in:
parent
e6fce29346
commit
89fbbd1388
1 changed files with 2 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
document.querySelector('nav > button').addEventListener('click', (e) => {
|
||||
document.querySelector('nav > button')?.addEventListener('click', (e) => {
|
||||
document.querySelector('nav').classList.toggle('visible');
|
||||
})
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ function applyTheme(theme){
|
|||
html.classList.add(theme)
|
||||
}
|
||||
|
||||
document.querySelectorAll('.toggleTheme').forEach(
|
||||
document.querySelectorAll('.toggleTheme')?.forEach(
|
||||
element => element.addEventListener('click', (e) => {
|
||||
const newTheme = element.dataset.theme;
|
||||
applyTheme(newTheme);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue