1// Interacción local de pestañas Avada; no necesita WordPress ni bibliotecas externas. 2for (const tabs of document.querySelectorAll('[data-legacy-layout] .fusion-tabs')) { 3 const links = [...tabs.querySelectorAll('.tab-link[href^="#"]')].filter(link => link.closest('.fusion-tabs') === tabs); 4 const panes = [...tabs.querySelectorAll(':scope > .tab-content > .tab-pane')]; 5 if (!links.length || panes.some(pane => !links.some(link => link.getAttribute('href') === '#' + pane.id))) continue; 6 // Algunas filas originales con margen negativo cubren los enlaces móviles. 7 tabs.style.position = 'relative'; 8 tabs.style.zIndex = '1'; 9 const row = tabs.closest('.fusion-fullwidth'); 10 if (row) { row.style.position = 'relative'; row.style.zIndex = '1'; } 11 function select(link, focus = false) { 12 const id = link.getAttribute('href').slice(1); 13 if (!panes.some(pane => pane.id === id)) return; 14 for (const item of links) { 15 const active = item.getAttribute('href') === '#' + id; 16 item.setAttribute('aria-selected', String(active)); 17 item.tabIndex = active ? 0 : -1; 18 item.parentElement.classList.toggle('active', active); 19 } 20 for (const pane of panes) { 21 const active = pane.id === id; 22 pane.classList.toggle('active', active); 23 pane.classList.toggle('in', active); 24 pane.hidden = !active; 25 } 26 if (focus) link.focus(); 27 } 28 links.forEach(link => { 29 link.addEventListener('click', event => { event.preventDefault(); select(link); }); 30 link.addEventListener('keydown', event => { 31 const peers = links.filter(item => item.id.startsWith('mobile-') === link.id.startsWith('mobile-')); 32 const position = peers.indexOf(link); 33 let next; 34 if (['ArrowRight', 'ArrowDown'].includes(event.key)) next = (position + 1) % peers.length; 35 if (['ArrowLeft', 'ArrowUp'].includes(event.key)) next = (position - 1 + peers.length) % peers.length; 36 if (event.key === 'Home') next = 0; 37 if (event.key === 'End') next = peers.length - 1; 38 if (next !== undefined) { event.preventDefault(); select(peers[next], true); } 39 }); 40 }); 41 select(links.find(link => link.getAttribute('aria-selected') === 'true') ?? links[0]); 42} 43 44// Reproduce la rotación de fondos conservando las fotos, tiempos y dirección de Avada. 45for (const slider of document.querySelectorAll('[data-legacy-layout] .awb-background-slider')) { 46 const slides = [...slider.querySelectorAll('.swiper-slide')]; 47 if (slides.length < 2 || matchMedia('(prefers-reduced-motion: reduce)').matches) continue; 48 const wrapper = slider.querySelector('.swiper-wrapper'); 49 if (!wrapper) continue; 50 wrapper.style.transform = 'none'; wrapper.style.display = 'block'; 51 let current = 0; 52 const speed = Math.max(2000, Number(slider.dataset.slideshowSpeed) || 5000); 53 const duration = Math.max(0, Math.min(2000, Number(slider.dataset.animationSpeed) || 800)); 54 const direction = slider.dataset.direction || 'left'; 55 const axis = ['up', 'down'].includes(direction) ? 'Y' : 'X'; 56 const sign = ['down', 'right'].includes(direction) ? -1 : 1; 57 slides.forEach((slide, index) => { 58 Object.assign(slide.style, { display: index === 0 ? 'block' : 'none', position: 'absolute', inset: '0', width: '100%', height: '100%', transform: 'none' }); 59 slide.setAttribute('aria-hidden', String(index !== 0)); 60 }); 61 setInterval(() => { 62 if (document.hidden || !slider.getBoundingClientRect().height) return; 63 const previous = slides[current]; current = (current + 1) % slides.length; 64 const next = slides[current]; next.style.transition = 'none'; next.style.transform = `translate${axis}(${sign * 100}%)`; next.style.display = 'block'; 65 next.setAttribute('aria-hidden', 'false'); previous.setAttribute('aria-hidden', 'true'); 66 requestAnimationFrame(() => requestAnimationFrame(() => { 67 previous.style.transition = next.style.transition = `transform ${duration}ms ease`; 68 previous.style.transform = `translate${axis}(${-sign * 100}%)`; next.style.transform = `translate${axis}(0)`; 69 setTimeout(() => { previous.style.display = 'none';
69 previous.style.transition = 'none'; previous.style.transform = 'none'; }, duration); 70 })); 71 }, speed); 72}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.