-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
27 lines (24 loc) · 894 Bytes
/
main.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
document.getElementById('toggleLanguage').addEventListener('click', function() {
var sections = document.querySelectorAll('.content-language');
var button = this;
sections.forEach(function(section) {
if (section.style.display === 'none') {
section.style.display = 'block';
} else {
section.style.display = 'none';
}
});
// Verifica qual idioma está visível para alterar o texto do botão
if (sections[0].style.display === 'block') {
button.textContent = 'English';
} else {
button.textContent = 'Português';
}
});
window.addEventListener('load', function() {
document.querySelectorAll('.section-show').forEach(function(section) {
section.classList.remove('section-show');
});
document.querySelector('#header').classList.add('section-show');
window.scrollTo(0, 0);
});