1(() => { 2 // javascript/script.js 3 function _calculateScrollbarWidth() { 4 document.documentElement.style.setProperty( 5 "--scrollbar-width", 6 window.innerWidth - document.documentElement.clientWidth + "px" 7 ); 8 } 9 window.addEventListener("resize", _calculateScrollbarWidth, false); 10 document.addEventListener("DOMContentLoaded", _calculateScrollbarWidth, false); 11 window.addEventListener("load", _calculateScrollbarWidth); 12 document.addEventListener("DOMContentLoaded", function() { 13 const burger = document.querySelectorAll(".navbar-burger"); 14 const additionalBurger = document.querySelectorAll(".additional-burger"); 15 const menu = document.querySelector(".navbar-menu"); 16 const backdrop = document.querySelector(".navbar-backdrop"); 17 const side = document.querySelector(".side-navbar"); 18 const additional = document.querySelector(".additional-navbar"); 19 const close = document.querySelectorAll(".navbar-close"); 20 function fadeInMainListItems(navElement) { 21 const mainListItems = navElement.querySelectorAll("ul.menu > li"); 22 mainListItems.forEach((item, index) => { 23 item.style.opacity = "0"; 24 item.style.transform = "translateY(-8px)"; 25 item.style.willChange = "opacity, transform"; 26 item.style.transition = `opacity 0.3s ease-in-out ${index * 30}ms, transform 0.3s ease-in-out ${index * 30}ms`; 27 requestAnimationFrame(() => { 28 item.style.opacity = "1"; 29 item.style.transform = "translateY(0)"; 30 }); 31 }); 32 } 33 function fadeOutMainListItems(navElement, callback) { 34 const mainListItems = navElement.querySelectorAll("ul.menu > li"); 35 mainListItems.forEach((item, index) => { 36 item.style.opacity = "0"; 37 item.style.transform = "translateY(-8px)"; 38 item.style.transition = `opacity 0.2s ease-in-out ${index * 30}ms, transform 0.2s ease-in-out ${index * 30}ms`; 39 }); 40 setTimeout(() => { 41 if (typeof callback === "function") { 42 callback(); 43 } 44 }, 250); 45 } 46 function openMenu(navElement) { 47 if (!navElement) 48 return; 49 menu.classList.remove("hidden"); 50 backdrop.style.transform = "translateX(100%)"; 51 requestAnimationFrame(() => { 52 backdrop.style.transform = "translateX(0)"; 53 backdrop.style.opacity = ".8"; 54 }); 55 setTimeout(() => { 56 navElement.style.width = "66vw"; 57 navElement.style.maxWidth = "450px"; 58 }, 400); 59 setTimeout(() => { 60 fadeInMainListItems(navElement); 61 animateSVG(); 62 }, 600); 63 } 64 function closeMenu(navElement) { 65 if (!navElement) 66 return; 67 fadeOutMainListItems(navElement, () => { 68 navElement.style.width = "0"; 69 animateSVG(false); 70 setTimeout(() => { 71 backdrop.style.transform = "translateX(100%)"; 72 backdrop.style.opacity = "0"; 73 setTimeout(() => { 74 menu.classList.add("hidden"); 75 }, 150); 76 }, 300); 77 }); 78 } 79 if (burger.length) { 80 burger.forEach((btn) => { 81 btn.addEventListener("click", function() { 82 openMenu(side); 83 }); 84 }); 85 } 86 if (additionalBurger.length) { 87 additionalBurger.forEach((btn) => { 88 btn.addEventListener("click", function() { 89 openMenu(additional); 90 }); 91 }); 92 } 93 if (close.length) { 94 close.forEach((btn) => { 95 btn.addEventListener("click", function() { 96 closeMenu(side); 97 closeMenu(additional); 98 }); 99 }); 100 } 101 if (backdrop) { 102 backdrop.addEventListener("click", function() { 103 closeMenu(side); 104 closeMenu(additional); 105 }); 106 } 107 }); 108 function animateSVG(opening = true) { 109 const rects = document.querySelectorAll(".logo-icon rect"); 110 rects.forEach((rect, index) => { 111 const delay = opening ? index * 100 : (rects.length - index - 1) * 100; 112 rect.style.transition = `opacity 0.4s ease-in-out ${delay}ms`; 113 requestAnimationFrame(() => { 114 rect.style.opacity = opening ? "1" : "0"; 115 }); 116 }); 117 } 118 document.addEventListener("DOMContentLoaded", function() { 119 const closeButtons = document.querySelectorAll(".megamenu-close"); 120 closeButtons.forEach((button) => { 121 button.addEventListener("click", function(e) { 122 e.stopPropagation(); 123 const menuItem = button.closest(".menu-item-has-children"); 124 if (menuItem) { 125 menuItem.classList.add("megamenu-closed"); 126 } 127 }); 128 }); 129 const menuItems = document.querySelectorAll(".menu-item-has-children");
130 menuItems.forEach((item) => { 131 item.addEventListener("mouseleave", () => { 132 item.classList.remove("megamenu-closed"); 133 }); 134 }); 135 }); 136 document.addEventListener("DOMContentLoaded", function() { 137 var menuToggles = document.querySelectorAll(".menu-toggle"); 138 menuToggles.forEach(function(menuToggle) { 139 menuToggle.addEventListener("click", function() { 140 var parentElement = menuToggle.closest(".menu-item"); 141 parentElement.classList.toggle("open"); 142 }); 143 }); 144 var toggles = document.querySelectorAll(".mobile-menu-toggle"); 145 toggles.forEach(function(toggle) { 146 toggle.addEventListener("click", function() { 147 var subMenu = this.parentElement.querySelector(".sub-menu"); 148 subMenu.classList.toggle("open"); 149 this.classList.toggle("open"); 150 }); 151 }); 152 }); 153 var header = document.querySelector(".site-header"); 154 function toggleHeaderClass() { 155 if (window.scrollY > 50) { 156 header.classList.add("scroll"); 157 } else { 158 header.classList.remove("scroll"); 159 } 160 } 161 window.addEventListener("scroll", toggleHeaderClass); 162 document.addEventListener("DOMContentLoaded", toggleHeaderClass); 163 document.addEventListener("DOMContentLoaded", function() { 164 const megaMenuItems = document.querySelectorAll("#primary-menu li.mega"); 165 const siteHeader = document.querySelector("#site-header"); 166 if (megaMenuItems.length && siteHeader) { 167 megaMenuItems.forEach((item) => { 168 item.addEventListener("mouseenter", () => { 169 siteHeader.classList.add("menu-open"); 170 }); 171 item.addEventListener("mouseleave", () => { 172 siteHeader.classList.remove("menu-open"); 173 }); 174 }); 175 } 176 }); 177 document.addEventListener("DOMContentLoaded", function() { 178 const scrollLinks = document.querySelectorAll(".scroll-link a"); 179 for (let i = 0; i < scrollLinks.length; i++) { 180 scrollLinks[i].addEventListener("click", smoothScroll); 181 } 182 function smoothScroll(event) { 183 event.preventDefault(); 184 const targetId = this.getAttribute("href"); 185 const targetElement = document.querySelector(targetId); 186 targetElement.scrollIntoView({ 187 behavior: "smooth", 188 block: "start" 189 }); 190 } 191 }); 192 function checkElementsInView() { 193 var pageTop = window.pageYOffset; 194 var pageBottom = pageTop + window.innerHeight; 195 var animateElements = document.querySelectorAll( 196 '.animate[class*="animate-"]' 197 ); 198 animateElements.forEach(function(element) { 199 var elementTop = element.getBoundingClientRect().top + pageTop; 200 if (elementTop < pageBottom) { 201 element.classList.add("on"); 202 } else { 203 element.classList.remove("on"); 204 } 205 }); 206 } 207 document.addEventListener("DOMContentLoaded", function() { 208 checkElementsInView(); 209 }); 210 window.addEventListener("scroll", function() { 211 checkElementsInView(); 212 }); 213 function handleIntersection(entries, observer) { 214 entries.forEach((entry) => { 215 if (entry.isIntersecting) { 216 entry.target.classList.add("active"); 217 } else { 218 entry.target.classList.remove("active"); 219 } 220 }); 221 } 222 var observerviewport = new IntersectionObserver(handleIntersection, { 223 root: null, 224 // Use the viewport as the root 225 threshold: 1 226 // Trigger when 50% of the element is in the viewport 227 }); 228 var inViewportElements = document.querySelectorAll(".in-viewport"); 229 inViewportElements.forEach((element) => { 230 observerviewport.observe(element); 231 }); 232 document.addEventListener("click", function(e) { 233 const header2 = e.target.closest(".accordion-header"); 234 if (!header2) 235 return; 236 const item = header2.closest(".accordion-item"); 237 if (!item) 238 return; 239 const content = item.querySelector(".accordion-content"); 240 const accordionItems = item.parentElement.querySelectorAll(".accordion-item"); 241 accordionItems.forEach((otherItem) => { 242 if (otherItem !== item && otherItem.classList.contains("active")) { 243 otherItem.classList.remove("active"); 244 otherItem.querySelector(".accordion-content").style.height = 0; 245 } 246 }); 247 item.classList.toggle("active"); 248 if (item.classList.contains("active")) { 249 content.style.height = `${content.scrollHeight}px`; 250 } else { 251 content.style.height = 0; 252 } 253 }); 254 function _calculateScrollbarWidth() { 255 var hasScrollbar = window.innerWidth > document.documentElement.clientWidth; 256 document.body.classList.toggle("has-scrollbar", hasScrollbar); 257 document.documentElement.style.setProperty( 258 "--scrollbar-width", 259 (hasScrollbar ? window.innerWidth - document.documentElement.clientWidth : 0) + "px" 260 ); 261 } 262 window.addEventListener("resize", _calculateScrollbarWidth, false); 263 document.addEventListener("DOMContentLoaded", _calculateScrollbarWidth, false); 264 window.addEventListener("load", _calculateScrollbarWidth); 265 document.addEventListener("click", function(event) { 266 const dropdownTrigger = event.target.closest(".dropdown-trigger"); 267 const dropdownToggle = event.target.closest(".dropdown-toggle"); 268 if (!dropdownTrigger && !dropdownToggle) { 269 const allDropdowns = document.querySelectorAll( 270 ".dropdown-toggle.active" 271 ); 272 allDropdowns.forEach(function(dropdown) { 273 dropdown.classList.add("hidden"); 274 dropdown.classList.remove("active"); 275 }); 276 } 277 if (dropdownTrigger) { 278 const dropdownId = dropdownTrigger.getAttribute("data-dropdown-toggle"); 279 const dropdown = document.getElementById(dropdownId); 280 if (dropdown) { 281 dropdown.classList.toggle("hidden"); 282 dropdown.classList.toggle("active"); 283 } 284 } 285 }); 286 var counters = document.querySelectorAll(".counter"); 287 var options = { 288 threshold: 0.5 289 // Trigger when 50% of the element is visible 290 }; 291 var intersectionObserver = new IntersectionObserver((entries, observer) => {
292 entries.forEach((entry) => { 293 if (entry.isIntersecting) { 294 const target = entry.target; 295 const count = target.getAttribute("data-count"); 296 const span = target.querySelector(".number"); 297 const startCount = 0; 298 const endCount = parseInt(count); 299 const duration = 1e3; 300 const difference = endCount - startCount; 301 const interval = duration / difference; 302 let currentCount = startCount; 303 const timer = setInterval(() => { 304 currentCount += 1; 305 span.textContent = currentCount; 306 if (currentCount === endCount) { 307 clearInterval(timer); 308 } 309 }, interval); 310 observer.unobserve(target); 311 } 312 }); 313 }, options); 314 if (counters.length > 0) { 315 counters.forEach((counter) => { 316 intersectionObserver.observe(counter); 317 }); 318 } 319 document.addEventListener("DOMContentLoaded", function() { 320 const sliders = document.querySelectorAll(".gallery-slider"); 321 if (!sliders.length) 322 return; 323 sliders.forEach(function(slider) { 324 const $slider = jQuery(slider); 325 const $wrapper = $slider.closest(".gallery-wrapper"); 326 const $arrows = $wrapper.find(".arrows"); 327 const $dots = $wrapper.find(".dots"); 328 $slider.on("init", function(event, slick) { 329 $slider.find(".slick-cloned [data-fancybox]").each(function() { 330 this.removeAttribute("data-fancybox"); 331 this.removeAttribute("data-caption"); 332 this.removeAttribute("href"); 333 }); 334 }); 335 $slider.on("beforeChange", function(event, slick) { 336 $slider.find(".slick-slide").each(function() { 337 const $slide = jQuery(this); 338 const $iframe = $slide.find("iframe"); 339 if ($iframe.length && !$slide.hasClass("slick-active")) { 340 const src = $iframe.attr("src"); 341 if (src) 342 $iframe.attr("src", src); 343 } 344 }); 345 }); 346 $slider.slick({ 347 infinite: true, 348 slidesToShow: 1, 349 autoplay: true, 350 slidesToScroll: 1, 351 arrows: true, 352 dots: true, 353 rows: false, 354 appendArrows: $arrows.length ? $arrows : void 0, 355 appendDots: $dots.length ? $dots : void 0, 356 prevArrow: '<svg class="slick-prev text-white hover:text-accent" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" transform="matrix(-1 0 0 1 42.8086 0)" fill="currentColor"/><path d="M13.2315 21.793L20.7315 17.4628L20.7315 26.1231L13.2315 21.793ZM30.355 22.543L19.9815 22.543L19.9815 21.043L30.355 21.043L30.355 22.543Z" fill="black"/></svg>', 357 nextArrow: '<svg class="slick-next text-white hover:text-accent" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" fill="currentColor"/><path d="M29.5766 21.793L22.0766 17.4628L22.0766 26.1231L29.5766 21.793ZM12.4531 22.543L22.8266 22.543L22.8266 21.043L12.4531 21.043L12.4531 22.543Z" fill="black"/></svg>' 358 }); 359 }); 360 if (window.Fancybox) { 361 Fancybox.bind("[data-fancybox]", { 362 on: { 363 reveal: () => { 364 jQuery(".gallery-slider").each(function() { 365 const $s = jQuery(this); 366 if ($s.hasClass("slick-initialized")) 367 $s.slick("slickPause"); 368 }); 369 }, 370 destroy: () => { 371 jQuery(".gallery-slider").each(function() { 372 const $s = jQuery(this); 373 if ($s.hasClass("slick-initialized")) 374 $s.slick("slickPlay"); 375 }); 376 } 377 } 378 }); 379 } 380 }); 381 document.addEventListener("DOMContentLoaded", function() { 382 var heroSlider = document.querySelector(".hero-slider"); 383 if (heroSlider) { 384 jQuery(heroSlider).slick({ 385 infinite: true, 386 slidesToShow: 1, 387 autoplay: true, 388 autoplaySpeed: 4e3, 389 slidesToScroll: 1, 390 fade: true, 391 arrows: false, 392 dots: true, 393 appendDots: jQuery(".hero .dots") 394 }); 395 } 396 }); 397 document.addEventListener("DOMContentLoaded", function() { 398 var glassSlider = document.querySelector(".glass-slider"); 399 if (glassSlider) { 400 var $glassSlider = jQuery(glassSlider); 401 $glassSlider.slick({ 402 infinite: true, 403 slidesToShow: 4, 404 slidesToScroll: 1, 405 arrows: true, 406 dots: false, 407 appendArrows: $glassSlider.parents(".related-sytems").find(".slider-arrows"), 408 prevArrow: '<svg class="slick-prev text-accent hover:text-gray" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" transform="matrix(-1 0 0 1 42.8086 0)" fill="currentColor"/><path d="M13.2315 21.793L20.7315 17.4628L20.7315 26.1231L13.2315 21.793ZM30.355 22.543L19.9815 22.543L19.9815 21.043L30.355 21.043L30.355 22.543Z" fill="black"/></svg>', 409 nextArrow: '<svg class="slick-next text-accent hover:text-gray" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" fill="currentColor"/><path d="M29.5766 21.793L22.0766 17.4628L22.0766 26.1231L29.5766 21.793ZM12.4531 22.543L22.8266 22.543L22.8266 21.043L12.4531 21.043L12.4531 22.543Z" fill="black"/></svg>', 410 responsive: [ 411 { 412 breakpoint: 1024, 413 settings: { 414 slidesToShow: 3 415 } 416 }, 417 { 418 breakpoint: 768, 419 settings: { 420 slidesToShow: 2 421 } 422 } 423 ] 424 }); 425 } 426 }); 427 document.addEventListener("DOMContentLoaded", function() { 428 var glassSlider = document.querySelector(".projects-slider"); 429 if (glassSlider) { 430 var $glassSlider = jQuery(glassSlider); 431 $glassSlider.slick({ 432 infinite: true, 433 slidesToShow: 2, 434 autoplay: true, 435 autoplaySpeed: 3e3, 436 slidesToScroll: 1, 437 arrows: true, 438 dots: false, 439 appendArrows: $glassSlider.parents(".related-projects").find(".slider-arrows"), 440 prevArrow: '<svg class="slick-prev text-accent hover:text-gray" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" transform="matrix(-1 0 0 1 42.8086 0)" fill="currentColor"/><path d="M13.2315 21.793L20.7315 17.4628L20.7315 26.1231L13.2315 21.793ZM30.355 22.543L19.9815 22.543L19.9815 21.043L30.355 21.043L30.355 22.543Z" fill="black"/></svg>', 441 nextArrow: '<svg class="slick-next text-accent hover:text-gray" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" fill="currentColor"/><path d="M29.5766 21.793L22.0766 17.4628L22.0766 26.1231L29.5766 21.793ZM12.4531 22.543L22.8266 22.543L22.8266 21.043L12.4531 21.043L12.4531 22.543Z" fill="black"/></svg>', 442 responsive: [ 443 { 444 breakpoint: 768, 445 settings: { 446 slidesToShow: 1 447 } 448 } 449 ] 450 }); 451 } 452 }); 453 document.addEventListener("DOMContentLoaded", function() { 454 var glassSlider = document.querySelector(".products-slider"); 455 if (glassSlider) { 456 var $glassSlider = jQuery(glassSlider); 457 $glassSlider.slick({ 458 infinite: true, 459 slidesToShow: 4, 460 autoplay: true, 461 autoplaySpeed: 3e3, 462 slidesToScroll: 1, 463 arrows: true, 464 dots: false, 465 appendArrows: $glassSlider.parents(".related-products").find(".slider-arrows"), 466 prevArrow: '<svg class="slick-prev text-accent hover:text-gray" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" transform="matrix(-1 0 0 1 42.8086 0)" fill="currentColor"/><path d="M13.2315 21.793L20.7315 17.4628L20.7315 26.1231L13.2315 21.793ZM30.355 22.543L19.9815 22.543L19.9815 21.043L30.355 21.043L30.355 22.543Z" fill="black"/></svg>', 467 nextArrow: '<svg class="slick-next text-accent hover:text-gray" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" fill="currentColor"/><path d="M29.5766 21.793L22.0766 17.4628L22.0766 26.1231L29.5766 21.793ZM12.4531 22.543L22.8266 22.543L22.8266 21.043L12.4531 21.043L12.4531 22.543Z" fill="black"/></svg>', 468 responsive: [ 469 { 470 breakpoint: 768, 471 settings: { 472 slidesToShow: 1 473 } 474 } 475 ] 476 }); 477 } 478 }); 479 (function() {
480 const overlay = document.getElementById("video-popup-overlay"); 481 const iframeWrap = document.getElementById("video-popup-iframe-container"); 482 const container = document.getElementById("video-popup-container"); 483 const closeBtn = document.getElementById("video-popup-close"); 484 const iframe = document.getElementById("video-popup-iframe"); 485 if (!overlay || !iframeWrap || !container || !closeBtn || !iframe) { 486 return; 487 } 488 function openVideo(triggerEl) { 489 overlay.style.display = "block"; 490 iframeWrap.style.display = "block"; 491 container.style.display = "block"; 492 closeBtn.style.display = "block"; 493 console.log("triggered"); 494 const type = triggerEl.getAttribute("data-type"); 495 const id = triggerEl.getAttribute("data-id") || ""; 496 const autoplay = triggerEl.getAttribute("data-autoplay") === "true" ? "?autoplay=1" : ""; 497 let base = ""; 498 if (type === "vimeo") 499 base = "//player.vimeo.com/video/"; 500 else if (type === "youtube") 501 base = "https://www.youtube.com/embed/"; 502 iframe.src = base + id + autoplay; 503 } 504 function closeVideo() { 505 iframeWrap.style.display = "none"; 506 container.style.display = "none"; 507 closeBtn.style.display = "none"; 508 overlay.style.display = "none"; 509 iframe.src = ""; 510 } 511 document.addEventListener("click", function(e) { 512 const trigger = e.target.closest(".vpop"); 513 if (!trigger) 514 return; 515 e.preventDefault(); 516 openVideo(trigger); 517 }); 518 closeBtn.addEventListener("click", closeVideo); 519 overlay.addEventListener("click", closeVideo); 520 document.addEventListener("facetwp-loaded", function() { 521 }); 522 })(); 523 jQuery(function($) { 524 $(document).on("facetwp-refresh", function() { 525 $(".facetwp-template.grid").css("opacity", "0"); 526 $(".facetwp-loader").fadeIn(); 527 }); 528 $(document).on("facetwp-loaded", function() { 529 setTimeout(function() { 530 $(".facetwp-loader").fadeOut(400, function() { 531 $(".facetwp-template.grid").css("opacity", "1"); 532 $(".facetwp-template.grid > article").each(function(i) { 533 $(this).css("opacity", "0").delay(i * 120).animate({ opacity: 1 }, 350); 534 }); 535 }); 536 }, 600); 537 }); 538 }); 539 jQuery(function($) { 540 function toggleChannelGlassClass() { 541 const systemsFilter = $(".facetwp-facet-systems_filter"); 542 if (systemsFilter.length === 0) 543 return; 544 const channelGlassSelected = systemsFilter.find('.fs-option[data-value="251891"].selected').length > 0; 545 if (channelGlassSelected) { 546 systemsFilter.addClass("has-channel-glass-selected"); 547 } else { 548 systemsFilter.removeClass("has-channel-glass-selected"); 549 } 550 } 551 toggleChannelGlassClass(); 552 $(document).on("facetwp-loaded", toggleChannelGlassClass); 553 $(document).on( 554 "click", 555 ".facetwp-facet-systems_filter .fs-option", 556 function() { 557 setTimeout(toggleChannelGlassClass, 100); 558 } 559 ); 560 }); 561 jQuery(function($) { 562 function isElementInViewport(el) { 563 var rect = el.getBoundingClientRect(); 564 return rect.top < window.innerHeight - 150 && rect.bottom > 0; 565 } 566 function animateGridItems() { 567 $(".animated-grid-reveal > *").each(function(i) { 568 var $item = $(this); 569 if (isElementInViewport(this) && !$item.hasClass("animated")) { 570 $item.addClass("animated").delay(i * 60).animate({ opacity: 1 }, 180); 571 } 572 }); 573 } 574 $(window).on("scroll", function() { 575 animateGridItems(); 576 }); 577 $(document).ready(function() { 578 animateGridItems(); 579 }); 580 }); 581 document.addEventListener("DOMContentLoaded", function() { 582 document.querySelectorAll('a[href^="#"]').forEach((anchor) => { 583 anchor.addEventListener("click", function(event) { 584 event.preventDefault(); 585 var target = document.querySelector(this.getAttribute("href")); 586 var header2 = document.querySelector("#site-header"); 587 var headerHeight = header2 ? header2.offsetHeight : 0; 588 if (target) { 589 window.scrollTo({ 590 top: target.offsetTop - headerHeight, 591 behavior: "smooth" 592 }); 593 } 594 }); 595 }); 596 }); 597 document.addEventListener("DOMContentLoaded", function() { 598 const preloadData = JSON.parse( 599 document.getElementById("preloaded-projects")?.textContent || "{}" 600 ); 601 const hoverTimers = /* @__PURE__ */ new Map(); 602 document.querySelectorAll("#primary-menu .wp-block-navigation__container a").forEach((link) => { 603 link.addEventListener("mouseenter", function() { 604 const href = this.href.replace(/\/$/, ""); 605 if (!href) 606 return; 607 clearTimeout(hoverTimers.get(link)); 608 const timer = setTimeout(() => { 609 let filterType = null; 610 if (href.includes("/glass/")) 611 filterType = "glass"; 612 else if (href.includes("/system/")) 613 filterType = "system"; 614 else if (href.includes("/application/")) 615 filterType = "application"; 616 else if (href.includes("/industry/")) 617 filterType = "industry"; 618 if (!filterType) 619 return; 620 const container = document.querySelector( 621 `.hover-projects-container[data-filter="${filterType}"]` 622 ); 623 if (!container) 624 return; 625 container.style.opacity = 0; 626 setTimeout(() => {
627 if (preloadData[href]) { 628 container.innerHTML = preloadData[href]; 629 } else { 630 container.innerHTML = "<p>No projects found.</p>"; 631 } 632 container.style.opacity = 1; 633 }, 150); 634 }, 150); 635 hoverTimers.set(link, timer); 636 }); 637 }); 638 }); 639 document.addEventListener("DOMContentLoaded", function() { 640 const wrapper = document.querySelectorAll(".expandable-search"); 641 wrapper.forEach((el) => { 642 const btn = el.querySelector(".search-toggle"); 643 const input = el.querySelector(".search-field"); 644 btn.addEventListener("click", function(e) { 645 e.preventDefault(); 646 e.stopPropagation(); 647 el.classList.toggle("active"); 648 if (el.classList.contains("active")) { 649 input.focus(); 650 } 651 }); 652 document.addEventListener("click", function(e) { 653 if (!el.contains(e.target) && el.classList.contains("active")) { 654 el.classList.remove("active"); 655 } 656 }); 657 input.addEventListener("keydown", function(e) { 658 if (e.key === "Escape" && el.classList.contains("active")) { 659 el.classList.remove("active"); 660 } 661 }); 662 }); 663 }); 664 jQuery(function($) { 665 var $carousels = $(".js-top-carousel"); 666 if (!$carousels.length) 667 return; 668 $carousels.each(function() { 669 var $el = $(this); 670 $el.on("init", function(event, slick) { 671 $el.find(".slick-cloned [data-fancybox]").each(function() { 672 this.removeAttribute("data-fancybox"); 673 this.removeAttribute("data-caption"); 674 this.removeAttribute("href"); 675 }); 676 $(slick.$slides).each(function() { 677 controlVideo2($(this), "pause"); 678 }); 679 controlVideo2($(slick.$slides[slick.currentSlide]), "play"); 680 }); 681 $el.slick({ 682 arrows: true, 683 dots: true, 684 infinite: true, 685 autoplay: true, 686 autoplaySpeed: 4e3, 687 slidesToShow: 1, 688 slidesToScroll: 1, 689 adaptiveHeight: true, 690 prevArrow: '<svg class="slick-prev text-white hover:text-accent" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" transform="matrix(-1 0 0 1 42.8086 0)" fill="currentColor"/><path d="M13.2315 21.793L20.7315 17.4628L20.7315 26.1231L13.2315 21.793ZM30.355 22.543L19.9815 22.543L19.9815 21.043L30.355 21.043L30.355 22.543Z" fill="black"/></svg>', 691 nextArrow: '<svg class="slick-next text-white hover:text-accent" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" fill="currentColor"/><path d="M29.5766 21.793L22.0766 17.4628L22.0766 26.1231L29.5766 21.793ZM12.4531 22.543L22.8266 22.543L22.8266 21.043L12.4531 21.043L12.4531 22.543Z" fill="black"/></svg>' 692 }); 693 function controlVideo2($slide, action) { 694 var $iframe = $slide.find("iframe"); 695 if (!$iframe.length) 696 return; 697 var provider = $iframe.data("provider"); 698 if (provider === "youtube") { 699 $iframe[0].contentWindow.postMessage( 700 JSON.stringify({ 701 event: "command", 702 func: action === "play" ? "playVideo" : "pauseVideo", 703 args: [] 704 }), 705 "*" 706 ); 707 } 708 if (provider === "vimeo") { 709 $iframe[0].contentWindow.postMessage( 710 { method: action === "play" ? "play" : "pause" }, 711 "*" 712 ); 713 } 714 } 715 $el.on("beforeChange", function(event, slick, currentSlide) { 716 controlVideo2($(slick.$slides[currentSlide]), "pause"); 717 }); 718 $el.on("afterChange", function(event, slick, currentSlide) { 719 controlVideo2($(slick.$slides[currentSlide]), "play"); 720 }); 721 }); 722 if (window.Fancybox) { 723 Fancybox.bind("[data-fancybox]", { 724 on: { 725 reveal: () => { 726 $carousels.each(function() { 727 var slick = $(this).slick("getSlick"); 728 if (!slick) 729 return; 730 $(this).slick("slickPause"); 731 var $current = $(slick.$slides[slick.currentSlide]); 732 controlVideo($current, "pause"); 733 }); 734 }, 735 destroy: () => { 736 $carousels.each(function() { 737 var slick = $(this).slick("getSlick"); 738 if (!slick) 739 return; 740 $(this).slick("slickPlay"); 741 var $current = $(slick.$slides[slick.currentSlide]); 742 controlVideo($current, "play"); 743 }); 744 } 745 } 746 }); 747 } 748 function controlVideo($slide, action) {
749 var $iframe = $slide.find("iframe"); 750 if (!$iframe.length) 751 return; 752 var provider = $iframe.data("provider"); 753 if (provider === "youtube") { 754 $iframe[0].contentWindow.postMessage( 755 JSON.stringify({ 756 event: "command", 757 func: action === "play" ? "playVideo" : "pauseVideo", 758 args: [] 759 }), 760 "*" 761 ); 762 } 763 if (provider === "vimeo") { 764 $iframe[0].contentWindow.postMessage( 765 { method: action === "play" ? "play" : "pause" }, 766 "*" 767 ); 768 } 769 } 770 }); 771 function initThumbnailSlider() { 772 const thumbContainer = document.querySelector(".flex-control-thumbs"); 773 if (!thumbContainer) { 774 return; 775 } 776 if (thumbContainer.classList.contains("slick-initialized")) { 777 return; 778 } 779 const thumbs = thumbContainer.querySelectorAll("li"); 780 const totalThumbs = thumbs.length; 781 if (totalThumbs <= 3) { 782 return; 783 } 784 jQuery(thumbContainer).slick({ 785 slidesToShow: 3, 786 slidesToScroll: 1, 787 infinite: false, 788 arrows: true, 789 dots: true, 790 prevArrow: '<svg class="slick-prev text-accent" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" transform="matrix(-1 0 0 1 42.8086 0)" fill="currentColor"/><path d="M13.2315 21.793L20.7315 17.4628L20.7315 26.1231L13.2315 21.793ZM30.355 22.543L19.9815 22.543L19.9815 21.043L30.355 21.043L30.355 22.543Z" fill="black"/></svg>', 791 nextArrow: '<svg class="slick-next text-accent" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43" fill="none"><circle cx="21.4044" cy="21.4044" r="21.4044" fill="currentColor"/><path d="M29.5766 21.793L22.0766 17.4628L22.0766 26.1231L29.5766 21.793ZM12.4531 22.543L22.8266 22.543L22.8266 21.043L12.4531 21.043L12.4531 22.543Z" fill="black"/></svg>', 792 responsive: [ 793 { 794 breakpoint: 768, 795 settings: { 796 slidesToShow: 2, 797 slidesToScroll: 1 798 } 799 }, 800 { 801 breakpoint: 480, 802 settings: { 803 slidesToShow: 1, 804 slidesToScroll: 1 805 } 806 } 807 ] 808 }); 809 function syncMainGallery(slideIndex) { 810 const thumbnails = document.querySelectorAll(".flex-control-thumbs li"); 811 if (thumbnails[slideIndex]) { 812 const mainThumbnail = thumbnails[slideIndex]; 813 const mainThumbnailLink = mainThumbnail.querySelector("a"); 814 if (mainThumbnailLink) { 815 mainThumbnailLink.click(); 816 } else { 817 } 818 } else { 819 } 820 } 821 jQuery(thumbContainer).on( 822 "afterChange", 823 function(event, slick, currentSlide) { 824 syncMainGallery(currentSlide); 825 } 826 ); 827 jQuery(thumbContainer).on("click", "li", function(e) { 828 e.preventDefault(); 829 const slideIndex = jQuery(this).attr("data-slick-index"); 830 if (slideIndex !== void 0) { 831 syncMainGallery(parseInt(slideIndex)); 832 } else { 833 const currentSlide = jQuery(thumbContainer).slick("slickCurrentSlide"); 834 syncMainGallery(currentSlide); 835 } 836 }); 837 } 838 document.addEventListener("DOMContentLoaded", function() { 839 initThumbnailSlider(); 840 setTimeout(initThumbnailSlider, 1e3); 841 setTimeout(initThumbnailSlider, 2e3); 842 initVideoPosters(); 843 initAccountModal(); 844 }); 845 function initVideoPosters() { 846 const videoPosters = document.querySelectorAll(".video-poster"); 847 videoPosters.forEach((poster) => { 848 const videoType = poster.getAttribute("data-video-type"); 849 const videoId = poster.getAttribute("data-video-id"); 850 const videoTitle = poster.getAttribute("data-video-title"); 851 const fancyboxGroup = poster.getAttribute("data-fancybox"); 852 if (videoType && videoId) { 853 let iframeSrc = ""; 854 if (videoType === "youtube") { 855 iframeSrc = `https://www.youtube.com/embed/${videoId}?enablejsapi=1&rel=0&controls=1&mute=0&playsinline=1&autoplay=1`; 856 } else if (videoType === "vimeo") { 857 iframeSrc = `https://player.vimeo.com/video/${videoId}?api=1&muted=0&autoplay=1`; 858 } 859 if (iframeSrc) { 860 const link = document.createElement("a"); 861 link.href = iframeSrc; 862 link.setAttribute("data-fancybox", fancyboxGroup || "images"); 863 link.setAttribute("data-caption", videoTitle || ""); 864 link.setAttribute("data-type", "iframe"); 865 link.className = poster.className; 866 link.innerHTML = poster.innerHTML; 867 poster.parentNode.replaceChild(link, poster); 868 } 869 } 870 }); 871 } 872 function initAccountModal() { 873 setTimeout(function() { 874 const modalTriggers = document.querySelectorAll( 875 '[data-fancybox="account-modal"]' 876 ); 877 const modalOverlay = document.getElementById("modal-overlay"); 878 const modalContainer = document.getElementById("modal-container"); 879 const modalClose = document.getElementById("modal-close"); 880 if (modalTriggers.length > 0 && modalOverlay) { 881 let showModal2 = function() { 882 modalOverlay.style.display = "block"; 883 modalContainer.style.display = "block"; 884 setTimeout(function() { 885 const usernameField = document.querySelector("#user_login"); 886 const passwordField = document.querySelector("#user_pass"); 887 if (usernameField && !usernameField.getAttribute("placeholder")) { 888 usernameField.setAttribute( 889 "placeholder", 890 "Username or Email" 891 ); 892 } 893 if (passwordField && !passwordField.getAttribute("placeholder")) { 894 passwordField.setAttribute("placeholder", "Password"); 895 } 896 }, 50); 897 setTimeout(function() { 898 modalOverlay.classList.add("show"); 899 modalContainer.classList.add("show"); 900 }, 10); 901 document.body.style.overflow = "hidden"; 902 }, hideModal2 = function() { 903 modalOverlay.classList.remove("show"); 904 modalContainer.classList.remove("show"); 905 setTimeout(function() { 906 modalOverlay.style.display = "none"; 907 modalContainer.style.display = "none"; 908 document.body.style.overflow = ""; 909 }, 300); 910 }; 911 var showModal = showModal2, hideModal = hideModal2;
912 modalTriggers.forEach(function(trigger) { 913 trigger.addEventListener("click", function(e) { 914 e.preventDefault(); 915 showModal2(); 916 }); 917 }); 918 if (modalClose) { 919 modalClose.addEventListener("click", hideModal2); 920 } 921 modalOverlay.addEventListener("click", function(e) { 922 if (e.target === modalOverlay) { 923 hideModal2(); 924 } 925 }); 926 document.addEventListener("keydown", function(e) { 927 if (e.key === "Escape" && modalOverlay.classList.contains("show")) { 928 hideModal2(); 929 } 930 }); 931 } 932 }, 1e3); 933 } 934})();
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.