-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
42 lines (37 loc) · 1.3 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//hamburguer
document.addEventListener('DOMContentLoaded', function() {
const hamburger = document.getElementById('hamburger');
const menuheader = document.querySelector('.menuheader');
const menuItems = document.querySelectorAll('.menuheader a');
hamburger.addEventListener('click', function() {
menuheader.classList.toggle('show');
});
menuItems.forEach(function(item) {
item.addEventListener('click', function() {
menuheader.classList.remove('show');
});
});
});
//filtro portfolio
function filterItems(filter) {
const items = document.querySelectorAll('.item');
items.forEach(item => {
if (filter === 'all') {
item.style.display = 'block';
} else if (item.classList.contains(filter)) {
item.style.display = 'block';
} else {
item.style.display = 'none';
}
});
}
// Inicializar com todos os itens visíveis
document.addEventListener('DOMContentLoaded', () => {
filterItems('all');
});
//footer
document.addEventListener('DOMContentLoaded', function() {
const currentYearElement = document.getElementById('currentYear');
const currentYear = new Date().getFullYear();
currentYearElement.textContent = currentYear;
});