-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
28 lines (23 loc) · 931 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import i18Obj from "./translate.js";
const hamburger = document.querySelector('.hamburger');
const menu = document.querySelector('.menu-active');
const nav = document.querySelector('.nav-active');
function toggleMenu() {
hamburger.classList.toggle('open');
nav.classList.toggle('open');
}
hamburger.addEventListener('click', toggleMenu);
/* change images*/
const portfolioBtns = document.querySelectorAll('.portfolio-btn')
const imgPortfolio = document.querySelectorAll('.portfolio-img')
function changeImages() {
portfolioBtns.forEach(element => element.addEventListener('click', () => {
portfolioBtns.forEach(element => element.classList.remove('active'));
imgPortfolio.forEach((el, index) => {
el.src = `assets/img/${element.dataset.season}/${index + 1}.jpg`
})
element.classList.add('active');
}))
}
changeImages();
/*translate */