document.addEventListener(‘DOMContentLoaded’, function () {
const footer = document.querySelector(‘#footer.wf-container-footer’);
const switcher = document.querySelector(‘.gt_switcher_wrapper’);
if (!footer || !switcher) {
console.log(‘GTranslate: no se encontró footer o switcher’);
return;
}
function checkFooterPosition() {
const footerTop = footer.getBoundingClientRect().top;
const windowHeight = window.innerHeight;
// Posición aproximada del switcher:
// bottom: 15px
const switcherLine = windowHeight – 15;
if (footerTop <= switcherLine) { switcher.classList.add('footer-active'); } else { switcher.classList.remove('footer-active'); } } window.addEventListener('scroll', checkFooterPosition, { passive: true }); window.addEventListener('resize', checkFooterPosition); checkFooterPosition(); });