1let splideTourVirtualDark; 2 3document.addEventListener("DOMContentLoaded", function () { 4 const existeSplideTourVirtualDark = document.querySelector(".uandes-exp-slider-tour-virtual-dark"); 5 if (existeSplideTourVirtualDark) { 6 console.log('existe'); 7 splideTourVirtualDark = new Splide('.uandes-exp-slider-tour-virtual-dark', { 8 type: 'loop', 9 perPage: 3, 10 gap: 20, 11 breakpoints: { 12 768: { 13 perPage: 1, 14 arrows: false, 15 }, 16 }, 17 }); 18 setTimeout(() => { 19 splideTourVirtualDark.mount(); 20 }, 1000); 21 } 22 23 // Splides 24 // Main Banner 25 var splide01Edit = document.getElementById('splide01'); 26 if (splide01Edit) { 27 new Splide(splide01Edit, { 28 autoplay: true, 29 type: 'loop', 30 arrows: false 31 }).mount(); 32 } 33 34 // Calendario 35 var splide02Edit = document.getElementById('splide02'); 36 if (splide02Edit) { 37 new Splide(splide02Edit, { 38 perPage: 5, 39 gap: 30, 40 breakpoints: { 41 640: { 42 arrows: false, 43 perPage: 1, 44 gap: 10 45 }, 46 }, 47 }).mount(); 48 } 49}); 50 51document.addEventListener('DOMContentLoaded', function () { 52 // Verifica si existe la sección con clase "testim-ads" 53 if (document.querySelector('.testim-ads')) { 54 testimAds(); 55 } 56 57 // Verifica si existe la sección con clase "conversemos" 58 if (document.querySelector('.conversemos')) { 59 splidesBloquesCarrera(); 60 } 61}); 62 63// Función para la sección "testim-ads" 64function testimAds() { 65 const testimWrapDesktop = document.querySelector('.testim-wrap-desktop'); 66 67 // Delegación de eventos para intercambio de clases 68 if (testimWrapDesktop) { 69 testimWrapDesktop.addEventListener('click', function (event) { 70 const testimMdCol = event.target.closest('.testim-md-col'); 71 const testimFullCol = document.querySelector('.testim-full-col'); 72 73 if (testimMdCol && testimFullCol) { 74 testimFullCol.classList.remove('testim-full-col'); 75 testimFullCol.classList.add('testim-md-col'); 76 77 testimMdCol.classList.remove('testim-md-col'); 78 testimMdCol.classList.add('testim-full-col'); 79 80 ajustarAlturaTestimonios(); // Recalcula altura después del cambio 81 } 82 }); 83 } 84 85 // Esperar carga de imágenes antes de ajustar alturas 86 const images = document.querySelectorAll('.testim-ads img'); 87 let loadedCount = 0; 88 89 if (images.length === 0) { 90 ajustarAlturaTestimonios(); 91 return; 92 } 93 94 images.forEach(img => { 95 if (img.complete) { 96 loadedCount++; 97 if (loadedCount === images.length) { 98 ajustarAlturaTestimonios(); 99 } 100 } else { 101 img.addEventListener('load', () => { 102 loadedCount++; 103 if (loadedCount === images.length) { 104 ajustarAlturaTestimonios(); 105 } 106 }); 107 } 108 }); 109} 110 111// Función para ajustar alturas 112function ajustarAlturaTestimonios() { 113 const testimCols = document.querySelectorAll('.testim-md-col, .testim-full-col'); 114 let maxHeight = 0; 115 116 // Reset heights to auto for recalculation 117 testimCols.forEach(col => { 118 col.style.height = 'auto'; 119 }); 120 121 // Calcular altura máxima 122 testimCols.forEach(col => { 123 const colHeight = col.offsetHeight; 124 if (colHeight > maxHeight) { 125 maxHeight = colHeight; 126 } 127 }); 128 129 // Aplicar altura máxima 130 testimCols.forEach(col => { 131 col.style.height = maxHeight + 'px'; 132 }); 133} 134 135// Función para la sección "conversemos" 136function splidesBloquesCarrera() { 137 if (document.querySelector('.splide-testimonios-01')) { 138 var splideTestim1 = new Splide('.splide-testimonios-01', { 139 arrows: false, 140 }); 141 splideTestim1.mount(); 142 } 143 if (document.querySelector('.splide-testimonios-02')) { 144 var splideTestim2 = new Splide('.splide-testimonios-02', { 145 arrows: false, 146 }); 147 splideTestim2.mount(); 148 } 149 if (document.querySelector('.splide-testimonios-03')) { 150 var splideTestim3 = new Splide('.splide-testimonios-03', {
151 arrows: false, 152 }); 153 splideTestim3.mount(); 154 } 155 if (document.querySelector('.splide-conversemos')) { 156 var splideConver = new Splide('.splide-conversemos', { 157 arrows: false, 158 perPage: 2, 159 gap: 10, 160 breakpoints: { 161 640: { 162 arrows: false, 163 perPage: 1, 164 gap: 0 165 }, 166 }, 167 }); 168 splideConver.mount(); 169 } 170}
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.