-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
43 lines (36 loc) · 1.23 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
43
document.addEventListener("DOMContentLoaded", function () {
const dropdown = document.getElementById("dropdown");
const button = document.getElementById("dropdown-button");
const menu = document.getElementById("dropdown-menu");
menu.style.display = "none";
dropdown.classList.remove("active");
button.addEventListener("click", function (e) {
e.stopPropagation();
// Alternar a visibilidade do menu dropdown
if (menu.style.display === "block") {
menu.style.display = "none";
dropdown.classList.remove("active");
} else {
menu.style.display = "block";
dropdown.classList.add("active");
}
});
window.addEventListener("click", function (e) {
if (!dropdown.contains(e.target)) {
menu.style.display = "none";
dropdown.classList.remove("active");
}
});
});
function adjustTitle() {
const title = document.getElementById("title");
if (window.innerWidth < 800) {
title.innerHTML = "EXTRA<br>CURRICULAR";
} else {
title.innerHTML = "EXTRACURRICULAR";
}
}
// Ajustar o título quando a página carregar
window.onload = adjustTitle;
// Ajustar o título quando a janela for redimensionada
window.onresize = adjustTitle;