1$(function () { 2 let Body = $("body"); 3 4 // Body.addClass('preloader-site'); 5 6 /** 7 * Viewport height snip for Home page Krono slider 8 */ 9 10 // First we get the viewport height and we multiple it by 1% to get a value for a vh unit 11 // let vh = window.innerHeight * 0.01; 12 // // Then we set the value in the --vh custom property to the root of the document 13 // document.documentElement.style.setProperty("--vh", vh + "px"); 14 15 // window.addEventListener("resize", function () { 16 // let vh = window.innerHeight * 0.01; 17 // // document.documentElement.style.setProperty('--vh', vh + 'px'); 18 // }); 19 20 /* Show International tab */ 21 $(document).on("click", ".international, .cr-close", function () { 22 if ($(window).width() + 17 > 961) { 23 $(".internationalization-tab").toggleClass("hover"); 24 } 25 }); 26 27 $(document).on("click", function (event) { 28 if (!$(event.target).closest(".internationalization-tab, .international, .cr-close").length) { 29 $(".internationalization-tab").removeClass("hover"); 30 } 31 }); 32 33 $(".internationalization-section .language").on("click", function () { 34 if ($(window).width() + 17 > 961) { 35 $(".internationalization-tab").toggleClass("hover"); 36 } 37 }); 38 39 $(".add-prod-btn").magnificPopup({ 40 type: "image", 41 }); 42 43 $(".add-prod-btn1").magnificPopup({ 44 type: "image", 45 gallery: { 46 enabled: true, 47 navigateByImgClick: true, 48 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 49 tPrev: "Previous (Left arrow key)", 50 tNext: "Next (Right arrow key)", 51 tCounter: "", 52 }, 53 zoom: { 54 enabled: true, 55 duration: 300, 56 easing: "ease-in-out", 57 }, 58 }); 59 60 $(".add-prod-btn2").magnificPopup({ 61 type: "image", 62 gallery: { 63 enabled: true, 64 navigateByImgClick: true, 65 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 66 tPrev: "Previous (Left arrow key)", 67 tNext: "Next (Right arrow key)", 68 tCounter: "", 69 }, 70 zoom: { 71 enabled: true, 72 duration: 300, 73 easing: "ease-in-out", 74 }, 75 }); 76 77 $(".add-prod-btn3").magnificPopup({ 78 type: "image", 79 gallery: { 80 enabled: true, 81 navigateByImgClick: true, 82 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 83 tPrev: "Previous (Left arrow key)", 84 tNext: "Next (Right arrow key)", 85 tCounter: "", 86 }, 87 zoom: { 88 enabled: true, 89 duration: 300, 90 easing: "ease-in-out", 91 }, 92 }); 93 94 /* 95 setTimeout( 96 function () { 97 $('.collapse').collapse(); 98 }, 125); 99*/ 100 /*Slider*/ 101 $(".carousel").carousel({ 102 interval: false, 103 }); 104 105 $("#home-slider-prev").on("click", function () { 106 $(".carousel").carousel("prev"); 107 }); 108 109 $("#home-slider-next").on("click", function () { 110 $(".carousel").carousel("next"); 111 }); 112 113 /* Show Searchbar */ 114 /* 115 $('header .switchers .search-icon-class, header.sticky .switchers .search-icon-class').click(function () { 116 $('.search-bar-widget').toggleClass('active'); 117 setTimeout( 118 function () { 119 $('.internationalization-section .account-header').css('left', '-4rem'); 120 }, 125); 121 setTimeout(function() { $('input[name="q"]').focus() }, 500); 122 }) 123 */ 124 125 $(".search-bar-widget .search-icon-input").on("click", function () { 126 $(".search-bar-widget").toggleClass("active"); 127 // $('.internationalization-section .account-header').css('left', '0'); 128 }); 129 130 /* Close search input */ 131 132 $(".search-bar-widget .search-close-btn").on("click", function () { 133 $(".search-bar-widget").toggleClass("active"); 134 // $('.internationalization-section .account-header').css('left', '0'); 135 }); 136 137 /* Megamenu */ 138 /* Show the whole menu */ 139 $(".megamenu > div > div").on("mouseenter", function () { 140 $(".mega-submenu").addClass("hover"); 141 }); 142 143 $(".mega-submenu").on("mouseleave", function () { 144 resetMegaSubmenu(); 145 }); 146 147 // Add a scroll event listener to ensure the height is reset when scrolling 148 $(window).on("scroll", function () { 149 if ($(".mega-submenu").hasClass("hover")) { 150 resetMegaSubmenu(); 151 } 152 }); 153 154 // Function to reset the mega submenu 155 function resetMegaSubmenu() { 156 $(".mega-submenu").removeClass("hover"); 157 $(".mega-submenu").css("height", "0"); 158 $(".mega-submenu > div").removeClass("hover"); 159 } 160 161 /* Move to next section */ 162 $(".scroll-arrow").on("click", function () { 163 let element; 164 if ($(".featured-products.section").length) { 165 element = $(".featured-products.section"); 166 } else if ($(".highlights.section").length) { 167 element = $(".highlights.section"); 168 } else { 169 element = $(".case-studies.section"); 170 } 171 172 $([document.documentElement, document.body]).animate( 173 { 174 scrollTop: element.offset().top - 20, 175 }, 176 500, 177 ); 178 }); 179 180 /* Sidebar */ 181 182 $(".closesidebar").on("click", function () { 183 closeSidebar(); 184 }); 185 186 $(".close-sidebar-section").on("click", function () { 187 closeSidebar(); 188 }); 189 190 function closeSidebar() { 191 $("#sidebar").addClass("sidebar-closing"); 192 setTimeout(function () { 193 $("body").removeClass("sidebar-opened"); 194 $("#sidebar").removeClass("sidebar-closing"); 195 $("#sidebar").removeClass("active"); 196 }, 300); 197 setTimeout(function () { 198 $("#sidebar .sidebar-wrapper-content") 199 .find(">div") 200 .each(function () { 201 if (!$(this).hasClass("sidebar-mobile-header")) { 202 $(this).addClass("d-none"); 203 } 204 }); 205 $("#sidebar").removeClass("full-width-sidebar"); 206 }, 500); 207 } 208 209 $(document).on("click", ".opensidebar", function () { 210 $("body").addClass("sidebar-opened"); 211 let sidebar = $(this).attr("data-sidebar"); 212 let additional = $(this).attr("data-sidebar-additional"); 213 $("#sidebar .sidebar-wrapper-content").removeClass("active"); 214 $("#sidebar .sidebar-wrapper-content") 215 .find(">div") 216 .each(function () { 217 if (!$(this).hasClass("sidebar-mobile-header")) { 218 $(this).addClass("d-none"); 219 } 220 }); 221 222 if (additional != "false") { 223 $("#sidebar-additional-content").removeClass("d-none"); 224 } 225 if (sidebar == "projects") { 226 openProjFilters(); 227 } 228 if (sidebar == "express") { 229 openExpressFilters(); 230 } 231 if (sidebar == "decors") { 232 openDecorFilters(); 233 } 234 if (sidebar == "project-gallery") { 235 openProjGallery(); 236 } 237 238 if (sidebar == "digital-library") { 239 openDigitalLibrary();
240 } 241 242 if (sidebar == "main") { 243 openMainSidebar(); 244 } 245 }); 246 247 function openProjFilters() { 248 $("#sidebar").addClass("active"); 249 $("#sidebar").addClass("full-width-sidebar"); 250 $("#mobile-project-filters").removeClass("d-none"); 251 $(".mCustomScrollbar-filters").mCustomScrollbar({ 252 theme: "dark", 253 }); 254 } 255 256 function openExpressFilters() { 257 $("#sidebar").addClass("active"); 258 $("#sidebar").addClass("full-width-sidebar"); 259 $("#mobile-express-filters").removeClass("d-none"); 260 $(".mCustomScrollbar-filters").mCustomScrollbar({ 261 theme: "dark", 262 }); 263 } 264 265 function openDecorFilters() { 266 $("#sidebar").addClass("active"); 267 $("#sidebar").addClass("full-width-sidebar"); 268 $("#mobile-decor-filters").removeClass("d-none"); 269 $(".mCustomScrollbar-filters").mCustomScrollbar({ 270 theme: "dark", 271 }); 272 } 273 274 function openProjGallery() { 275 $("#sidebar").addClass("active"); 276 $("#sidebar").addClass("full-width-sidebar full-width"); 277 $("#mobile-project-gallery").removeClass("d-none"); 278 } 279 280 function openDigitalLibrary() { 281 $("#sidebar").addClass("active"); 282 $("#sidebar").addClass("full-width-sidebar"); 283 $("#mobile-digital-library-filters").removeClass("d-none"); 284 $(".mCustomScrollbar-filters").mCustomScrollbar({ 285 theme: "dark", 286 }); 287 } 288 289 function openMainSidebar() { 290 $("#sidebar").addClass("active"); 291 $("#main-sidebar").removeClass("d-none"); 292 } 293 294 // $(".social-right-side-text").on("click", function () { 295 // let offSet = 112; 296 // let textHeight = $(".text-wrap-subs").outerHeight(true); 297 // offSet += textHeight; 298 // if ($(".extra-newsletter-form").hasClass("is-hidden")) { 299 // $(".extra-newsletter-form").removeClass("is-hidden"); 300 // $(".extra-newsletter-form").height(offSet); 301 // } else { 302 // $(".extra-newsletter-form").addClass("is-hidden"); 303 // $(".extra-newsletter-form").height(0); 304 // } 305 306 // $("html, body").animate({ scrollTop: "+=330px" }, "slow"); 307 // }); 308 309 $(document).on("scroll", function () { 310 var ht = 0; 311 if ($(window).width() <= 480) { 312 hT = $("#mobile-footer").offset().top; 313 } else { 314 hT = $("#homepage-footer").offset().top; 315 } 316 317 let wH = $(window).height(), 318 wS = $(this).scrollTop(), 319 lS = wS + wH; 320 321 if (lS > hT) { 322 let zero = lS - hT; 323 if (zero > 0) { 324 $("#back-to-top").css("bottom", zero + 25); 325 } 326 } else { 327 $("#back-to-top").css("bottom", 45); 328 } 329 330 if ($(document).scrollTop() > 500) { 331 $("#back-to-top").css("display", "block"); 332 } else { 333 $("#back-to-top").css("display", "none"); 334 } 335 }); 336 337 /* Back to top */ 338 339 $("#back-to-top").css("display", "none"); 340 341 $("#back-to-top").click(function () { 342 $("html,body").animate( 343 { 344 scrollTop: 0, 345 }, 346 700, 347 ); 348 }); 349 350 $(function () { 351 $('[data-toggle="tooltip"]').tooltip({ 352 container: "body", 353 }); 354 }); 355 356 var countryId = "4"; 357 358 $(".country-column li." + countryId).addClass("shown"); 359 360 $(".country-list a").on("click", function () { 361 $(".country-list a").removeClass("active"); 362 $(this).addClass("active"); 363 countryId = $(this).attr("country-id"); 364 $(".country-column li").removeClass("shown"); 365 $(".country-column li." + countryId).addClass("shown"); 366 }); 367 368 //Filter open on click 369 var lenI = $("#main_filter .filter-cat-name-wrap").length; 370 $("#main_filter .filter-cat-name-wrap").click(function () { 371 var curI = $(this).attr("index"); 372 373 for (i = 1; i <= lenI; i++) { 374 if (i == curI) { 375 $('#main_filter .filter-content[index="' + curI + '"]').toggleClass("active-filter"); 376 } else { 377 $('#main_filter .filter-content[index="' + i + '"]').removeClass("active-filter"); 378 } 379 } 380 }); 381 382 // Downloads page collapse 383 384 $(document).on("click", ".dl-filter-w-dropdown h2", function () { 385 var thisParent = $(this).parent().parent().parent(); 386 387 $(".dl-filter-w-dropdown h2").not(this).removeClass("filter-opened"); 388 $(".dl-filter-w-dropdown").not(thisParent).removeClass("filter-is-active"); 389 $(this).toggleClass("filter-opened"); 390 thisParent.toggleClass("filter-is-active"); 391 }); 392 393 /* Play video on Project */ 394 395 $(".main-video").on("click", function () { 396 $(".main-video").addClass("play-video"); 397 $("iframe").addClass("play-video"); 398 let toAppend = $("iframe").attr("src"); 399 toAppend = toAppend + "?modestbranding=1&autohide=1&showinfo=0&controls=1&auto
399play=1&mute=0"; 400 $("iframe").attr("src", toAppend); 401 }); 402 403 /* Show whole project description */ 404 405 let infoHeightI = $(".project-desc-container").height(); 406 407 if (infoHeightI < 98) { 408 $(".project-read-more").hide(); 409 $(".project-desc-text").addClass("hide-gradient-desc"); 410 } else { 411 $(".project-desc-container").height(98); 412 } 413 414 $(".project-read-more").on("click", function () { 415 if ($(".project-desc-text").hasClass("reading-more")) { 416 $(".project-desc-container").animate({ height: 98 }, 200); 417 $(".project-desc-text").removeClass("reading-more"); 418 } else { 419 $(".project-desc-container").animate({ height: infoHeightI + 10 }, 200); 420 $(".project-desc-text").addClass("reading-more"); 421 } 422 }); 423 424 /* Project init slick slider */ 425 426 $(".project-slider-init").slick({ 427 responsive: [ 428 { 429 breakpoint: 901, 430 settings: { 431 slidesToShow: 3, 432 slidesToScroll: 1, 433 }, 434 }, 435 { 436 breakpoint: 701, 437 settings: { 438 slidesToShow: 2, 439 slidesToScroll: 1, 440 }, 441 }, 442 { 443 breakpoint: 481, 444 settings: { 445 centerMode: true, 446 slidesToShow: 1, 447 slidesToScroll: 1, 448 arrows: false, 449 infinite: false, 450 }, 451 }, 452 ], 453 }); 454 455 let options = { 456 infinite: true, 457 speed: 500, 458 fade: true, 459 autoplay: false, 460 slidesToShow: 1, 461 slidesToScroll: 1, 462 }; 463 464 let decoSimilarSlider = { 465 infinite: false, 466 slidesToShow: 3, 467 slidesToScroll: 1, 468 responsive: [ 469 { 470 breakpoint: 601, 471 settings: { 472 slidesToShow: 2, 473 slidesToScroll: 1, 474 }, 475 }, 476 { 477 breakpoint: 481, 478 settings: { 479 slidesToShow: 1, 480 slidesToScroll: 1, 481 centerMode: true, 482 arrows: false, 483 }, 484 }, 485 ], 486 }; 487 488 let textDecos = { 489 infinite: false, 490 slidesToShow: 3, 491 slidesToScroll: 1, 492 }; 493 494 let decoCombSlider = { 495 infinite: false, 496 slidesToShow: 3, 497 slidesToScroll: 1, 498 responsive: [ 499 { 500 breakpoint: 481, 501 settings: { 502 slidesToShow: 1, 503 slidesToScroll: 1, 504 centerMode: true, 505 arrows: true, 506 }, 507 }, 508 ], 509 }; 510 511 let downloadsSlider = { 512 slidesToShow: 5, 513 slidesToScroll: 1, 514 infinite: false, 515 responsive: [ 516 { 517 breakpoint: 1281, 518 settings: { 519 slidesToShow: 4, 520 slidesToScroll: 1, 521 }, 522 }, 523 { 524 breakpoint: 801, 525 settings: { 526 slidesToShow: 3, 527 slidesToScroll: 1, 528 }, 529 }, 530 { 531 breakpoint: 601, 532 settings: { 533 slidesToShow: 2, 534 slidesToScroll: 1, 535 }, 536 }, 537 { 538 breakpoint: 481, 539 settings: { 540 slidesToShow: 1, 541 slidesToScroll: 1, 542 centerMode: true, 543 arrows: false, 544 }, 545 }, 546 ], 547 }; 548 549 let decoExamplesSlider = { 550 infinite: false, 551 slidesToShow: 1, 552 slidesToScroll: 1, 553 dots: true, 554 arrows: false, 555 rtl: rtl, 556 responsive: [ 557 { 558 breakpoint: 800, 559 settings: { 560 slidesToShow: 1, 561 slidesToScroll: 1, 562 arrows: true, 563 dots: false, 564 }, 565 }, 566 ], 567 }; 568 569 let homePageSliders = { 570 infinite: false, 571 slidesToShow: 1, 572 slidesToScroll: 1, 573 centerMode: true, 574 arrows: false, 575 rtl: rtl, 576 variableWidth: true, 577 }; 578 579 $(".decor-images-slider").slick(decoExamplesSlider); 580 581 $(".tex-decors-carousel").slick(textDecos); 582 583 setTimeout(function () { 584 $(".project-slider-init-mega-gallery").slick(options); 585 586 $(".projects-slider").slick(decoSimilarSlider); 587 588 $(".decor-comb-slider").slick(decoCombSlider); 589 }, 1000); 590 591 $(".mobile-product-landing").slick({ 592 infinite: false, 593 speed: 500, 594 centerMode: true, 595 cssEase: "linear", 596 slidesToShow: 1, 597 centerPadding: "5px",
598 arrows: false, 599 rtl: rtl, 600 variableWidth: true, 601 }); 602 603 $(".decor-similar-slider").slick({ 604 infinite: false, 605 rtl: rtl, 606 slidesToShow: 3, 607 slidesToScroll: 1, 608 responsive: [ 609 { 610 breakpoint: 601, 611 settings: { 612 slidesToShow: 2, 613 slidesToScroll: 1, 614 }, 615 }, 616 { 617 breakpoint: 481, 618 settings: { 619 slidesToShow: 1, 620 slidesToScroll: 1, 621 centerMode: true, 622 arrows: false, 623 }, 624 }, 625 ], 626 }); 627 628 //init slick slider again after we click on expand button 629 //that's necessary, because slick can't calculate width of initiated element, when he has property display: none; 630 if ($(".product-components")) { 631 $(".product-components .nav-item").each(function (index) { 632 $(this).on("click", function () { 633 if ($(this).find(".nav-link").hasClass("decos-similar-tab-btn")) { 634 $(".product-components").find(".decos-sim").removeClass("slick-slider-helper"); 635 } else { 636 $(".product-components").find(".decos-sim").addClass("slick-slider-helper"); 637 } 638 }); 639 $(".decor-similar-slider").slick("setPosition"); 640 }); 641 } 642 643 $(document).on("click", ".decos-comb-tab-btn", function () { 644 $(".decor-comb-slider").slick("unslick"); 645 $(".decor-comb-slider").slick(decoCombSlider); 646 $(".decor-comb-slider").slick("slickGoTo", "0"); 647 }); 648 649 $(document).on("click", ".related-products-tab", function () { 650 $(".decor-similar-slider").slick("unslick"); 651 $(".decor-similar-slider").slick(decoSimilarSlider); 652 $(".decor-similar-slider").slick("slickGoTo", "0"); 653 }); 654 655 $(document).on("init", ".products-slider", function (event, slick, direction) { 656 if ($(this).parent().parent().parent().attr("data-cat-num") > 1) { 657 $(this).parent().removeClass("show"); 658 } 659 // left 660 }); 661 662 /* Mega Gallery toggle */ 663 664 $(".toggle-mega-gallery").on("click", function () { 665 $(".mega-gallery-container").toggleClass("is-open"); 666 $("body").toggleClass("mega-gallery-open"); 667 668 $(".project-slider-init-mega-gallery").slick("unslick"); 669 $(".project-slider-init-mega-gallery").slick(options); 670 let index = $(this).attr("data-mega-slide"); 671 672 $(".project-pagination span").html(parseInt(index) + 1); 673 674 $(".project-slider-init-mega-gallery").slick("slickGoTo", index); 675 }); 676 677 /* Mega Gallery Sidebar toggle */ 678 679 $(".mega-gallery-thumb").on("click", function () { 680 let elements = $(".slick-track").find(".mega-gallery-wrapper"); 681 if (elements.length) { 682 elements.each(function (index, value) { 683 $(value).find(".mega-gallery-sidebar").toggleClass("mega-open"); 684 }); 685 } 686 }); 687 688 /* Search category toggle */ 689 690 $(".dropdown-top-section").on("click", function () { 691 $(this).parent().toggleClass("open-search-section"); 692 }); 693 694 $(".project-slider-init-mega-gallery").on("afterChange", function (event, slick, currentSlide) { 695 $(".project-pagination span").html(parseInt(currentSlide) + 1); 696 }); 697 698 $(".project-slider-init-mega-gallery .slick-current").on("change", function () { 699 console.log($(this).attr("data-slick-index")); 700 }); 701 702 var checkExist = setInterval(function () { 703 if ($(".download-whole-section").length) { 704 $(".mCustomScrollbar-dl").mCustomScrollbar({ 705 theme: "dark", 706 }); 707 clearInterval(checkExist); 708 } 709 }, 100); 710 711 $(".small-footer-tablet").on("click", function () { 712 if ($(this).hasClass("small-footer-hover")) { 713 $(this).removeClass("small-footer-hover"); 714 } else { 715 $(this).addClass("small-footer-hover"); 716 $("html, body").animate({ scrollTop: $(document).height() }, "slow"); 717 } 718 }); 719 720 $(".popup_opener").on("click", function () { 721 if (!$(this).hasClass("active-popup-btn")) { 722 $(this).addClass("active-popup-btn"); 723 $(this).append('<span class="hover-effect-popup"></span>'); 724 } 725 }); 726 727 $(document).on("click", "#popup_wrapper .close", function () { 728 $(".selectors").find(".popup_opener").removeClass("active-popup-btn"); 729 $(".selectors").find(".popup_opener span.hover-effect-popup").remove(); 730 }); 731 732 var checkExist = setInterval(function () { 733 if ($(".attributes_list").length) { 734 if ($(".attributes_list").find(".pictograms_inner_container").length) { 735 //do nothing 736 } else { 737 $(".attributes_list").remove(); 738 } 739 clearInterval(checkExist); 740 } 741 }, 100); // check every 100ms 742 743 if ($(".decor-collections-page").length) { 744 $(".filter_menu_bar").addClass("deco-category-filter"); 745 } 746 747 $( 748 ".deco-filter-variant .project-single-filter.has-extra-column .deco-type-filter-left-col .has-sub-filters", 749 ).on("click", function () { 750 $(this).parent().parent().toggleClass("expanded-column"); 751 }); 752
753 let myKronoSBFooter = $(".krn-prtl-cnt .sub-menu-cnt #sidebar-sub-menu > ul").height(); 754 let myKronoSBH = $(".krn-prtl-cnt .sub-menu-cnt #sidebar-sub-menu").height(); 755 let screenWidth = 152; 756 757 $(window).on("resize", function () { 758 if ($(window).width() > 960) { 759 screenWidth = 152; 760 } else if ($(window).width() < 960 && $(window).width() > 480) { 761 screenWidth = 134; 762 } 763 //make height same as width 764 $(".single-block-wrapper").height($(".single-block-wrapper").width()); 765 }); 766 767 let screenBottom = $(window).scrollTop() + $(window).height(); 768 let compensatedSB = screenBottom - 134; 769 if (compensatedSB > myKronoSBH + 50) { 770 $(".krn-prtl-cnt .sub-menu-cnt #sidebar-sub-menu > ul").css("top", myKronoSBH); 771 } else { 772 $(".krn-prtl-cnt .sub-menu-cnt #sidebar-sub-menu > ul").css("top", screenBottom - myKronoSBFooter - 50); 773 } 774 775 $(document).on("scroll", function () { 776 screenBottom = $(window).scrollTop() + $(window).height(); 777 compensatedSB = screenBottom - 134; 778 if (compensatedSB > myKronoSBH + 50) { 779 $(".krn-prtl-cnt .sub-menu-cnt #sidebar-sub-menu > ul").css("top", myKronoSBH); 780 } else { 781 $(".krn-prtl-cnt .sub-menu-cnt #sidebar-sub-menu > ul").css("top", screenBottom - myKronoSBFooter - 50); 782 } 783 }); 784 785 /** 786 * Scroll to opened tab content at single product page OR single decor page 787 * for tablet view 788 */ 789 function scrollToTabsTablet() { 790 if ($(".decor-page").length) { 791 if ($(window).width() < 800) { 792 $(".product-components.desktop-view-tabs .nav-tabs .nav-item .nav-link").click(function () { 793 let contentPos = $(".desktop-view-tabs .tab-content").offset().top; 794 795 $("html, body").animate( 796 { 797 scrollTop: contentPos - 350, 798 }, 799 1000, 800 ); 801 }); 802 } 803 } 804 805 if ($(".desktop-product-tabs").length) { 806 if ($(window).width() < 741) { 807 $(".product-components.desktop-product-tabs .nav-item .nav-link").click(function () { 808 let contentPos = $(".desktop-product-tabs .tab-content").offset().top; 809 810 $("html, body").animate( 811 { 812 scrollTop: contentPos - 350, 813 }, 814 1000, 815 ); 816 }); 817 } 818 } 819 } 820 821 scrollToTabsTablet(); 822 823 /** 824 * scrollToTabsTablet() end 825 */ 826 827 /** 828 * Place border at products availability table between different available formats 829 */ 830 function tableFormatsBorders() { 831 let availabilityTable = $(".express_program.kronobuild"); 832 let elCount = 0; 833 834 availabilityTable.find(".kronobuild_formats").each(function (i, obj) { 835 let colspan = parseInt(obj["attributes"]["colspan"].value); 836 elCount = elCount + colspan; 837 $(".vt.sizes td") 838 .eq(elCount - 1) 839 .css("border-right", "1px solid #aaa"); 840 $(".product-availability") 841 .eq(elCount - 1) 842 .css("border-right", "1px solid #aaa"); 843 }); 844 } 845 846 tableFormatsBorders(); 847 /** 848 * tableFormatsBorders() end 849 */ 850 851 /** 852 * Auto expand of all collapsable items on init 853 */ 854 // if ($(".product-collections-page").length) { 855 // setTimeout(function () { 856 // $("#collapse0").collapse("show"); 857 // }, 200); 858 // } 859 /** 860 * end auto expand 861 */ 862 863 /** 864 * Chrome edit profile select options font workaround 865 */ 866 if ($(".prof-edit").length) { 867 var isChromium = !!window.chrome; 868 869 if (isChromium) { 870 $(".user-company-info select option").css("font-family", "Helen Pro_Cond"); 871 $(".user-personal-info select option").css("font-family", "Helen Pro_Cond"); 872 } 873 } 874 /** 875 * end of font workaround 876 */ 877 878 /** 879 * Collection filters show dropdowns on click for tablet view 880 */ 881 if ($("html, body").innerWidth() > 480 && $("html, body").innerWidth() < 1366) { 882 if ($(".decor-collections-page").length) { 883 $(".filter-cat-name-wrap").click(function () { 884 $(this).toggleClass("active"); 885 }); 886 } 887 } 888 /** 889 * end of show filters dropdown on click for tablet view 890 */ 891 892 /** 893 * Show tooltip on click - mobile & tablet view 894 */ 895 if ($("html, body").innerWidth() < 1366) { 896 $(".pictograms_inner_container").click(function () { 897 $(this).find(".pictograms_icon").tooltip("toggle"); 898 });
899 } 900 /** 901 * End tooltip on click for mobile and tablet views 902 */ 903 904 // Init Radio and Checkbox method 905 //if( $('.checkboxes').length || $('.contact-method').length ) { 906 // $("input[type=radio], input[type='checkbox']").radioCheck(); 907 //} 908}); 909 910//checkbox & radiobutton method ---------------------------------------------------------------------- 911$.fn.radioCheck = function () { 912 // create custom method 913 return $(this) 914 .next("label") 915 .on("click", function () { 916 var input = $(this).prev("input"); 917 if (input.is(":radio")) { 918 input.prop("checked", true).siblings("input").prop("checked", false); 919 $(this).addClass("checked").siblings("label").removeClass("checked"); 920 } else { 921 input.prop("checked", input.prop("checked")); 922 input.change(function () { 923 if ($(this).prop("checked")) { 924 $(this).next().addClass("checked"); 925 } else { 926 $(this).next().removeClass("checked"); 927 } 928 }); 929 } 930 931 input.trigger("change"); 932 }); 933}; 934 935$(window).on("load", function () { 936 $("#product-projects").on("click", function () { 937 let $grid = $(".gallery-wrapper"); 938 if ($(".grid-item").length) { 939 setTimeout(function () { 940 $grid.imagesLoaded().progress(function () { 941 $grid.masonry({ 942 itemSelector: ".grid-item", 943 horizontalOrder: true, 944 percentPosition: true, 945 transitionDuration: 0, 946 }); 947 }); 948 }, 500); 949 } 950 }); 951 952 $(".mCustomScrollbar-cr").mCustomScrollbar({ 953 theme: "dark", 954 }); 955 956 //$('.preloader-wrapper').fadeOut('slow'); 957 //$('body').removeClass('preloader-site'); 958 959 // Add element to favorites 960 $(".add-to-fav").on("click", function () { 961 let fav_el = '<div class="favorite-icon"><a href="#"><span>1</span></a></div>'; 962 $(".internationalization-section").prepend(fav_el); 963 964 console.log("add to fav"); 965 }); 966 967 $(document).on("click", ".custom-download", function (e) { 968 e.preventDefault(); 969 if ($(this).data("image") && $(this).data("name")) { 970 let $url_elements = window.location.pathname.split("/"); 971 let $lang = $url_elements[1]; 972 let $params = $(this).data("image").split("/"); 973 if (!$params.length) return; 974 let $url = "/" + $lang + "/ajax/express_services/download?"; 975 $.each($params, function (index, value) { 976 $url += `args[${index}]=${value}&`; 977 }); 978 $url += "name=" + $(this).data("name"); 979 window.open($url); 980 } 981 }); 982 983 let lastMapModalTrigger = null; 984 985 function loadGoogleMapsForModal() { 986 if (window.google && window.google.maps) { 987 return Promise.resolve(window.google.maps); 988 } 989 990 if (window.MAGGoogleMaps && typeof window.MAGGoogleMaps.load === "function") { 991 return window.MAGGoogleMaps.load({ 992 key: window.gmap_key, 993 libraries: ["marker"], 994 }); 995 } 996 997 return Promise.reject(new Error("Google Maps loader is unavailable.")); 998 } 999 1000 $(document).on("click", ".modal-map-wrapp", function (e) { 1001 e.preventDefault(); 1002 lastMapModalTrigger = this; 1003 let coords = { 1004 lat: parseFloat($(this).data("lat")), 1005 lng: parseFloat($(this).data("lng")), 1006 }; 1007 let mapId = $(this).data("context"); 1008 loadGoogleMapsForModal() 1009 .then(function () { 1010 initMap(coords, mapId); 1011 }) 1012 .catch(function (error) { 1013 console.error("Failed to load Google Maps API for modal map.", error); 1014 }); 1015 }); 1016 1017 $(document).on("hide.bs.modal", ".cr-modal[id^='map-modal-']", function () { 1018 if (document.activeElement && this.contains(document.activeElement)) { 1019 document.activeElement.blur(); 1020 } 1021 }); 1022 1023 $(document).on("hidden.bs.modal", ".cr-modal[id^='map-modal-']", function () { 1024 if ( 1025 lastMapModalTrigger && 1026 document.contains(lastMapModalTrigger) && 1027 typeof lastMapModalTrigger.focus === "function" 1028 ) { 1029 lastMapModalTrigger.focus(); 1030 } 1031 }); 1032 1033 function initMap(coords, mapId) { 1034 var runtimeMapId = 1035 typeof window.gmap_map_id === "string" && window.gmap_map_id.trim() !== "" 1036 ? window.gmap_map_id.trim() 1037 : "DEMO_MAP_ID"; 1038 1039 var map = new google.maps.Map(document.getElementById("map-content-" + mapId), { 1040 zoom: 8, 1041 center: coords, 1042 mapId: runtimeMapId, 1043 });
1044 1045 if (!(google.maps.marker && google.maps.marker.AdvancedMarkerElement)) { 1046 console.error("AdvancedMarkerElement is unavailable. Load Maps JS API with libraries=marker."); 1047 return; 1048 } 1049 1050 new google.maps.marker.AdvancedMarkerElement({ map: map, position: coords }); 1051 } 1052 1053 //style select inputs by design 1054 $(document).on("change", ".input-custom-type-select", function () { 1055 let val = $(this).val(); 1056 if (val && val != "" && typeof val != "undefined") { 1057 $(this).addClass("input-custom-type"); 1058 } else { 1059 $(this).removeClass("input-custom-type"); 1060 } 1061 }); 1062 1063 let browserWidth = $(window).width(); 1064 1065 if (browserWidth > 480 && browserWidth <= 959) { 1066 function clearAllTabletInformationElements() { 1067 $(".main-images-zoom").removeClass("show-info"); 1068 } 1069 1070 //if you click outside remove all clicked/showed elements 1071 $(document).click(function (e) { 1072 if (!$(e.target).hasClass("information")) { 1073 clearAllTabletInformationElements(); 1074 } 1075 }); 1076 1077 //information tablets 1078 $(document).on("click", ".main-images-zoom > .information", function () { 1079 let $parent_el = $(this).parent(); 1080 clearAllTabletInformationElements(); 1081 1082 if (!$parent_el.hasClass("show-info")) { 1083 $(".main-images-zoom").removeClass("show-info"); 1084 $parent_el.addClass("show-info"); 1085 } else { 1086 $parent_el.removeClass("show-info"); 1087 } 1088 }); 1089 1090 //information height calculator 1091 $(".information.middle").each(function (i, obj) { 1092 let full_height = $(obj).parent().find(".main-images-container").height(); 1093 $(obj).css("height", full_height); 1094 }); 1095 } 1096 1097 //JS helpers 1098 if (browserWidth <= 960) { 1099 $(".mega-submenu").remove(); 1100 } 1101}); 1102 1103/* Light YouTube Embeds by @labnol */ 1104/* Web: http://labnol.org/?p=27941 */ 1105 1106document.addEventListener("DOMContentLoaded", function () { 1107 var div, 1108 n, 1109 v = document.getElementsByClassName("youtube-player"); 1110 for (n = 0; n < v.length; n++) { 1111 div = document.createElement("div"); 1112 div.setAttribute("data-id", v[n].dataset.id); 1113 div.innerHTML = labnolThumb(v[n].dataset.id); 1114 div.onclick = labnolIframe; 1115 v[n].appendChild(div); 1116 } 1117}); 1118 1119function labnolThumb(id) { 1120 var thumb = '<img src="https://i.ytimg.com/vi/ID/maxresdefault.jpg">', 1121 play = '<div class="play"></div>'; 1122 return thumb.replace("ID", id) + play; 1123} 1124 1125// function labnolIframe() { 1126// var iframe = document.createElement("iframe"); 1127// var embed = "https://www.youtube.com/embed/ID?autoplay=1&VQ=HD1080"; 1128// iframe.setAttribute("src", embed.replace("ID", this.dataset.id)); 1129// iframe.setAttribute("frameborder", "0"); 1130// iframe.setAttribute("allowfullscreen", "1"); 1131// this.parentNode.replaceChild(iframe, this); 1132// } 1133 1134function labnolIframe() { 1135 var iframe = document.createElement("iframe"); 1136 var embed = "https://www.youtube.com/embed/ID?autoplay=1&playsinline=1&VQ=HD1080"; 1137 iframe.setAttribute("src", embed.replace("ID", this.dataset.id)); 1138 iframe.setAttribute("frameborder", "0"); 1139 iframe.setAttribute( 1140 "allow", 1141 "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", 1142 ); 1143 iframe.setAttribute("allowfullscreen", "1"); 1144 this.parentNode.replaceChild(iframe, this); 1145} 1146 1147async function getBlobVideo(src) { 1148 var video = document.getElementById("vid"); 1149 let blob = await fetch(src).then((r) => r.blob()); 1150 url = window.URL.createObjectURL(blob); 1151 video.src = url; 1152 video.load(); 1153 video 1154 .play() 1155 .then(() => { 1156 //console.log("is ok, is playing") 1157 }) 1158 .catch((error) => { 1159 console.log(error); 1160 console.log(error.code); 1161 }); 1162}
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.