function fechaclickMenu(){
const nav=document.getElementById('navMain');
nav.classList.toggle('active');
document.body.style.cssText='overflow-y:scroll';
}
(function(){
function setCookie(name, value, days){
var expires="";
if(days){
var date=new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires="; expires=" + date.toUTCString();
}
document.cookie=name + "=" + value + expires + "; path=/";
}
function getCookie(name){
var nameEQ=name + "=";
var ca=document.cookie.split(';');
for (var i=0; i < ca.length; i++){
var c=ca[i];
while (c.charAt(0)==' ') c=c.substring(1, c.length);
if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length, c.length);
}
return null;
}
window.visitCount=parseInt(getCookie('visitCount'))||0;
setCookie('visitCount', window.visitCount + 1, 15);
})();
const btnMobile=document.getElementById('btnMainMobile');
const selecionaTexto=document.getElementById('textoHamburquer');
function toggleMenu(event){
if(event.type==='touchstart') event.preventDefault();
const nav=document.getElementById('navMain');
nav.classList.toggle('active');
const active=nav.classList.contains('active');
event.currentTarget.setAttribute('aria-expanded', active);
document.querySelector('.caixa__menu').style.display='none'
const header=document.querySelector('header');
const menuPrincipal=document.getElementById('menu-menu-principal');
if(active){
event.currentTarget.setAttribute('aria-label', 'Fechar Menu');
selecionaTexto.innerHTML='Fechar';
document.getElementById('headerGroup').style.cssText='transition:.2s ease;top:0;';
document.body.style.cssText='overflow-y:hidden';
if(header){
const headerHeight=header.offsetHeight - 1;
menuPrincipal.style.top=`${headerHeight}px`;
}
menuPrincipal.style.visibility='visible';
}else{
event.currentTarget.setAttribute('aria-label', 'Abrir Menu');
selecionaTexto.innerHTML='Menu';
var currentScrollPos=window.pageYOffset;
var menuTopo=document.querySelector('.menu__topo');
var alturaMenuTopo=menuTopo.getBoundingClientRect().height;
document.getElementById('headerGroup').style.top=-alturaMenuTopo + 'px';
document.body.style.cssText='overflow-y:scroll';
menuPrincipal.style.visibility='hidden';
if(currentScrollPos <=100){
document.getElementById('headerGroup').style.top='0';
}}
}
btnMobile.addEventListener('click', toggleMenu);
btnMobile.addEventListener('touchstart', toggleMenu);
document.addEventListener("DOMContentLoaded", function(){
var menuItemsWithChildren=document.querySelectorAll('.menu-item-has-children');
menuItemsWithChildren.forEach(function(menuItem){
if(!('ontouchstart' in window)){
menuItem.addEventListener('mouseover', function(){
var subMenu=this.querySelector('.sub-menu');
if(subMenu){
subMenu.style.display='flex';
}});
menuItem.addEventListener('mouseout', function(){
var subMenu=this.querySelector('.sub-menu');
if(subMenu){
subMenu.style.display='none';
}});
}});
});
{
document.addEventListener("DOMContentLoaded", function(){
var prevScrollPos=window.pageYOffset;
var headerGroup=document.getElementById('headerGroup');
var sidebarId=document.getElementById('sidebarId');
var letrasglossarioid=document.getElementById('sticky__letras_tabela');
var sidebar=document.querySelector('.sidebar');
var redesSociaisFixed=document.querySelector('.redes__sociais_fixed');
window.onscroll=function(){
var currentScrollPos=window.pageYOffset;
var menuTopo=document.querySelector('.menu__topo');
var alturaMenuTopo=menuTopo.getBoundingClientRect().height;
var topPosition=-alturaMenuTopo + 'px';
if(prevScrollPos <=currentScrollPos&&currentScrollPos >=200){
headerGroup.style.transition='.2s ease';
headerGroup.style.top=topPosition;
if(letrasglossarioid){
letrasglossarioid.style.top='91px';
}
if(sidebarId){
sidebar.style.top='85px';
sidebarId.style.cssText='border-image: linear-gradient(var(--angle), var(--verde), var(--amarelo), var(--vermelho), var(--roxo), var(--verde)) 1';
}
if(redesSociaisFixed){
redesSociaisFixed.style.top='100px';
redesSociaisFixed.style.cssText='border-image: linear-gradient(var(--angle), var(--verde), var(--amarelo), var(--vermelho), var(--roxo), var(--verde)) 1';
redesSociaisFixed.style.borderStyle='solid';
}}else if(currentScrollPos < 400){
headerGroup.style.transition='.2s ease';
headerGroup.style.top='0';
}else{
headerGroup.style.transition='.2s ease';
headerGroup.style.top='0';
if(letrasglossarioid){
letrasglossarioid.style.top='145px';
}
if(sidebarId){
sidebarId.style.cssText='border-image: none';
sidebarId.style.borderStyle='dashed';
sidebar.style.top='160px';
}
if(redesSociaisFixed){
redesSociaisFixed.style.cssText='border-image: none;top: 176px';
}}
prevScrollPos=currentScrollPos;
};});
}
document.addEventListener("DOMContentLoaded", function(){
var lazyBackgrounds=[].slice.call(document.querySelectorAll(".lazy__image"));
if("IntersectionObserver" in window){
let lazyBackgroundObserver=new IntersectionObserver(function(entries, observer){
entries.forEach(function(entry){
if(entry.isIntersecting){
entry.target.classList.add("visible");
lazyBackgroundObserver.unobserve(entry.target);
}});
});
lazyBackgrounds.forEach(function(lazyBackground){
lazyBackgroundObserver.observe(lazyBackground);
});
}});
function initAnimacaoScroll(){
const sections=document.querySelectorAll('.js-scroll');
if(sections.length){
const windowMetade=window.innerHeight * 0.85;
function animaScroll(){
sections.forEach((section)=> {
const sectionTop=section.getBoundingClientRect().top;
const isSectionVisible=sectionTop - windowMetade < 0;
if(isSectionVisible) section.classList.add('ativo');
else section.classList.remove('ativo');
});
}
animaScroll();
window.addEventListener('scroll', animaScroll);
}}
initAnimacaoScroll();