1 2 3 4// UIAM - 02031998 5 6(function ($) { 7 "use strict"; 8 adjustMaxContent(); 9 AOS.init(); 10 11 12 13// header 14 15 $(window).scroll(function () { 16 var scroll = $(window).scrollTop(); 17 if (scroll >= 100) { 18 $(".main_header").addClass("fixed-header"); 19 } else { 20 $(".main_header").removeClass("fixed-header"); 21 } 22 }); 23 24 25// Dropdown 26 27$('.select-dropdown__button').on('click', function(){ 28 $('.select-dropdown__list').toggleClass('active'); 29}); 30$('.select-dropdown__list-item').on('click', function(){ 31 var itemValue = $(this).data('value'); 32 console.log(itemValue); 33 $('.select-dropdown__button span').text($(this).text()).parent().attr('data-value', itemValue); 34 $('.select-dropdown__list').toggleClass('active'); 35}); 36 37 // Mobile Bottom Sticky 38 $('.togglee').on('click', function () { 39 let target = $(this).data('target'); 40 if ($(this).hasClass('active')) { 41 $(this).removeClass('active'); 42 $(target).removeClass('show') 43 } else { 44 $('.m-pop').removeClass('show'); 45 $('.togglee.active').removeClass('active') 46 $(target).addClass('show'); 47 $(this).addClass('active') 48 } 49 }); 50 51 $('.drop-menu1>a').click(function (e) { 52 setMPopHeight(); 53 if ($(this).closest('.drop-menu1').hasClass('active')) { 54 $(this).closest('.drop-menu1').removeClass('active') 55 $(this).siblings('.sub-menu1').slideUp(300) 56 } else { 57 58 $('.drop-menu1.active').removeClass('active'); 59 $('.sub-menu1').slideUp('300'); 60 $(this).closest('.drop-menu1').addClass('active') 61 $(this).siblings('.sub-menu1').slideDown(300) 62 } 63 }); 64 // Mobile Bottom Sticky 65 66 67 // Hamburger Menu Js 68 69 $(".hamb_open").click(function () { 70 $(".hamburger_menu").addClass("active"); 71 }); 72 73 $(".ham_close").click(function () { 74 $(".hamburger_menu").removeClass("active"); 75 }); 76 $(".hambmenu li a").click(function (e) { 77 var same = $(this).hasClass("active"); 78 var siblings = $(this).parent(".hamb_drop").parent().children(); 79 siblings.find("a.active + .hamb_sub").slideUp(); 80 siblings.find("a").removeClass("active"); 81 if ($(this).next().hasClass("hamb_sub") && !same) { 82 e.preventDefault(); 83 $(this).addClass("active"); 84 $(this).next(".hamb_sub").slideDown(); 85 } 86 }); 87 88 // Hamburger Menu Js 89 90const hamberger = document.querySelector('.hamberger a'); 91const sideMenu = document.querySelector('.side-menu'); 92const closeBtn = document.querySelector('.close-btn'); 93 94hamberger.addEventListener('click', (e) => { 95 e.preventDefault(); 96 sideMenu.classList.add('open'); 97 document.body.classList.add('menu-open'); 98}); 99 100closeBtn.addEventListener('click', () => { 101 sideMenu.classList.remove('open'); 102 document.body.classList.remove('menu-open'); 103}); 104 105 106function counterUp(el, target, duration = 2000) { 107 let start = 0; 108 let startTime = null; 109 110 function animateCounter(timestamp) { 111 if (!startTime) startTime = timestamp; 112 let progress = timestamp - startTime; 113 let progressRatio = Math.min(progress / duration, 1); 114 let current = Math.floor(progressRatio * target); 115 el.textContent = current.toLocaleString(); 116 117 if (progress < duration) { 118 requestAnimationFrame(animateCounter); 119 } 120 } 121 122 requestAnimationFrame(animateCounter); 123} 124 125 126 127 function wipeOn() { 128 var wipers = document.querySelectorAll('.image'); 129 wipers.forEach(function(wipers) { 130 var rect = wipers.getBoundingClientRect(); 131 if (rect.top < (window.innerHeight - 200 || document.documentElement.clientHeight)) { 132 wipers.classList.add('reveal-image'); 133 } 134 // else{ 135 // wipers.classList.remove('reveal-image'); 136 // } 137 }); 138 139 140 var wipers1 = document.querySelectorAll('.image2');
141 wipers1.forEach(function(wipers1) { 142 var rect1 = wipers1.getBoundingClientRect(); 143 if (rect1.top < (window.innerHeight - 200 || document.documentElement.clientHeight)) { 144 wipers1.classList.add('reveal-image2'); 145 } 146 // else{ 147 148 // else{ 149 // wipers1.classList.remove('reveal-image2'); 150 // } 151 }); 152 var wipers2 = document.querySelectorAll('.image3'); 153 wipers2.forEach(function(wipers2) { 154 var rect2 = wipers2.getBoundingClientRect(); 155 if (rect2.top < (window.innerHeight - 200 || document.documentElement.clientHeight)) { 156 wipers2.classList.add('reveal-image3'); 157 } 158 }); 159 var wipers3 = document.querySelectorAll('.image4'); 160 wipers3.forEach(function(wipers3) { 161 var rect3 = wipers3.getBoundingClientRect(); 162 if (rect3.top < (window.innerHeight - 100 || document.documentElement.clientHeight)) { 163 wipers3.classList.add('reveal-image4'); 164 } 165 }); 166 167 }; 168 window.addEventListener('load', wipeOn); 169 window.addEventListener('scroll', wipeOn); 170 window.addEventListener('resize', wipeOn); 171 172 173 174// AOS init (already handles mobile disabling via 'disable: "mobile"') 175if ($('[data-aos]').length > 0) { 176 AOS.init({ 177 easing: 'linear', 178 disable: 'mobile', 179 }); 180} 181 182 183 184 185 186 $(window).resize(function () { 187 adjustMaxContent(); 188 }); 189 function adjustMaxContent() { 190 let containerWidth = $(".container").width() 191 //console.log([...containerWidth]); 192 // containerWidth = $([...containerWidth][2]).width(); 193 let windowWidth = $("body").width(); 194 windowWidth = windowWidth > 2700 ? 2700 : windowWidth; 195 let maxContentWidth = (windowWidth - (windowWidth - containerWidth) / 2) + 13; 196 if (windowWidth >= 2700) { 197 $(".max-content-xxl").css("max-width", `${maxContentWidth}px`); 198 $(".max-content-xl").css("max-width", `${maxContentWidth}px`); 199 $(".max-content-lg").css("max-width", `${maxContentWidth}px`); 200 $(".max-content-md").css("max-width", `${maxContentWidth}px`); 201 $(".max-content-sm").css("max-width", `${maxContentWidth}px`); 202 $(".max-content").css("max-width", `${maxContentWidth}px`); 203 } 204 else if (windowWidth >= 1400) { 205 $(".max-content-xxl").css("max-width", `${maxContentWidth}px`); 206 $(".max-content-xl").css("max-width", `${maxContentWidth}px`); 207 $(".max-content-lg").css("max-width", `${maxContentWidth}px`); 208 $(".max-content-md").css("max-width", `${maxContentWidth}px`); 209 $(".max-content-sm").css("max-width", `${maxContentWidth}px`); 210 $(".max-content").css("max-width", `${maxContentWidth}px`); 211 } else if (windowWidth >= 1200) { 212 $(".max-content-xxl").css("max-width", ""); 213 $(".max-content-xl").css("max-width", `${maxContentWidth}px`); 214 $(".max-content-lg").css("max-width", `${maxContentWidth}px`); 215 $(".max-content-md").css("max-width", `${maxContentWidth}px`); 216 $(".max-content-sm").css("max-width", `${maxContentWidth}px`); 217 $(".max-content").css("max-width", `${maxContentWidth}px`); 218 } else if (windowWidth >= 992) { 219 $(".max-content-xxl").css("max-width", ""); 220 $(".max-content-xl").css("max-width", ""); 221 $(".max-content-lg").css("max-width", `${maxContentWidth}px`); 222 $(".max-content-md").css("max-width", `${maxContentWidth}px`); 223 $(".max-content-sm").css("max-width", `${maxContentWidth}px`); 224 $(".max-content").css("max-width", `${maxContentWidth}px`); 225 } else if (windowWidth >= 768) { 226 $(".max-content-xxl").css("max-width", ""); 227 $(".max-content-xl").css("max-width", ""); 228 $(".max-content-lg").css("max-width", ""); 229 $(".max-content-md").css("max-width", `${maxContentWidth}px`); 230 $(".max-content-sm").css("max-width", `${maxContentWidth}px`); 231 $(".max-content").css("max-width", `${maxContentWidth}px`); 232 } else if (windowWidth >= 575) { 233 $(".max-content-xxl").css("max-width", ""); 234 $(".max-content-xl").css("max-width", ""); 235 $(".max-content-lg").css("max-width", ""); 236 $(".max-content-md").css("max-width", ""); 237 $(".max-content-sm").css("max-width", `${maxContentWidth}px`); 238 $(".max-content").css("max-width", `${maxContentWidth}px`); 239 } else { 240 $(".max-content-xxl").css("width", ""); 241 $(".max-content-xl").css("width", ""); 242 $(".max-content-lg").css("width", ""); 243 $(".max-content-md").css("width", ""); 244 $(".max-content-sm").css("width", ""); 245 $(".max-content").css("width", `${maxContentWidth}px`); 246 } 247 } 248 249 250/* -------------------------------------------------------- 251 School mobile gallery slider 252 -------------------------------------------------------- */ 253var Homeswiper = new Swiper(".school_slider", { 254 loop: true, 255 speed: 1500, 256 slidesPerView: 1, 257 spaceBetween: 16, 258 autoplay: { 259 delay: 2000, 260 disableOnInteraction: false 261 }, 262 navigation: { 263 nextEl: ".swiper-button-next", 264 prevEl: ".swiper-button-prev", 265 }, 266 });
267 268 269 270 271 272 273 274function positionSwiperNav() { 275 const nav = document.querySelector('.swiper_nav'); 276 const firstFigure = document.querySelector('.swiper .swiper-slide figure'); 277 278 if (nav && firstFigure) { 279 const figureHeight = firstFigure.offsetHeight; 280 const bottomOffset = 6 * parseFloat(getComputedStyle(document.documentElement).fontSize); 281 nav.style.top = (firstFigure.offsetTop + figureHeight - bottomOffset) + 'px'; 282 } 283} 284 285document.addEventListener("DOMContentLoaded", () => { 286 positionSwiperNav(); 287}); 288 289window.addEventListener("resize", () => { 290 positionSwiperNav(); 291}); 292 293 294 295})(jQuery); 296 297// Mobile Menu 298 299function togglePanel(panelToShow, activeElement) { 300 const isActive = $(panelToShow).hasClass("show"); 301 $(".mobile_panel01, .mobile_panel02, .mobile_panel03, .mobile_panel04").removeClass("show"); 302 if (!isActive) { 303 $(panelToShow).addClass("show"); 304 } 305 $(".mob_tab01, .mob_tab02, .mob_tab03, .mob_tab04").removeClass("active"); 306 if (!isActive) { 307 $(activeElement).addClass("active"); 308 } 309 } 310 $(".mob_tab01").click(function () { 311 togglePanel(".mobile_panel01", this); 312 }); 313 $(".mob_tab02").click(function () { 314 togglePanel(".mobile_panel02", this); 315 }); 316 $(".mob_tab03").click(function () { 317 togglePanel(".mobile_panel03", this); 318 }); 319 $(".mob_tab04").click(function () { 320 togglePanel(".mobile_panel04", this); 321 }); 322 // Mobile Menu Tab End 323 324 325 $(".menu_mobile li a").click(function (e) { 326 327 var same = $(this).hasClass("active"); 328 var siblings = $(this).parent(".menu_item").parent().children(); 329 siblings.find("a.active + .sub_menu").slideUp(); 330 siblings.find("a").removeClass("active"); 331 if ($(this).next().hasClass("sub_menu") && !same) { 332 e.preventDefault(); 333 $(this).addClass("active"); 334 $(this).next(".sub_menu").slideDown(); 335 } 336 }); 337 338 339 function toggleDropdown() { 340 const dropdown = document.getElementById("dropdown"); 341 dropdown.style.display = 342 dropdown.style.display === "block" ? "none" : "block"; 343 } 344 345 document.addEventListener("click", function (e) { 346 if (!e.target.closest(".custm_dropdown")) { 347 document.getElementById("custm_dropdown").style.display = "none"; 348 } 349 });
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.