Add files via upload

This commit is contained in:
Rodrigo Emanuel
2025-05-11 02:34:38 -03:00
committed by GitHub
parent 594abf2dc1
commit 9f6fdfc691
22 changed files with 1249 additions and 79 deletions

View File

@@ -341,4 +341,33 @@ window.addEventListener('load', () => {
generateUrl();
pushChangeEvents();
populateEmoteList();
});
document.querySelectorAll('.nav-bar a').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
// Remove todas as classes dos links dentro da nav-bar
document.querySelectorAll('.nav-bar a').forEach(link => {
link.classList.remove('active');
});
this.classList.add('active');
const targetId = this.getAttribute('href');
const targetElement = document.querySelector(targetId);
if (targetElement) {
const offset = 20; // ajusta 20px acima
const y = targetElement.getBoundingClientRect().top + window.scrollY - offset;
window.scrollTo({
top: y,
behavior: 'smooth'
});
}
});
});