Add darkmode

Prettier titles
This commit is contained in:
Michał Gdula 2023-07-21 13:25:33 +01:00
parent b6077f88ed
commit 0ddc2a20b2
15 changed files with 187 additions and 76 deletions

View file

@ -1,12 +1,12 @@
const nav = document.querySelector('nav');
const button = document.querySelector('.nav-toggle');
let navRotate = 0;
let increment = 45;
function toggleNav() {
let nav = document.querySelector('nav');
let button = document.querySelector('.nav-toggle');
navRotate += increment;
button.style.transform = `rotate(${navRotate}deg)`;
button.querySelector('svg').style.transform = `rotate(${navRotate}deg)`;
if (nav.classList.contains('open')) {
document.querySelector('body').style.overflow = 'auto';