1/** 2 * Global variables 3 */ 4"use strict"; 5 6var userAgent = navigator.userAgent.toLowerCase(), 7 initialDate = new Date(), 8 9 $document = $(document), 10 $window = $(window), 11 $html = $("html"), 12 $body = $("body"), 13 14 15 isRtl = $html.attr("dir") === "rtl", 16 isDesktop = $html.hasClass("desktop"), 17 isIE = userAgent.indexOf("msie") !== -1 ? parseInt(userAgent.split("msie")[1], 10) : userAgent.indexOf("trident") !== -1 ? 11 : userAgent.indexOf("edge") !== -1 ? 12 : false, 18 isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 19 20 plugins = { 21 pointerEvents: isIE < 11 ? "js/pointer-events.min.js" : false, 22 bootstrapTooltip: $("[data-toggle='tooltip']"), 23 bootstrapTabs: $(".tabs"), 24 bootstrapAccordions: $(".accordion"), 25 captcha: $('.recaptcha'), 26 rdGoogleMaps: $(".rd-google-map"), 27 rdNavbar: $(".rd-navbar"), 28 mfp: $('[data-lightbox]').not('[data-lightbox="gallery"] [data-lightbox]'), 29 mfpGallery: $('[data-lightbox^="gallery"]'), 30 wow: $(".wow"), 31 owl: $(".owl-carousel"), 32 swiper: $(".swiper-slider"), 33 counter: $(".counter"), 34 twitterfeed: $(".twitter"), 35 progressBar: $(".progress-bar-js"), 36 isotope: $(".isotope"), 37 countDown: $(".countdown"), 38 slick: $('.slick-slider'), 39 viewAnimate: $('.view-animate'), 40 selectFilter: $("select"), 41 rdInputLabel: $(".form-label"), 42 bootstrapDateTimePicker: $("[data-time-picker]"), 43 customWaypoints: $('[data-custom-scroll-to]'), 44 photoSwipeGallery: $("[data-photo-swipe-item]"), 45 stepper: $("input[type='number']"), 46 radio: $("input[type='radio']"), 47 checkbox: $("input[type='checkbox']"), 48 customToggle: $("[data-custom-toggle]"), 49 rdMailForm: $(".rd-mailform"), 50 regula: $("[data-constraints]"), 51 pageLoader: $(".page-loader"), 52 search: $(".rd-search"), 53 searchResults: $('.rd-search-results'), 54 pageTitles: $('.page-title'), 55 copyrightYear: $(".copyright-year"), 56 materialParallax: $(".parallax-container"), 57 dateCountdown: $('.DateCountdown'), 58 rdRange: $('.rd-range') 59 }; 60 61/** 62 * Initialize All Scripts 63 */ 64$(function () { 65 var isNoviBuilder = window.xMode; 66 67 /** 68 * Is Mac os 69 * @description add additional class on html if mac os. 70 */ 71 if (navigator.platform.match(/(Mac)/i)) $html.addClass("mac"); 72 73 /** 74 * getSwiperHeight 75 * @description calculate the height of swiper slider basing on data attr 76 */ 77 function getSwiperHeight(object, attr) { 78 var val = object.attr("data-" + attr), 79 dim; 80 81 if (!val) { 82 return undefined; 83 } 84 85 dim = val.match(/(px)|(%)|(vh)|(vw)$/i); 86 87 if (dim.length) { 88 switch (dim[0]) { 89 case "px": 90 return parseFloat(val); 91 case "vh": 92 return $window.height() * (parseFloat(val) / 100); 93 case "vw": 94 return $window.width() * (parseFloat(val) / 100); 95 case "%": 96 return object.width() * (parseFloat(val) / 100); 97 } 98 } else { 99 return undefined; 100 } 101 } 102 103 /** 104 * toggleSwiperInnerVideos 105 * @description toggle swiper videos on active slides 106 */ 107 function toggleSwiperInnerVideos(swiper) { 108 var prevSlide = $(swiper.slides[swiper.previousIndex]), 109 nextSlide = $(swiper.slides[swiper.activeIndex]), 110 videos; 111 112 prevSlide.find("video").each(function () { 113 this.pause(); 114 }); 115 116 videos = nextSlide.find("video"); 117 if (videos.length) { 118 videos.get(0).play(); 119 } 120 } 121 122 /** 123 * toggleSwiperCaptionAnimation 124 * @description toggle swiper animations on active slides 125 */ 126 function toggleSwiperCaptionAnimation(swiper) { 127 var prevSlide = $(swiper.container).find("[data-caption-animate]"), 128 nextSlide = $(swiper.slides[swiper.activeIndex]).find("[data-caption-animate]"), 129 delay, 130 duration, 131 nextSlideItem, 132 prevSlideItem; 133 134 for (var i = 0; i < prevSlide.length; i++) { 135 prevSlideItem = $(prevSlide[i]); 136 137 prevSlideItem.removeClass("animated") 138 .removeClass(prevSlideItem.attr("data-caption-animate")) 139 .addClass("not-animated"); 140 } 141 142 143 var tempFunction = function (nextSlideItem, duration) { 144 return function () { 145 nextSlideItem 146 .removeClass("not-animated") 147 .addClass(nextSlideItem.attr("data-caption-animate")) 148 .addClass("animated"); 149 if (duration) { 150 nextSlideItem.css('animation-duration', duration + 'ms'); 151 } 152 }; 153 }; 154 155 for (var i = 0; i < nextSlide.length; i++) { 156 nextSlideItem = $(nextSlide[i]);
157 delay = nextSlideItem.attr("data-caption-delay"); 158 duration = nextSlideItem.attr('data-caption-duration'); 159 if (!isNoviBuilder) { 160 setTimeout(tempFunction(nextSlideItem, duration), parseInt(delay, 10)); 161 } else { 162 nextSlideItem.removeClass("not-animated") 163 } 164 } 165 } 166 167 /** 168 * isScrolledIntoView 169 * @description check the element whas been scrolled into the view 170 */ 171 function isScrolledIntoView(elem) { 172 if (!isNoviBuilder) { 173 return elem.offset().top + elem.outerHeight() >= $window.scrollTop() && elem.offset().top <= $window.scrollTop() + $window.height(); 174 } 175 else { 176 return true; 177 } 178 } 179 180 /** 181 * initOnView 182 * @description calls a function when element has been scrolled into the view 183 */ 184 function lazyInit(element, func) { 185 $document.on('scroll', function () { 186 if ((!element.hasClass('lazy-loaded') && (isScrolledIntoView(element)))) { 187 func.call(); 188 element.addClass('lazy-loaded'); 189 } 190 }).trigger("scroll"); 191 } 192 193 /** 194 * Live Search 195 * @description create live search results 196 */ 197 function liveSearch(options){ 198 $('#' + options.live).removeClass('cleared').html(); 199 options.current++; 200 options.spin.addClass('loading'); 201 $.get(handler, { 202 s: decodeURI(options.term), 203 liveSearch: options.live, 204 dataType: "html", 205 liveCount: options.liveCount, 206 filter: options.filter, 207 template: options.template 208 }, function (data) { 209 options.processed++; 210 var live = $('#' + options.live); 211 if (options.processed == options.current && !live.hasClass('cleared')){ 212 live.find('> #search-results').removeClass('active'); 213 live.html(data); 214 setTimeout(function () { 215 live.find('> #search-results').addClass('active'); 216 }, 50); 217 } 218 options.spin.parents('.rd-search').find('.input-group-addon').removeClass('loading'); 219 }) 220 } 221 222 /** 223 * @desc Attach form validation to elements 224 * @param {object} elements - jQuery object 225 */ 226 function attachFormValidator(elements) { 227 // Custom validator - phone number 228 regula.custom({ 229 name: 'PhoneNumber', 230 defaultMessage: 'Invalid phone number format', 231 validator: function() { 232 if ( this.value === '' ) return true; 233 else return /^(\+\d)?[0-9\-\(\) ]{5,}$/i.test( this.value ); 234 } 235 }); 236 237 for (var i = 0; i < elements.length; i++) { 238 var o = $(elements[i]), v; 239 o.addClass("form-control-has-validation").after("<span class='form-validation'></span>"); 240 v = o.parent().find(".form-validation"); 241 if (v.is(":last-child")) o.addClass("form-control-last-child"); 242 } 243 244 elements.on('input change propertychange blur', function (e) { 245 var $this = $(this), results; 246 247 if (e.type !== "blur") if (!$this.parent().hasClass("has-error")) return; 248 if ($this.parents('.rd-mailform').hasClass('success')) return; 249 250 if (( results = $this.regula('validate') ).length) { 251 for (i = 0; i < results.length; i++) { 252 $this.siblings(".form-validation").text(results[i].message).parent().addClass("has-error"); 253 } 254 } else { 255 $this.siblings(".form-validation").text("").parent().removeClass("has-error") 256 } 257 }).regula('bind'); 258 259 var regularConstraintsMessages = [ 260 { 261 type: regula.Constraint.Required, 262 newMessage: "The text field is required." 263 }, 264 { 265 type: regula.Constraint.Email, 266 newMessage: "The email is not a valid email." 267 }, 268 { 269 type: regula.Constraint.Numeric, 270 newMessage: "Only numbers are required" 271 }, 272 { 273 type: regula.Constraint.Selected, 274 newMessage: "Please choose an option." 275 } 276 ]; 277 278 279 for (var i = 0; i < regularConstraintsMessages.length; i++) { 280 var regularConstraint = regularConstraintsMessages[i]; 281 282 regula.override({ 283 constraintType: regularConstraint.type, 284 defaultMessage: regularConstraint.newMessage 285 }); 286 } 287 } 288 289 /** 290 * isValidated 291 * @description check if all elemnts pass validation 292 */ 293 function isValidated(elements, captcha) { 294 var results, errors = 0; 295 296 if (elements.length) { 297 for (var j = 0; j < elements.length; j++) { 298 299 var $input = $(elements[j]); 300 if ((results = $input.regula('validate')).length) { 301 for (k = 0; k < results.length; k++) { 302 errors++; 303 $input.siblings(".form-validation").text(results[k].message).parent().addClass("has-error"); 304 } 305 } else { 306 $input.siblings(".form-validation").text("").parent().removeClass("has-error") 307 } 308 } 309 310 if (captcha) { 311 if (captcha.length) { 312 return validateReCaptcha(captcha) && errors === 0 313 } 314 } 315 316 return errors === 0; 317 } 318 return true; 319 } 320 321 322 323 /** 324 * Copyright Year 325 * @description Evaluates correct copyright year 326 */ 327 if (plugins.copyrightYear.length) { 328 plugins.copyrightYear.text(initialDate.getFullYear()); 329 } 330 331 /** 332 * IE Polyfills 333 * @description Adds some loosing functionality to IE browsers 334 */ 335 if (isIE) { 336 if (isIE < 10) { 337 $html.addClass("lt-ie-10"); 338 } 339 340 if (isIE < 11) { 341 if (plugins.pointerEvents) { 342 $.getScript(plugins.pointerEvents) 343 .done(function () { 344 $html.addClass("ie-10"); 345 PointerEventsPolyfill.initialize({}); 346 }); 347 } 348 } 349 350 if (isIE === 11) { 351 $("html").addClass("ie-11"); 352 } 353 354 if (isIE === 12) { 355 $("html").addClass("ie-edge"); 356 } 357 } 358 359 /** 360 * Bootstrap Tooltips 361 * @description Activate Bootstrap Tooltips 362 */ 363 if (plugins.bootstrapTooltip.length) { 364 var tooltipPlacement = plugins.bootstrapTooltip.attr('data-placement'); 365 initBootstrapTooltip(tooltipPlacement); 366 367 $window.on('resize orientationchange', function () { 368 initBootstrapTooltip(tooltipPlacement); 369 }); 370 } 371 372 /** 373 * @module Magnific Popup 374 * @author Dmitry Semenov
375 * @see http://dimsemenov.com/plugins/magnific-popup/ 376 * @version v1.0.0 377 */ 378 if (!isNoviBuilder && (plugins.mfp.length || plugins.mfpGallery.length)) { 379 if (plugins.mfp.length) { 380 for (var i = 0; i < plugins.mfp.length; i++) { 381 var mfpItem = plugins.mfp[i]; 382 383 $(mfpItem).magnificPopup({ 384 type: mfpItem.getAttribute("data-lightbox") 385 }); 386 } 387 } 388 if (plugins.mfpGallery.length) { 389 for (var i = 0; i < plugins.mfpGallery.length; i++) { 390 var mfpGalleryItem = $(plugins.mfpGallery[i]).find('[data-lightbox]'); 391 392 for (var c = 0; c < mfpGalleryItem.length; c++) { 393 $(mfpGalleryItem).addClass("mfp-" + $(mfpGalleryItem).attr("data-lightbox")); 394 } 395 396 mfpGalleryItem.end() 397 .magnificPopup({ 398 delegate: '[data-lightbox]', 399 type: "image", 400 gallery: { 401 enabled: true 402 } 403 }); 404 } 405 } 406 } 407 408 409 410 /** 411 * Bootstrap Date time picker 412 */ 413 if (!isNoviBuilder && plugins.bootstrapDateTimePicker.length) { 414 for (var i = 0; i < plugins.bootstrapDateTimePicker.length; i++) { 415 var $dateTimePicker = $(plugins.bootstrapDateTimePicker[i]); 416 var options = {}; 417 418 options['format'] = 'dddd DD MMMM YYYY - HH:mm'; 419 if ($dateTimePicker.attr("data-time-picker") == "date") { 420 options['format'] = 'dddd DD MMMM YYYY'; 421 options['minDate'] = new Date(); 422 } else if ($dateTimePicker.attr("data-time-picker") == "time") { 423 options['format'] = 'HH:mm'; 424 } 425 426 options["time"] = ($dateTimePicker.attr("data-time-picker") != "date"); 427 options["date"] = ($dateTimePicker.attr("data-time-picker") != "time"); 428 options["shortTime"] = true; 429 430 $dateTimePicker.bootstrapMaterialDatePicker(options); 431 } 432 } 433 434 /** 435 * RD Twitter Feed 436 * @description Enables RD Twitter Feed plugin 437 */ 438 if (plugins.twitterfeed.length > 0) { 439 var i; 440 for (i = 0; i < plugins.twitterfeed.length; i++) { 441 var twitterfeedItem = plugins.twitterfeed[i]; 442 $(twitterfeedItem).RDTwitter({}); 443 } 444 } 445 446 /** 447 * Select2 448 * @description Enables select2 plugin 449 */ 450 if (plugins.selectFilter.length) { 451 for (var i = 0; i < plugins.selectFilter.length; i++) { 452 var select = $(plugins.selectFilter[i]); 453 454 select.select2({ 455 theme: select.attr('data-custom-theme') ? select.attr('data-custom-theme') : "bootstrap" 456 }).next().addClass(select.attr("class").match(/(input-sm)|(input-lg)|($)/i).toString().replace(new RegExp(",", 'g'), " ")); 457 } 458 } 459 460 /** 461 * Stepper 462 * @description Enables Stepper Plugin 463 */ 464 if (plugins.stepper.length) { 465 plugins.stepper.stepper({ 466 labels: { 467 up: "", 468 down: "" 469 } 470 }); 471 } 472 473 /** 474 * Radio 475 * @description Add custom styling options for input[type="radio"] 476 */ 477 if (plugins.radio.length) { 478 for (var i = 0; i < plugins.radio.length; i++) { 479 $(plugins.radio[i]).addClass("radio-custom").after("<span class='radio-custom-dummy'></span>") 480 } 481 } 482 483 /** 484 * Checkbox 485 * @description Add custom styling options for input[type="checkbox"] 486 */ 487 if (plugins.checkbox.length) { 488 for (var i = 0; i < plugins.checkbox.length; i++) { 489 $(plugins.checkbox[i]).addClass("checkbox-custom").after("<span class='checkbox-custom-dummy'></span>") 490 } 491 } 492 493 /** 494 * jQuery Countdown 495 * @description Enable countdown plugin 496 */ 497 if (plugins.countDown.length) { 498 var i; 499 for (i = 0; i < plugins.countDown.length; i++) { 500 var countDownItem = plugins.countDown[i], 501 d = new Date(), 502 type = countDownItem.getAttribute('data-type'), 503 time = countDownItem.getAttribute('data-time'), 504 format = countDownItem.getAttribute('data-format'), 505 settings = []; 506 507 d.setTime(Date.parse(time)).toLocaleString(); 508 settings[type] = d; 509 settings['format'] = format; 510 $(countDownItem).countdown(settings); 511 } 512 } 513 514 515 /** 516 * Progress bar 517 * @description Enable progress bar 518 */ 519 if (plugins.progressBar.length) { 520 var i, 521 bar, 522 type; 523 524 for (i = 0; i < plugins.progressBar.length; i++) { 525 var progressItem = plugins.progressBar[i]; 526 bar = null; 527 528 if (progressItem.className.indexOf("progress-bar-horizontal") > -1) { 529 type = 'Line'; 530 } 531 532 if (progressItem.className.indexOf("progress-bar-radial") > -1) {
533 type = 'Circle'; 534 } 535 536 if (progressItem.getAttribute("data-stroke") && progressItem.getAttribute("data-value") && type) { 537 bar = new ProgressBar[type](progressItem, { 538 strokeWidth: Math.round(parseFloat(progressItem.getAttribute("data-stroke")) / progressItem.offsetWidth * 100), 539 trailWidth: progressItem.getAttribute("data-trail") ? Math.round(parseFloat(progressItem.getAttribute("data-trail")) / progressItem.offsetWidth * 100) : 0, 540 text: { 541 value: progressItem.getAttribute("data-counter") === "true" ? '0' : null, 542 className: 'progress-bar__body', 543 style: null 544 } 545 }); 546 bar.svg.setAttribute('preserveAspectRatio', "none meet"); 547 if (type === 'Line') { 548 bar.svg.setAttributeNS(null, "height", progressItem.getAttribute("data-stroke")); 549 } 550 551 bar.path.removeAttribute("stroke"); 552 bar.path.className.baseVal = "progress-bar__stroke"; 553 if (bar.trail) { 554 bar.trail.removeAttribute("stroke"); 555 bar.trail.className.baseVal = "progress-bar__trail"; 556 } 557 558 if (progressItem.getAttribute("data-easing") && !isIE) { 559 $(document) 560 .on("scroll", {"barItem": bar}, $.proxy(function (event) { 561 var bar = event.data.barItem; 562 var $this = $(this); 563 564 if (isScrolledIntoView($this) && this.className.indexOf("progress-bar--animated") === -1) { 565 this.className += " progress-bar--animated"; 566 bar.animate(parseInt($this.attr("data-value")) / 100.0, { 567 easing: $this.attr("data-easing"), 568 duration: $this.attr("data-duration") ? parseInt($this.attr("data-duration")) : 800, 569 step: function (state, b) { 570 if (b._container.className.indexOf("progress-bar-horizontal") > -1 || 571 b._container.className.indexOf("progress-bar-vertical") > -1) { 572 b.text.style.width = Math.abs(b.value() * 100).toFixed(0) + "%" 573 } 574 b.setText(Math.abs(b.value() * 100).toFixed(0)); 575 } 576 }); 577 } 578 }, progressItem)) 579 .trigger("scroll"); 580 } else { 581 bar.set(parseInt($(progressItem).attr("data-value")) / 100.0); 582 bar.setText($(progressItem).attr("data-value")); 583 if (type === 'Line') { 584 bar.text.style.width = parseInt($(progressItem).attr("data-value")) + "%"; 585 } 586 } 587 } else { 588 console.error(progressItem.className + ": progress bar type is not defined"); 589 } 590 } 591 } 592 593 /** 594 * UI To Top 595 * @description Enables ToTop Button 596 */ 597 if (isDesktop && !isNoviBuilder) { 598 $().UItoTop({ 599 easingType: 'easeOutQuart', 600 containerClass: 'ui-to-top fa fa-angle-up' 601 }); 602 } 603 604 /** 605 * RD Navbar 606 * @description Enables RD Navbar plugin 607 */ 608 if (plugins.rdNavbar.length) { 609 var aliaces, i, j, len, value, values, responsiveNavbar; 610 611 aliaces = ["-", "-sm-", "-md-", "-lg-", "-xl-", "-xxl-"]; 612 values = [0, 576, 768, 992, 1200, 1600]; 613 responsiveNavbar = {}; 614 615 for (i = j = 0, len = values.length; j < len; i = ++j) { 616 value = values[i]; 617 if (!responsiveNavbar[values[i]]) { 618 responsiveNavbar[values[i]] = {}; 619 } 620 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'layout')) { 621 responsiveNavbar[values[i]].layout = plugins.rdNavbar.attr('data' + aliaces[i] + 'layout'); 622 } 623 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'device-layout')) { 624 responsiveNavbar[values[i]]['deviceLayout'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'device-layout'); 625 } 626 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'hover-on')) { 627 responsiveNavbar[values[i]]['focusOnHover'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'hover-on') === 'true'; 628 } 629 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'auto-height')) { 630 responsiveNavbar[values[i]]['autoHeight'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'auto-height') === 'true'; 631 } 632 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up')) { 633 responsiveNavbar[values[i]]['stickUp'] = isNoviBuilder ? false : (plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up') === 'true'); 634 } 635 if (plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up-offset')) { 636 responsiveNavbar[values[i]]['stickUpOffset'] = plugins.rdNavbar.attr('data' + aliaces[i] + 'stick-up-offset'); 637 } 638 } 639 640 641 plugins.rdNavbar.RDNavbar({ 642 anchorNav: !isNoviBuilder, 643 stickUpClone: (plugins.rdNavbar.attr("data-stick-up-clone") && !isNoviBuilder) ? plugins.rdNavbar.attr("data-stick-up-clone")
643=== 'true' : false, 644 responsive: responsiveNavbar, 645 callbacks: { 646 onStuck: function () { 647 var navbarSearch = this.$element.find('.rd-search input'); 648 649 if (navbarSearch) { 650 navbarSearch.val('').trigger('propertychange'); 651 } 652 }, 653 onDropdownOver: function () { 654 return !isNoviBuilder; 655 }, 656 onUnstuck: function () { 657 if (this.$clone === null) 658 return; 659 660 var navbarSearch = this.$clone.find('.rd-search input'); 661 662 if (navbarSearch) { 663 navbarSearch.val('').trigger('propertychange'); 664 navbarSearch.trigger('blur'); 665 } 666 667 } 668 } 669 }); 670 671 672 if (plugins.rdNavbar.attr("data-body-class")) { 673 document.body.className += ' ' + plugins.rdNavbar.attr("data-body-class"); 674 } 675 } 676 677 /** 678 * ViewPort Universal 679 * @description Add class in viewport 680 */ 681 if (plugins.viewAnimate.length) { 682 var i; 683 for (i = 0; i < plugins.viewAnimate.length; i++) { 684 var $view = $(plugins.viewAnimate[i]).not('.active'); 685 $document.on("scroll", $.proxy(function () { 686 if (isScrolledIntoView(this)) { 687 this.addClass("active"); 688 } 689 }, $view)) 690 .trigger("scroll"); 691 } 692 } 693 694 695 /** 696 * Swiper 697 * @description Enable Swiper Slider 698 */ 699 if (plugins.swiper.length) { 700 for (var i = 0; i < plugins.swiper.length; i++) { 701 var s = $(plugins.swiper[i]); 702 var pag = s.find(".swiper-pagination"), 703 next = s.find(".swiper-button-next"), 704 prev = s.find(".swiper-button-prev"), 705 bar = s.find(".swiper-scrollbar"), 706 swiperSlide = s.find(".swiper-slide"), 707 autoplay = false; 708 709 for (var j = 0; j < swiperSlide.length; j++) { 710 var $this = $(swiperSlide[j]), 711 url; 712 713 if (url = $this.attr("data-slide-bg")) { 714 $this.css({ 715 "background-image": "url(" + url + ")", 716 "background-size": "cover" 717 }) 718 } 719 } 720 721 swiperSlide.end() 722 .find("[data-caption-animate]") 723 .addClass("not-animated") 724 .end(); 725 726 s.swiper({ 727 zoom: s.attr('data-parallax') === 'true', 728 autoplay: s.attr('data-autoplay') ? s.attr('data-autoplay') === "false" ? undefined : s.attr('data-autoplay') : 5000, 729 direction: s.attr('data-direction') ? s.attr('data-direction') : "horizontal", 730 effect: s.attr('data-slide-effect') ? s.attr('data-slide-effect') : "slide", 731 speed: s.attr('data-slide-speed') ? s.attr('data-slide-speed') : 600, 732 keyboardControl: s.attr('data-keyboard') === "true", 733 mousewheelControl: s.attr('data-mousewheel') === "true", 734 mousewheelReleaseOnEdges: s.attr('data-mousewheel-release') === "true", 735 nextButton: next.length ? next.get(0) : null, 736 prevButton: prev.length ? prev.get(0) : null, 737 pagination: pag.length ? pag.get(0) : null, 738 paginationClickable: pag.length ? pag.attr("data-clickable") !== "false" : false, 739 paginationBulletRender: pag.length ? pag.attr("data-index-bullet") === "true" ? function (swiper, index, className) { 740 return '<span class="' + className + '">' + (index + 1) + '</span>'; 741 } : null : null, 742 scrollbar: bar.length ? bar.get(0) : null, 743 scrollbarDraggable: bar.length ? bar.attr("data-draggable") !== "false" : true, 744 scrollbarHide: bar.length ? bar.attr("data-draggable") === "false" : false, 745 loop: isNoviBuilder ? false : s.attr('data-loop') !== "false", 746 simulateTouch: s.attr('data-simulate-touch') && !isNoviBuilder ? s.attr('data-simulate-touch') === "true" : false, 747 onTransitionStart: function (swiper) { 748 toggleSwiperInnerVideos(swiper); 749 }, 750 onTransitionEnd: function (swiper) { 751 toggleSwiperCaptionAnimation(swiper); 752 }, 753 onInit: function (swiper) { 754 toggleSwiperInnerVideos(swiper); 755 toggleSwiperCaptionAnimation(swiper); 756 757 if(!isRtl) { 758 $window.on('resize', function () { 759 swiper.update(true); 760 }); 761 } 762 } 763 }); 764 765 $window.on("resize", (function (s) { 766 return function () { 767 var mh = getSwiperHeight(s, "min-height"), 768 h = getSwiperHeight(s, "height"); 769 if (h) { 770 s.css("height", mh ? mh > h ? mh : h : h); 771 } 772 } 773 })(s)).trigger("resize"); 774 } 775 } 776 777 /** 778 * Page loader
779 * @description Enables Page loader 780 */ 781 if (plugins.pageLoader.length && !isNoviBuilder) { 782 // setTimeout(function () { 783 // plugins.pageLoader.addClass("loaded"); 784 // $window.trigger("resize"); 785 // }, 200); 786 $window.on('load', function() { 787 plugins.pageLoader.addClass("loaded"); 788 $window.trigger("resize"); 789 }); 790 } 791 792 793 /** 794 * Slick carousel 795 * @description Enable Slick carousel plugin 796 */ 797 /** 798 * Slick carousel 799 * @description Enable Slick carousel plugin 800 */ 801 if (plugins.slick.length) { 802 for (var i = 0; i < plugins.slick.length; i++) { 803 var $slickItem = $(plugins.slick[i]); 804 805 $slickItem.slick({ 806 slidesToScroll: parseInt($slickItem.attr('data-slide-to-scroll'), 10) || 1, 807 asNavFor: $slickItem.attr('data-for') || false, 808 dots: $slickItem.attr("data-dots") === "true", 809 infinite: isNoviBuilder ? false : $slickItem.attr("data-loop") === "true", 810 focusOnSelect: true, 811 arrows: $slickItem.attr("data-arrows") === "true", 812 swipe: $slickItem.attr("data-swipe") === "true", 813 autoplay: $slickItem.attr("data-autoplay") === "true", 814 vertical: $slickItem.attr("data-vertical") === "true", 815 centerMode: $slickItem.attr("data-center-mode") === "true", 816 centerPadding: $slickItem.attr("data-center-padding") ? $slickItem.attr("data-center-padding") : '0.50', 817 mobileFirst: true, 818 rtl: isRtl, 819 responsive: [ 820 { 821 breakpoint: 0, 822 settings: { 823 slidesToShow: parseInt($slickItem.attr('data-xs-items'), 10) || 1 824 } 825 }, 826 { 827 breakpoint: 576, 828 settings: { 829 slidesToShow: parseInt($slickItem.attr('data-sm-items'), 10) || 1 830 } 831 }, 832 { 833 breakpoint: 992, 834 settings: { 835 slidesToShow: parseInt($slickItem.attr('data-md-items'), 10) || 1 836 } 837 }, 838 { 839 breakpoint: 1200, 840 settings: { 841 slidesToShow: parseInt($slickItem.attr('data-lg-items'), 10) || 1 842 } 843 }, 844 { 845 breakpoint: 1600, 846 settings: { 847 slidesToShow: parseInt($slickItem.attr('data-xl-items'), 10) || 1 848 } 849 } 850 ] 851 }) 852 .on('afterChange', function (event, slick, currentSlide, nextSlide) { 853 var $this = $(this), 854 childCarousel = $this.attr('data-child'); 855 856 if (childCarousel) { 857 $(childCarousel + ' .slick-slide').removeClass('slick-current'); 858 $(childCarousel + ' .slick-slide').eq(currentSlide).addClass('slick-current'); 859 } 860 }); 861 862 } 863 } 864 865 /** 866 * Owl carousel
867 * @description Enables Owl carousel plugin 868 */ 869 if (plugins.owl.length) { 870 for (var i = 0; i < plugins.owl.length; i++) { 871 var c = $(plugins.owl[i]); 872 plugins.owl[i] = c; 873 874 initOwlCarousel(c); 875 } 876 } 877 878 /** 879 * initOwlCarousel 880 * @description Init owl carousel plugin 881 */ 882 function initOwlCarousel(c) { 883 var aliaces = ["-", "-sm-", "-md-", "-lg-", "-xl-", "-xxl-"], 884 values = [0, 576, 768, 992, 1200, 1600], 885 responsive = {}; 886 887 for (var j = 0; j < values.length; j++) { 888 responsive[values[j]] = {}; 889 for (var k = j; k >= -1; k--) { 890 if (!responsive[values[j]]["items"] && c.attr("data" + aliaces[k] + "items")) { 891 responsive[values[j]]["items"] = k < 0 ? 1 : parseInt(c.attr("data" + aliaces[k] + "items"), 10); 892 } 893 if (!responsive[values[j]]["stagePadding"] && responsive[values[j]]["stagePadding"] !== 0 && c.attr("data" + aliaces[k] + "stage-padding")) { 894 responsive[values[j]]["stagePadding"] = k < 0 ? 0 : parseInt(c.attr("data" + aliaces[k] + "stage-padding"), 10); 895 } 896 if (!responsive[values[j]]["margin"] && responsive[values[j]]["margin"] !== 0 && c.attr("data" + aliaces[k] + "margin")) { 897 responsive[values[j]]["margin"] = k < 0 ? 30 : parseInt(c.attr("data" + aliaces[k] + "margin"), 10); 898 } 899 } 900 } 901 902 // Create custom Pagination 903 if (c.attr('data-dots-custom')) { 904 c.on("initialized.owl.carousel", function (event) { 905 var carousel = $(event.currentTarget), 906 customPag = $(carousel.attr("data-dots-custom")), 907 active = 0; 908 909 if (carousel.attr('data-active')) { 910 active = parseInt(carousel.attr('data-active')); 911 } 912 913 carousel.trigger('to.owl.carousel', [active, 300, true]); 914 customPag.find("[data-owl-item='" + active + "']").addClass("active"); 915 916 customPag.find("[data-owl-item]").on('click', function (e) { 917 e.preventDefault(); 918 carousel.trigger('to.owl.carousel', [parseInt(this.getAttribute("data-owl-item")), 300, true]); 919 }); 920 921 carousel.on("translate.owl.carousel", function (event) { 922 customPag.find(".active").removeClass("active"); 923 customPag.find("[data-owl-item='" + event.item.index + "']").addClass("active") 924 }); 925 }); 926 } 927 928 if (c.attr('data-nav-custom')) { 929 c.on("initialized.owl.carousel", function (event) { 930 var carousel = $(event.currentTarget), 931 customNav = $(carousel.attr("data-nav-custom")); 932 933 // Custom Navigation Events 934 customNav.find(".owl-arrow-next").click(function (e) { 935 e.preventDefault(); 936 carousel.trigger('next.owl.carousel'); 937 }); 938 customNav.find(".owl-arrow-prev").click(function (e) { 939 e.preventDefault(); 940 carousel.trigger('prev.owl.carousel'); 941 }); 942 }); 943 } 944 945 // Create custom Numbering 946 if (typeof(c.attr("data-numbering")) !== 'undefined') { 947 var numberingObject = $(c.attr("data-numbering")); 948 949 c.on('initialized.owl.carousel changed.owl.carousel', function (numberingObject) { 950 return function (e) { 951 if (!e.namespace) return; 952 numberingObject.find('.numbering-current').text(e.item.index + 1); 953 numberingObject.find('.numbering-count').text(e.item.count); 954 }; 955 }(numberingObject)); 956 } 957 958 c.owlCarousel({ 959 autoplay: isNoviBuilder ? false: c.attr("data-autoplay") === "true", 960 loop: isNoviBuilder ? false : c.attr("data-loop") !== "false", 961 items: 1, 962 rtl: isRtl, 963 center: c.attr("data-center") === "true", 964 dotsContainer: c.attr("data-pagination-class") || false, 965 navContainer: c.attr("data-navigation-class") || false, 966 mouseDrag: isNoviBuilder ? false : c.attr("data-mouse-drag") !== "false", 967 nav: c.attr("data-nav") === "true", 968 dots: c.attr("data-dots") === "true", 969 dotsEach: c.attr("data-dots-each") ? parseInt(c.attr("data-dots-each"), 10) : false, 970 animateIn: c.attr('data-animation-in') ? c.attr('data-animation-in') : false, 971 animateOut: c.attr('data-animation-out') ? c.attr('data-animation-out') : false, 972 responsive: responsive, 973 navText: function () { 974 try { 975 return JSON.parse(c.attr("data-nav-text")); 976 } catch (e) { 977 return []; 978 } 979 }(), 980 navClass: function () { 981 try { 982 return JSON.parse(c.attr("data-nav-class")); 983 } catch (e) { 984 return ['owl-prev', 'owl-next']; 985 } 986 }() 987 }); 988 } 989 990
991 /** 992 * jQuery Count To 993 * @description Enables Count To plugin 994 */ 995 if (plugins.counter.length) { 996 var i; 997 998 for (i = 0; i < plugins.counter.length; i++) { 999 var $counterNotAnimated = $(plugins.counter[i]).not('.animated'); 1000 $document 1001 .on("scroll", $.proxy(function() { 1002 var $this = this; 1003 1004 if ((!$this.hasClass("animated")) && (isScrolledIntoView($this))) { 1005 $this.countTo({ 1006 refreshInterval: 40, 1007 from: 0, 1008 to: parseInt($this.text(),10), 1009 speed: $this.attr("data-speed") || 1000, 1010 formatter: function(value, options) { 1011 value = value.toFixed(options.decimals); 1012 if (value < 10) { 1013 return '0' + value; 1014 } 1015 return value; 1016 } 1017 }); 1018 $this.addClass('animated'); 1019 } 1020 }, $counterNotAnimated)) 1021 .trigger("scroll"); 1022 } 1023 } 1024 1025 /** 1026 * Isotope 1027 * @description Enables Isotope plugin 1028 */ 1029 if (plugins.isotope.length) { 1030 var isogroup = []; 1031 for (var i = 0; i < plugins.isotope.length; i++) { 1032 var isotopeItem = plugins.isotope[i], 1033 isotopeInitAttrs = { 1034 itemSelector: '.isotope-item', 1035 layoutMode: isotopeItem.getAttribute('data-isotope-layout') ? isotopeItem.getAttribute('data-isotope-layout') : 'masonry', 1036 filter: '*' 1037 }; 1038 1039 if (isotopeItem.getAttribute('data-column-width')) { 1040 isotopeInitAttrs.masonry = { 1041 columnWidth: parseFloat(isotopeItem.getAttribute('data-column-width')) 1042 }; 1043 } else if (isotopeItem.getAttribute('data-column-class')) { 1044 isotopeInitAttrs.masonry = { 1045 columnWidth: isotopeItem.getAttribute('data-column-class') 1046 }; 1047 } 1048 1049 var iso = new Isotope(isotopeItem, isotopeInitAttrs); 1050 isogroup.push(iso); 1051 } 1052 1053 1054 setTimeout(function(){ 1055 for (var i = 0; i < isogroup.length; i++) { 1056 isogroup[i].element.className += " isotope--loaded"; 1057 isogroup[i].layout(); 1058 } 1059 },200); 1060 1061 var resizeTimout; 1062 1063 $("[data-isotope-filter]").on("click", function (e) { 1064 e.preventDefault(); 1065 var filter = $(this); 1066 clearTimeout(resizeTimout); 1067 filter.parents(".isotope-filters").find('.active').removeClass("active"); 1068 filter.addClass("active"); 1069 var iso = $('.isotope[data-isotope-group="' + this.getAttribute("data-isotope-group") + '"]'), 1070 isotopeAttrs = { 1071 itemSelector: '.isotope-item', 1072 layoutMode: iso.attr('data-isotope-layout') ? iso.attr('data-isotope-layout') : 'masonry', 1073 filter: this.getAttribute("data-isotope-filter") === '*' ? '*' : '[data-filter*="' + this.getAttribute("data-isotope-filter") + '"]' 1074 }; 1075 if (iso.attr('data-column-width')) { 1076 isotopeAttrs.masonry = { 1077 columnWidth: parseFloat(iso.attr('data-column-width')) 1078 }; 1079 } else if (iso.attr('data-column-class')) { 1080 isotopeAttrs.masonry = { 1081 columnWidth: iso.attr('data-column-class') 1082 }; 1083 } 1084 iso.isotope(isotopeAttrs); 1085 }).eq(0).trigger("click") 1086 } 1087 1088 /** 1089 * WOW 1090 * @description Enables Wow animation plugin 1091 */ 1092 if ($html.hasClass("wow-animation") && plugins.wow.length && !isNoviBuilder && isDesktop) { 1093 new WOW().init(); 1094 } 1095 1096 /** 1097 * RD Input Label 1098 * @description Enables RD Input Label Plugin 1099 */ 1100 if (plugins.rdInputLabel.length) { 1101 plugins.rdInputLabel.RDInputLabel(); 1102 } 1103 1104 /** 1105 * Regula 1106 * @description Enables Regula plugin 1107 */ 1108 if (plugins.regula.length) { 1109 attachFormValidator(plugins.regula); 1110 } 1111 1112 /** 1113 * RD Mailform 1114 * @version 3.2.0 1115 */ 1116 if (plugins.rdMailForm.length) { 1117 var i, j, k, 1118 msg = { 1119 'MF000': 'Successfully sent!', 1120 'MF001': 'Recipients are not set!', 1121 'MF002': 'Form will not work locally!', 1122 'MF003': 'Please, define email field in your form!', 1123 'MF004': 'Please, define type of your form!', 1124 'MF254': 'Something went wrong with PHPMailer!', 1125 'MF255': 'Aw, snap! Something went wrong.' 1126 }; 1127 1128 for (i = 0; i < plugins.rdMailForm.length; i++) { 1129 var $form = $(plugins.rdMailForm[i]), 1130 formHasCaptcha = false;
1131 1132 $form.attr('novalidate', 'novalidate').ajaxForm({ 1133 data: { 1134 "form-type": $form.attr("data-form-type") || "contact", 1135 "counter": i 1136 }, 1137 beforeSubmit: function (arr, $form, options) { 1138 if (isNoviBuilder) 1139 return; 1140 1141 var form = $(plugins.rdMailForm[this.extraData.counter]), 1142 inputs = form.find("[data-constraints]"), 1143 output = $("#" + form.attr("data-form-output")), 1144 captcha = form.find('.recaptcha'), 1145 captchaFlag = true; 1146 1147 output.removeClass("active error success"); 1148 1149 if (isValidated(inputs, captcha)) { 1150 1151 // veify reCaptcha 1152 if (captcha.length) { 1153 var captchaToken = captcha.find('.g-recaptcha-response').val(), 1154 captchaMsg = { 1155 'CPT001': 'Please, setup you "site key" and "secret key" of reCaptcha', 1156 'CPT002': 'Something wrong with google reCaptcha' 1157 }; 1158 1159 formHasCaptcha = true; 1160 1161 $.ajax({ 1162 method: "POST", 1163 url: "bat/reCaptcha.php", 1164 data: {'g-recaptcha-response': captchaToken}, 1165 async: false 1166 }) 1167 .done(function (responceCode) { 1168 if (responceCode !== 'CPT000') { 1169 if (output.hasClass("snackbars")) { 1170 output.html('<p><span class="icon text-middle mdi mdi-check icon-xxs"></span><span>' + captchaMsg[responceCode] + '</span></p>') 1171 1172 setTimeout(function () { 1173 output.removeClass("active"); 1174 }, 3500); 1175 1176 captchaFlag = false; 1177 } else { 1178 output.html(captchaMsg[responceCode]); 1179 } 1180 1181 output.addClass("active"); 1182 } 1183 }); 1184 } 1185 1186 if (!captchaFlag) { 1187 return false; 1188 } 1189 1190 form.addClass('form-in-process'); 1191 1192 if (output.hasClass("snackbars")) { 1193 output.html('<p><span class="icon text-middle fa fa-circle-o-notch fa-spin icon-xxs"></span><span>Sending</span></p>'); 1194 output.addClass("active"); 1195 } 1196 } else { 1197 return false; 1198 } 1199 }, 1200 error: function (result) { 1201 if (isNoviBuilder) 1202 return; 1203 1204 var output = $("#" + $(plugins.rdMailForm[this.extraData.counter]).attr("data-form-output")), 1205 form = $(plugins.rdMailForm[this.extraData.counter]); 1206 1207 output.text(msg[result]); 1208 form.removeClass('form-in-process'); 1209 1210 if (formHasCaptcha) { 1211 grecaptcha.reset(); 1212 } 1213 }, 1214 success: function (result) { 1215 if (isNoviBuilder) 1216 return; 1217 1218 var form = $(plugins.rdMailForm[this.extraData.counter]), 1219 output = $("#" + form.attr("data-form-output")), 1220 select = form.find('select'); 1221 1222 form 1223 .addClass('success') 1224 .removeClass('form-in-process'); 1225 1226 if (formHasCaptcha) { 1227 grecaptcha.reset(); 1228 } 1229 1230 result = result.length === 5 ? result : 'MF255'; 1231 output.text(msg[result]); 1232 1233 if (result === "MF000") { 1234 if (output.hasClass("snackbars")) { 1235 output.html('<p><span class="icon text-middle mdi mdi-check icon-xxs"></span><span>' + msg[result] + '</span></p>'); 1236 } else { 1237 output.addClass("active success"); 1238 } 1239 } else { 1240 if (output.hasClass("snackbars")) { 1241 output.html(' <p class="snackbars-left"><span class="icon icon-xxs mdi mdi-alert-outline text-middle"></span><span>' + msg[result] + '</span></p>'); 1242 } else { 1243 output.addClass("active error"); 1244 } 1245 } 1246 1247 form.clearForm(); 1248 1249 if (select.length) { 1250 select.select2("val", ""); 1251 } 1252 1253 form.find('input, textarea').trigger('blur'); 1254 1255 setTimeout(function () { 1256 output.removeClass("active error success"); 1257 form.removeClass('success'); 1258 }, 3500); 1259 } 1260 }); 1261 } 1262 } 1263 1264 /** 1265 * PhotoSwipe Gallery
1266 * @description Enables PhotoSwipe Gallery plugin 1267 */ 1268 if (plugins.photoSwipeGallery.length && !isNoviBuilder) { 1269 1270 // init image click event 1271 $document.delegate("[data-photo-swipe-item]", "click", function (event) { 1272 event.preventDefault(); 1273 1274 var $el = $(this), 1275 $galleryItems = $el.parents("[data-photo-swipe-gallery]").find("a[data-photo-swipe-item]"), 1276 pswpElement = document.querySelectorAll('.pswp')[0], 1277 encounteredItems = {}, 1278 pswpItems = [], 1279 options, 1280 pswpIndex = 0, 1281 pswp; 1282 1283 if ($galleryItems.length == 0) { 1284 $galleryItems = $el; 1285 } 1286 1287 // loop over the gallery to build up the photoswipe items 1288 $galleryItems.each(function () { 1289 var $item = $(this), 1290 src = $item.attr('href'), 1291 size = $item.attr('data-size').split('x'), 1292 pswdItem; 1293 1294 if ($item.is(':visible')) { 1295 1296 // if we have this image the first time 1297 if (!encounteredItems[src]) { 1298 // build the photoswipe item 1299 pswdItem = { 1300 src: src, 1301 w: parseInt(size[0], 10), 1302 h: parseInt(size[1], 10), 1303 el: $item // save link to element for getThumbBoundsFn 1304 }; 1305 1306 // store that we already had this item 1307 encounteredItems[src] = { 1308 item: pswdItem, 1309 index: pswpIndex 1310 }; 1311 1312 // push the item to the photoswipe list 1313 pswpItems.push(pswdItem); 1314 pswpIndex++; 1315 } 1316 } 1317 }); 1318 1319 options = { 1320 index: encounteredItems[$el.attr('href')].index, 1321 1322 getThumbBoundsFn: function (index) { 1323 var $el = pswpItems[index].el, 1324 offset = $el.offset(); 1325 1326 return { 1327 x: offset.left, 1328 y: offset.top, 1329 w: $el.width() 1330 }; 1331 } 1332 }; 1333 1334 // open the photoswipe gallery 1335 pswp = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, pswpItems, options); 1336 pswp.init(); 1337 }); 1338 } 1339 1340 /** 1341 * Custom Toggles 1342 */ 1343 if (plugins.customToggle.length) { 1344 for (var i = 0; i < plugins.customToggle.length; i++) { 1345 var $this = $(plugins.customToggle[i]); 1346 1347 $this.on('click', $.proxy(function (event) { 1348 event.preventDefault(); 1349 1350 var $ctx = $(this); 1351 $($ctx.attr('data-custom-toggle')).add(this).toggleClass('active'); 1352 }, $this)); 1353 1354 if ($this.attr("data-custom-toggle-hide-on-blur") === "true") { 1355 $body.on("click", $this, function (e) { 1356 if (e.target !== e.data[0] 1357 && $(e.data.attr('data-custom-toggle')).find($(e.target)).length 1358 && e.data.find($(e.target)).length === 0) { 1359 $(e.data.attr('data-custom-toggle')).add(e.data[0]).removeClass('active'); 1360 } 1361 }) 1362 } 1363 1364 if ($this.attr("data-custom-toggle-disable-on-blur") === "true") { 1365 $body.on("click", $this, function (e) { 1366 if (e.target !== e.data[0] && $(e.data.attr('data-custom-toggle')).find($(e.target)).length === 0 && e.data.find($(e.target)).length === 0) { 1367 $(e.data.attr('data-custom-toggle')).add(e.data[0]).removeClass('active'); 1368 } 1369 }) 1370 } 1371 } 1372 } 1373 1374 /** 1375 * Custom Waypoints 1376 */ 1377 if (plugins.customWaypoints.length && !isNoviBuilder) { 1378 for (var i = 0; i < plugins.customWaypoints.length; i++) { 1379 var $this = $(plugins.customWaypoints[i]); 1380 1381 $this.on('click', function(e) { 1382 e.preventDefault(); 1383 $("body, html").stop().animate({ 1384 scrollTop: $("#" + $(this).attr('data-custom-scroll-to')).offset().top 1385 }, 1000, function() { 1386 $window.trigger("resize"); 1387 }); 1388 }); 1389 } 1390 } 1391 1392 /** 1393 * Page title 1394 * @description Enables page-title plugin 1395 */ 1396 if (plugins.pageTitles.length && !isNoviBuilder) { 1397 var varCount = 30; 1398 1399 for (var i = 0; i < plugins.pageTitles.length; i++) { 1400 var pageTitle = $(plugins.pageTitles[i]); 1401 1402 var header = pageTitle.children()[0]; 1403 var wrapper = $(document.createElement('div')); 1404 wrapper.addClass('page-title-inner'); 1405 1406 var pageTitleLeft = $(document.createElement('div')), 1407 pageTitleCenter = $(document.createElement('div')), 1408 pageTitleRight = $(document.createElement('div')); 1409 1410 pageTitleLeft.addClass('page-title-left'); 1411 pageTitleCenter.addClass('page-title-center'); 1412 pageTitleRight.addClass('page-title-right'); 1413 1414 for (var j = 0; j < varCount; j++) { 1415 pageTitleLeft.append(header.cloneNode(true)); 1416 pageTitleRight.append(header.cloneNode(true)); 1417 } 1418 1419 pageTitleCenter.append(header.cloneNode(true)); 1420 pageTitle.children(0).remove(); 1421 1422 wrapper.append(pageTitleLeft); 1423 wrapper.append(pageTitleCenter); 1424 wrapper.append(pageTitleRight); 1425 1426 pageTitle.append(wrapper); 1427 } 1428 } 1429 1430 /** 1431 * Material Parallax
1432 * @description Enables Material Parallax plugin 1433 */ 1434 if (plugins.materialParallax.length) { 1435 if (!isNoviBuilder && !isIE && !isMobile) { 1436 plugins.materialParallax.parallax(); 1437 } else { 1438 for (var i = 0; i < plugins.materialParallax.length; i++) { 1439 var parallax = $(plugins.materialParallax[i]), 1440 imgPath = parallax.data("parallax-img"); 1441 1442 parallax.css({ 1443 "background-image": 'url(' + imgPath + ')', 1444 "background-attachment": "fixed", 1445 "background-size": "cover" 1446 }); 1447 } 1448 } 1449 } 1450 1451 // TimeCircles 1452 if (plugins.dateCountdown.length) { 1453 for (var i = 0; i < plugins.dateCountdown.length; i++) { 1454 var dateCountdownItem = $(plugins.dateCountdown[i]), 1455 time = { 1456 "Days": { 1457 "text": "Days", 1458 "show": true, 1459 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1460 }, 1461 "Hours": { 1462 "text": "Hours", 1463 "show": true, 1464 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1465 }, 1466 "Minutes": { 1467 "text": "Minutes", 1468 "show": true, 1469 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1470 }, 1471 "Seconds": { 1472 "text": "Seconds", 1473 "show": true, 1474 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1475 } 1476 }; 1477 1478 dateCountdownItem.TimeCircles({ 1479 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "rgba(247, 247, 247, 1)", 1480 animation: "smooth", 1481 bg_width: dateCountdownItem.attr("data-bg-width") ? dateCountdownItem.attr("data-bg-width") : 0.6, 1482 circle_bg_color: dateCountdownItem.attr("data-bg") ? dateCountdownItem.attr("data-bg") : "rgba(0, 0, 0, 1)", 1483 fg_width: dateCountdownItem.attr("data-width") ? dateCountdownItem.attr("data-width") : 0.03 1484 }); 1485 1486 (function (dateCountdownItem, time) { 1487 $window.on('load resize orientationchange', function () { 1488 if (window.innerWidth < 479) { 1489 dateCountdownItem.TimeCircles({ 1490 time: { 1491 "Days": { 1492 "text": "Days", 1493 "show": true, 1494 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1495 }, 1496 "Hours": { 1497 "text": "Hours", 1498 "show": true, 1499 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1500 }, 1501 "Minutes": { 1502 "text": "Minutes", 1503 "show": true, 1504 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1505 }, 1506 Seconds: { 1507 "text": "Seconds", 1508 show: false, 1509 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1510 } 1511 } 1512 }).rebuild(); 1513 } else if (window.innerWidth < 767) { 1514 dateCountdownItem.TimeCircles({ 1515 time: { 1516 "Days": { 1517 "text": "Days", 1518 "show": true, 1519 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1520 }, 1521 "Hours": { 1522 "text": "Hours", 1523 "show": true, 1524 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1525 }, 1526 "Minutes": { 1527 "text": "Minutes", 1528 "show": true, 1529 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1530 }, 1531 Seconds: { 1532 text: '', 1533 show: false, 1534 color: dateCountdownItem.attr("data-color") ? dateCountdownItem.attr("data-color") : "#f9f9f9" 1535 } 1536 } 1537 }).rebuild(); 1538 } else { 1539 dateCountdownItem.TimeCircles({time: time}).rebuild(); 1540 } 1541 }); 1542 })(dateCountdownItem, time); 1543 } 1544 } 1545 1546 /** 1547 * RD Range
1548 * @description Enables RD Range plugin 1549 */ 1550 if (plugins.rdRange.length && !isNoviBuilder) { 1551 plugins.rdRange.RDRange({}); 1552 } 1553}); 1554 1555/** 1556 * Page loader 1557 * @description Enables Page loader 1558 */ 1559if (plugins.pageLoader.length) { 1560 $window.on('load', function () { 1561 plugins.pageLoader.addClass("loaded"); 1562 $window.trigger("resize"); 1563 }); 1564} 1565 1566const cookieContainer = document.querySelector(".cookie-container"); 1567const cookieButton = document.querySelector(".cookie-btn"); 1568 1569cookieButton.addEventListener("click", () => { 1570 cookieContainer.classList.remove("active"); 1571 localStorage.setItem("cookieBannerDisplayed", "true"); 1572}); 1573 1574setTimeout(() => { 1575 if (!localStorage.getItem("cookieBannerDisplayed")) { 1576 cookieContainer.classList.add("active"); 1577 } 1578}, 2000);
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.