1if( typeof jQuery !== 'undefined' ) { 2 var $ = jQuery.noConflict(); 3} 4 5(function (global, factory) { 6 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 7 typeof define === 'function' && define.amd ? define(factory) : 8 ( global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SEMICOLON = factory() ); 9} (this, (function() { 10 11 // USE STRICT 12 "use strict"; 13 14 var options = { 15 pageTransition: false, 16 cursor: false, 17 tips: false, 18 headerSticky: true, 19 headerMobileSticky: false, 20 menuBreakpoint: 992, 21 pageMenuBreakpoint: 992, 22 gmapAPI: '', 23 scrollOffset: 60, 24 scrollExternalLinks: true, 25 smoothScroll: false, 26 jsFolder: 'js/', 27 cssFolder: 'css/', 28 }; 29 30 if( typeof cnvsOptions !== 'undefined' ) { 31 options = Object.assign({}, options, cnvsOptions); 32 } 33 34 var vars = { 35 baseEl: document, 36 elRoot: document.documentElement, 37 elHead: document.head, 38 elBody: document.body, 39 viewport: { 40 width: 0, 41 height: 0, 42 }, 43 hash: window.location.hash, 44 topScrollOffset: 0, 45 elWrapper: document.getElementById('wrapper'), 46 elHeader: document.getElementById('header'), 47 headerClasses: '', 48 elHeaderWrap: document.getElementById('header-wrap'), 49 headerWrapClasses: '', 50 headerHeight: 0, 51 headerOffset: 0, 52 headerWrapHeight: 0, 53 headerWrapOffset: 0, 54 elPrimaryMenus: document.querySelectorAll('.primary-menu'), 55 elPrimaryMenuTriggers: document.querySelectorAll('.primary-menu-trigger'), 56 elPageMenu: document.getElementById('page-menu'), 57 pageMenuOffset: 0, 58 elSlider: document.getElementById('slider'), 59 elFooter: document.getElementById('footer'), 60 elAppMenu: document.querySelector('.app-menu'), 61 portfolioAjax: {}, 62 sliderParallax: { 63 el: document.querySelector('.slider-parallax'), 64 caption: document.querySelector('.slider-parallax .slider-caption'), 65 inner: document.querySelector('.slider-inner'), 66 offset: 0, 67 }, 68 get menuBreakpoint() { 69 return this.elBody.getAttribute('data-menu-breakpoint') || options.menuBreakpoint; 70 }, 71 get pageMenuBreakpoint() { 72 return this.elBody.getAttribute('data-pagemenu-breakpoint') || options.pageMenuBreakpoint; 73 }, 74 get customCursor() { 75 var value = this.elBody.getAttribute('data-custom-cursor') || options.cursor; 76 return value == 'true' || value === true ? true : false; 77 }, 78 get pageTransition() { 79 var value = this.elBody.classList.contains('page-transition') || options.pageTransition; 80 return value == 'true' || value === true ? true : false; 81 }, 82 get tips() { 83 var value = this.elBody.getAttribute('data-tips') || options.tips; 84 return value == 'true' || value === true ? true : false; 85 }, 86 get smoothScroll() { 87 var value = this.elBody.getAttribute('data-smooth-scroll') || options.smoothScroll; 88 return value == 'true' || value === true ? true : false; 89 }, 90 get isRTL() { 91 return this.elRoot.getAttribute('dir') == 'rtl' ? true : false; 92 }, 93 scrollPos: { 94 x: 0, 95 y: 0, 96 }, 97 $jq: typeof jQuery !== "undefined" ? jQuery.noConflict() : '', 98 resizers: {}, 99 recalls: {}, 100 debounced: false, 101 events: {}, 102 modules: {}, 103 fn: {}, 104 required: { 105 jQuery: { 106 plugin: 'jquery', 107 fn: function(){ 108 return typeof jQuery !== 'undefined'; 109 }, 110 file: options.jsFolder+'jquery.js', 111 id: 'canvas-jquery', 112 } 113 }, 114 fnInit: function() { 115 DocumentOnReady.init(); 116 DocumentOnLoad.init(); 117 DocumentOnResize.init(); 118 } 119 }; 120 121 var Core = function() { 122 return { 123 getOptions: options, 124 getVars: vars, 125 126 run: function(obj) { 127 Object.values(obj).map( function(fn) { 128 return typeof fn === 'function' && fn.call(); 129 }); 130 }, 131 132 runBase: function() { 133 Core.run(Base); 134 }, 135 136 runModules: function() { 137 Core.run(Modules); 138 }, 139 140 runContainerModules: function(parent) { 141 if( typeof parent === 'undefined' ) { 142 return false; 143 } 144 145 Core.getVars.baseEl = parent; 146 Core.runModules(); 147 Core.getVars.baseEl = document; 148 }, 149 150 breakpoints: function() { 151 var viewWidth = Core.viewport().width; 152 153 var breakpoint = { 154 xxl: { 155 enter: 1400, 156 exit: 99999 157 }, 158 xl: { 159 enter: 1200, 160 exit: 1399 161 }, 162 lg: { 163 enter: 992, 164 exit: 1199.98 165 }, 166 md: { 167 enter: 768, 168 exit: 991.98 169 }, 170 sm: { 171 enter: 576, 172 exit: 767.98 173 }, 174 xs: { 175 enter: 0, 176 exit: 575.98 177 } 178 }; 179 180 var previous = ''; 181 182 Object.keys( breakpoint ).forEach( function(key) { 183 if ( (viewWidth > breakpoint[key].enter) && (viewWidth <= breakpoint[key].exit) ) { 184 vars.elBody.classList.add( 'device-'+key ); 185 } else { 186 vars.elBody.classList.remove( 'device-'+key ); 187 if( previous != '' ) { 188 vars.elBody.classList.remove( 'device-down-'+previous ); 189 } 190 } 191 192 if ( viewWidth <= breakpoint[key].exit ) { 193 if( previous != '' ) { 194 vars.elBody.classList.add( 'device-down-'+previous ); 195 } 196 } 197 198 previous = key; 199 200 if ( viewWidth > breakpoint[key].enter ) { 201 vars.elBody.classList.add( 'device-up-'+key ); 202 return; 203 } else { 204 vars.elBody.classList.remove( 'device-up-'+key ); 205 } 206 }); 207 }, 208 209 colorScheme: function() { 210 if( vars.elBody.classList.contains('adaptive-color-scheme') ) { 211 window.matchMedia('(prefers-color-scheme: dark)').matches ? vars.elBody.classList.add( 'dark' ) : vars.elBody.classList.remove('dark'); 212 } 213 214 var bodyColorScheme = Core.cookie.get('__cnvs_body_color_scheme'); 215 216 if( bodyColorScheme && bodyColorScheme != '' ) { 217 bodyColorScheme.split(" ").includes('dark') ? vars.elBody.classList.add( 'dark' ) : vars.elBody.classList.remove( 'dark' ); 218 } 219 }, 220 221 throttle: function(timer, func, delay) { 222 if(timer) { 223 return; 224 } 225 226 timer = setTimeout( function() { 227 func(); 228 timer = undefined; 229 }, delay); 230 }, 231 232 debounce: function(callback, delay) { 233 clearTimeout(vars.debounced); 234 vars.debounced = setTimeout(callback, delay); 235 }, 236 237 debouncedResize: function(func, delay) { 238 var timeoutId; 239 return function() { 240 var context = this; 241 var args = arguments; 242 clearTimeout(timeoutId); 243 timeoutId = setTimeout( function() {
244 func.apply(context, args); 245 }, delay); 246 }; 247 }, 248 249 addEvent: function(el, event, args = {}) { 250 if( typeof el === "undefined" || typeof event === "undefined" ) { 251 return; 252 } 253 254 var createEvent = new CustomEvent( event, { 255 detail: args 256 }); 257 258 el.dispatchEvent( createEvent ); 259 vars.events[event] = true; 260 }, 261 262 scrollEnd: function(callback, refresh = 199) { 263 if (!callback || typeof callback !== 'function') return; 264 265 window.addEventListener('scroll', function() { 266 Core.debounce( callback, refresh ); 267 }, {passive: true}); 268 }, 269 270 viewport: function() { 271 var viewport = { 272 width: window.innerWidth || vars.elRoot.clientWidth, 273 height: window.innerHeight || vars.elRoot.clientHeight 274 }; 275 276 vars.viewport = viewport; 277 278 document.documentElement.style.setProperty('--cnvs-viewport-width', viewport.width); 279 document.documentElement.style.setProperty('--cnvs-viewport-height', viewport.height); 280 document.documentElement.style.setProperty('--cnvs-body-height', vars.elBody.clientHeight); 281 282 return viewport; 283 }, 284 285 isElement: function(selector) { 286 if (typeof selector === 'object' && selector !== null) { 287 return true; 288 } 289 290 if (selector instanceof Element || selector instanceof HTMLElement) { 291 return true; 292 } 293 294 if (typeof selector.jquery !== 'undefined') { 295 selector = selector[0]; 296 } 297 298 if (typeof selector.nodeType !== 'undefined') { 299 return true; 300 } 301 302 return false; 303 }, 304 305 getSelector: function(selector, jquery=true, customjs=true) { 306 if(jquery) { 307 if( Core.getVars.baseEl !== document ) { 308 selector = jQuery(Core.getVars.baseEl).find(selector); 309 } else { 310 selector = jQuery(selector); 311 } 312 313 if( customjs ) { 314 if( typeof customjs == 'string' ) { 315 selector = selector.filter(':not('+ customjs +')'); 316 } else { 317 selector = selector.filter(':not(.customjs)'); 318 } 319 } 320 } else { 321 if( Core.isElement(selector) ) { 322 selector = selector; 323 } else { 324 if( customjs ) { 325 if( typeof customjs == 'string' ) { 326 selector = Core.getVars.baseEl.querySelectorAll(selector+':not('+customjs+')'); 327 } else { 328 selector = Core.getVars.baseEl.querySelectorAll(selector+':not(.customjs)'); 329 } 330 } else { 331 selector = Core.getVars.baseEl.querySelectorAll(selector); 332 } 333 } 334 } 335 336 return selector; 337 }, 338 339 onResize: function(callback, refresh = 333) { 340 if (!callback || typeof callback !== 'function') return; 341 342 window.addEventListener('resize', function() { 343 Core.debounce( callback, refresh ); 344 }); 345 }, 346 347 imagesLoaded: function(el) { 348 var imgs = el.getElementsByTagName('img') || document.images, 349 len = imgs.length, 350 counter = 0; 351 352 if(len < 1) { 353 Core.addEvent(el, 'CanvasImagesLoaded'); 354 } 355 356 var incrementCounter = async function() { 357 counter++; 358 if(counter === len) { 359 Core.addEvent(el, 'CanvasImagesLoaded'); 360 } 361 }; 362 363 [].forEach.call( imgs, function( img ) { 364 if(img.complete) { 365 incrementCounter(); 366 } else { 367 img.addEventListener('load', incrementCounter, false); 368 } 369 }); 370 }, 371 372 contains: function(classes, selector) { 373 var classArray = classes.split(" "); 374 var hasClass = false; 375 376 classArray.forEach( function(classTxt) { 377 if( vars.elBody.classList.contains(classTxt) ) { 378 hasClass = true; 379 } 380 }); 381 382 return hasClass; 383 }, 384 385 has: function(nodeList, selector) { 386 return [].slice.call(nodeList)?.filter( function(e) { 387 return e.querySelector(selector); 388 }); 389 }, 390 391 filtered: function(nodeList, selector) { 392 return [].slice.call(nodeList)?.filter( function(e) { 393 return e.matches(selector); 394 }); 395 }, 396 397 parents: function(elem, selector) { 398 if (!Element.prototype.matches) { 399 Element.prototype.matches = 400 Element.prototype.matchesSelector || 401 Element.prototype.mozMatchesSelector || 402 Element.prototype.msMatchesSelector || 403 Element.prototype.oMatchesSelector || 404 Element.prototype.webkitMatchesSelector || 405 function(s) { 406 var matches = (this.document || this.ownerDocument).querySelectorAll(s), 407 i = matches.length; 408 while (--i >= 0 && matches.item(i) !== this) {} 409 return i > -1; 410 }; 411 } 412 413 var parents = []; 414 415 for ( ; elem && elem !== document; elem = elem.parentNode ) { 416 if (selector) { 417 if (elem.matches(selector)) { 418 parents.push(elem); 419 } 420 continue; 421 } 422 parents.push(elem); 423 } 424 425 return parents; 426 }, 427 428 siblings: function(elem, nodes = false) { 429 if( nodes ) { 430 return [].slice.call(nodes).filter( function(sibling) { 431 return sibling !== elem; 432 }); 433 } else { 434 return [].slice.call(elem.parentNode.children).filter( function(sibling) { 435 return sibling !== elem; 436 }); 437 } 438 }, 439 440 getNext: function(elem, selector) { 441 var nextElem = elem.nextElementSibling; 442 443 if( !selector ) { 444 return nextElem; 445 } 446 447 if( nextElem && nextElem.matches(selector) ) { 448 return nextElem; 449 } 450 451 return null; 452 }, 453 454 offset: function(el) { 455 var rect = el.getBoundingClientRect(), 456 scrollLeft = window.scrollX || document.documentElement.scrollLeft, 457 scrollTop = window.scrollY || document.documentElement.scrollTop; 458 459 return {top: rect.top + scrollTop, left: rect.left + scrollLeft}; 460 }, 461 462 isHidden: function(el) { 463 return (el.offsetParent === null); 464 }, 465 466 classesFn: function(func, classes, selector) { 467 var classArray = classes.split(" "); 468 classArray.forEach( function(classTxt) { 469 if( func == 'add' ) { 470 selector.classList.add(classTxt); 471 } else if( func == 'toggle' ) { 472 selector.classList.toggle(classTxt); 473 } else { 474 selector.classList.remove(classTxt); 475 } 476 }); 477 }, 478 479 cookie: function() { 480 return { 481 set: function(name, value, daysToExpire) { 482 var date = new Date(); 483 date.setTime(date.getTime() + (daysToExpire * 24 * 60 * 60 * 1000)); 484 var expires = "expires=" + date.toUTCString(); 485 document.cookie = name + "=" + value + ";" + expires + ";path=/"; 486 }, 487 488 get: function(name) { 489 var decodedCookies = decodeURIComponent(document.cookie); 490 var cookies = decodedCookies.split(";"); 491 492 for (let i = 0; i < cookies.length; i++) { 493 var cookie = cookies[i].trim(); 494 if (cookie.startsWith(name + "=")) { 495 return cookie.substring(name.length + 1); 496 } 497 } 498 499 return null; 500 }, 501 502 remove: function(name) { 503 document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; 504 } 505 }; 506 }(), 507 508 scrollTo: function(offset = 0, speed = 1250, easing, behavior = 'smooth') { 509 if( easing && (typeof jQuery !== 'undefined' && typeof jQuery.easing["easeOutQuad"] !== 'undefined') ) { 510 jQuery('body,html').stop(true).animate({ 511 'scrollTop': Number(offset) 512 }, Number( speed ), easing ); 513 } else { 514 var smoothScroll = 'scrollBehavior' in document.documentElement.style; 515 516 if( typeof window.scroll === 'function' && smoothScroll ) { 517 window.scroll({ 518 top: Number(offset), 519 behavior: behavior 520 }); 521 } else { 522 var body = Core.getVars.elBody; 523 var rootEl = Core.getVars.elRoot; 524 525 body.scrollIntoView(); 526 rootEl.scrollIntoView(); 527 528 var scrollToTop = function() { 529 if (body.scrollTop > Number(offset) || rootEl.scrollTop > Number(offset)) { 530 body.scrollTop -= 20; 531 rootEl.scrollTop -= 20; 532 setTimeout(scrollToTop, 10); 533 } 534 }; 535 536 scrollToTop(); 537 } 538 } 539 }, 540 541 smoothScroll: function() { 542 new initSmoothScrollfunction(document,90,5); 543 544 function initSmoothScrollfunction(target, speed, smooth) { 545 if (target === document) 546 target = (document.scrollingElement 547 || document.documentElement 548 || document.body.parentNode 549 || document.body); // cross browser support for document scrolling 550 551 var moving = false;
552 var pos = target.scrollTop; 553 var frame = target === document.body 554 && document.documentElement 555 ? document.documentElement 556 : target; // safari is the new IE 557 558 target.addEventListener('mousewheel', scrolled, { passive: false }); 559 target.addEventListener('DOMMouseScroll', scrolled, { passive: false }); 560 561 function scrolled(e) { 562 e.preventDefault(); // disable default scrolling 563 564 var delta = normalizeWheelDelta(e); 565 566 pos += -delta * speed; 567 pos = Math.max(0, Math.min(pos, target.scrollHeight - frame.clientHeight)); // limit scrolling 568 569 if (!moving) update(); 570 } 571 572 function normalizeWheelDelta(e){ 573 if(e.detail){ 574 if(e.wheelDelta) 575 return e.wheelDelta/e.detail/40 * (e.detail>0 ? 1 : -1); // Opera 576 else 577 return -e.detail/3; // Firefox 578 }else 579 return e.wheelDelta/120; // IE,Safari,Chrome 580 }; 581 582 function update() { 583 moving = true; 584 585 var delta = (pos - target.scrollTop) / smooth; 586 587 target.scrollTop += delta; 588 589 if (Math.abs(delta) > 0.5) 590 requestFrame(update); 591 else 592 moving = false; 593 } 594 595 var requestFrame = function() { // requestAnimationFrame cross browser 596 return ( 597 window.requestAnimationFrame || 598 window.webkitRequestAnimationFrame || 599 window.mozRequestAnimationFrame || 600 window.oRequestAnimationFrame || 601 window.msRequestAnimationFrame || 602 function(func) { 603 window.setTimeout(func, 1000 / 50); 604 } 605 ); 606 }(); 607 } 608 }, 609 610 loadCSS: function(params) { 611 var file = params.file; 612 var htmlID = params.id || false; 613 var cssFolder = params.cssFolder || false; 614 615 if( !file ) { 616 return false; 617 } 618 619 if( htmlID && document.getElementById(htmlID) ) { 620 return false; 621 } 622 623 var htmlStyle = document.createElement('link'); 624 625 htmlStyle.id = htmlID; 626 htmlStyle.href = cssFolder ? options.cssFolder+file : file; 627 htmlStyle.rel = 'stylesheet'; 628 htmlStyle.type = 'text/css'; 629 630 vars.elHead.appendChild(htmlStyle); 631 return true; 632 }, 633 634 loadJS: function(params) { 635 var file = params.file; 636 var htmlID = params.id || false; 637 var type = params.type || false; 638 var callback = params.callback; 639 var async = params.async || true; 640 var defer = params.defer || true; 641 var jsFolder = params.jsFolder || false; 642 643 if( !file ) { 644 return false; 645 } 646 647 if( htmlID && document.getElementById(htmlID) ) { 648 return false; 649 } 650 651 var htmlScript = document.createElement('script'); 652 653 if ( typeof callback !== 'undefined' ) { 654 if( typeof callback != 'function' ) { 655 throw new Error('Not a valid callback!'); 656 } else { 657 htmlScript.onload = callback; 658 } 659 } 660 661 htmlScript.id = htmlID; 662 htmlScript.src = jsFolder ? options.jsFolder+file : file; 663 if( type ) { 664 htmlScript.type = type; 665 } 666 htmlScript.async = async ? true : false; 667 htmlScript.defer = defer ? true : false; 668 669 vars.elBody.appendChild(htmlScript); 670 return true; 671 }, 672 673 isFuncTrue: async function(fn) { 674 if( 'function' !== typeof fn ) { 675 return false; 676 } 677 678 var counter = 0; 679 680 return new Promise( function(resolve, reject) { 681 if(fn()) { 682 resolve(true); 683 } else { 684 var int = setInterval( function() { 685 if(fn()) { 686 clearInterval( int ); 687 resolve(true); 688 } else { 689 if( counter > 30 ) { 690 clearInterval( int ); 691 reject(true); 692 } 693 } 694 counter++; 695 }, 333); 696 } 697 }).catch( function(error) { 698 console.log('Function does not exist: ' + fn); 699 }); 700 }, 701 702 initFunction: function(params) { 703 vars.elBody.classList.add(params.class); 704 Core.addEvent(window, params.event); 705 vars.events[params.event] = true; 706 }, 707 708 topScrollOffset: function() { 709 var headerHeight = 0; 710 var pageMenuOffset = vars.elPageMenu?.querySelector('#page-menu-wrap')?.offsetHeight || 0; 711 712 if( vars.elBody.classList.contains('is-expanded-menu') ) { 713 if( vars.elHeader?.classList.contains('sticky-header') ) { 714 headerHeight = vars.elHeaderWrap.offsetHeight; 715 } 716 717 if( vars.elPageMenu?.classList.contains('dots-menu') || !vars.elPageMenu?.classList.contains('sticky-page-menu') ) { 718 pageMenuOffset = 0; 719 } 720 } 721 722 Core.getVars.topScrollOffset = headerHeight + pageMenuOffset + options.scrollOffset; 723 }, 724 }; 725 }(); 726 727 var Base = function() { 728 return { 729 init: function() { 730 Mobile.any() && vars.elBody.classList.add('device-touch'); 731 }, 732
733 menuBreakpoint: function() { 734 if( Core.getVars.menuBreakpoint <= Core.viewport().width ) { 735 vars.elBody.classList.add( 'is-expanded-menu' ); 736 } else { 737 vars.elBody.classList.remove( 'is-expanded-menu' ); 738 } 739 740 if( vars.elPageMenu ) { 741 if( typeof Core.getVars.pageMenuBreakpoint === 'undefined' ) { 742 Core.getVars.pageMenuBreakpoint = Core.getVars.menuBreakpoint; 743 } 744 745 if( Core.getVars.pageMenuBreakpoint <= Core.viewport().width ) { 746 vars.elBody.classList.add( 'is-expanded-pagemenu' ); 747 } else { 748 vars.elBody.classList.remove( 'is-expanded-pagemenu' ); 749 } 750 } 751 }, 752 753 goToTop: function() { 754 CNVS.GoToTop.init('#gotoTop'); 755 }, 756 757 stickFooterOnSmall: function() { 758 CNVS.StickFooterOnSmall && CNVS.StickFooterOnSmall.init('#footer'); 759 }, 760 761 logo: function() { 762 CNVS.Logo.init('#logo'); 763 }, 764 765 headers: function() { 766 Core.getVars.headerClasses = vars.elHeader?.className || ''; 767 Core.getVars.headerWrapClasses = vars.elHeaderWrap?.className || ''; 768 CNVS.Headers.init('#header'); 769 }, 770 771 menus: function() { 772 CNVS.Menus.init('#header'); 773 }, 774 775 pageMenu: function() { 776 CNVS.PageMenu && CNVS.PageMenu.init('#page-menu'); 777 }, 778 779 sliderDimensions: function() { 780 CNVS.SliderDimensions && CNVS.SliderDimensions.init('.slider-element'); 781 }, 782 783 sliderMenuClass: function() { 784 CNVS.SliderMenuClass && CNVS.SliderMenuClass.init('.transparent-header + .swiper_wrapper,.swiper_wrapper + .transparent-header,.transparent-header + .revslider-wrap,.revslider-wrap + .transparent-header'); 785 }, 786 787 topSearch: function() { 788 CNVS.TopSearch.init('#top-search-trigger'); 789 }, 790 791 topCart: function() { 792 CNVS.TopCart.init('#top-cart'); 793 }, 794 795 sidePanel: function() { 796 CNVS.SidePanel && CNVS.SidePanel.init('#side-panel'); 797 }, 798 799 adaptiveColorScheme: function() { 800 CNVS.AdaptiveColorScheme && CNVS.AdaptiveColorScheme.init('.adaptive-color-scheme'); 801 }, 802 803 portfolioAjax: function() { 804 CNVS.PortfolioAjax && CNVS.PortfolioAjax.init('.portfolio-ajax'); 805 }, 806 807 cursor: function() { 808 if( vars.customCursor ) { 809 CNVS.Cursor && CNVS.Cursor.init('body'); 810 } 811 }, 812 813 setBSTheme: function() { 814 if( vars.elBody.classList.contains('dark') ) { 815 document.querySelector('html').setAttribute('data-bs-theme', 'dark'); 816 } else { 817 document.querySelector('html').removeAttribute('data-bs-theme'); 818 document.querySelectorAll('.dark')?.forEach( function(el) { 819 el.setAttribute('data-bs-theme', 'dark'); 820 }); 821 } 822 823 vars.elBody.querySelectorAll('.not-dark')?.forEach( function(el) { 824 el.setAttribute('data-bs-theme', 'light'); 825 }); 826 }, 827 828 getCurrentYear: function() { 829 var year = new Date(); 830 var yearHTML = document.getElementById('cnvs-year'); 831 832 if( yearHTML ) { 833 yearHTML.innerText = year.getFullYear(); 834 } 835 } 836 } 837 }(); 838 839 var Modules = function() { 840 return { 841 bootstrap: function() { 842 var notExec = true; 843 document.querySelectorAll('*').forEach( function(el) { 844 if( notExec ) { 845 el.getAttributeNames().some( function(text) { 846 if( text.includes('data-bs') ) { 847 notExec = false; 848 CNVS.Bootstrap && CNVS.Bootstrap.init('body'); 849 return true; 850 } 851 }); 852 } 853 }); 854 }, 855 856 resizeVideos: function(element) { 857 CNVS.ResizeVideos && CNVS.ResizeVideos.init(element ? element : 'iframe[src*="youtube"],iframe[src*="vimeo"],iframe[src*="dailymotion"],iframe[src*="maps.google.com"],iframe[src*="google.com/maps"]'); 858 }, 859 860 pageTransition: function() { 861 if( vars.pageTransition ) { 862 CNVS.PageTransition && CNVS.PageTransition.init('body'); 863 } 864 }, 865 866 lazyLoad: function(element) { 867 CNVS.LazyLoad && CNVS.LazyLoad.init(element ? element : '.lazy:not(.lazy-loaded)'); 868 }, 869 870 dataClasses: function() { 871 CNVS.DataClasses && CNVS.DataClasses.init('[data-class]'); 872 }, 873 874 dataHeights: function() { 875 CNVS.DataHeights && CNVS.DataHeights.init('[data-height-xxl],[data-height-xl],[data-height-lg],[data-height-md],[data-height-sm],[data-height-xs]'); 876 }, 877 878 lightbox: function(element) { 879 CNVS.Lightbox && CNVS.Lightbox.init(element ? element : '[data-lightbox]'); 880 }, 881 882 modal: function(element) { 883 CNVS.Modal && CNVS.Modal.init(element ? element : '.modal-on-load'); 884 }, 885 886 animations: function(element) { 887 CNVS.Animations && CNVS.Animations.init(element ? element : '[data-animate]'); 888 }, 889 890 hoverAnimations: function(element) { 891 CNVS.HoverAnimations && CNVS.HoverAnimations.init(element ? element : '[data-hover-animate]'); 892 }, 893 894 gridInit: function(element) { 895 CNVS.Grid && CNVS.Grid.init(element ? element : '.grid-container'); 896 }, 897 898 filterInit: function(element) { 899 CNVS.Filter && CNVS.Filter.init(element ? element : '.grid-filter,.custom-filter'); 900 }, 901 902 canvasSlider: function(element) { 903 CNVS.CanvasSlider && CNVS.CanvasSlider.init(element ? element : '.swiper_wrapper'); 904 }, 905 906 sliderParallax: function() { 907 CNVS.SliderParallax && CNVS.SliderParallax.init('.slider-parallax'); 908 }, 909 910 flexSlider: function(element) { 911 CNVS.FlexSlider && CNVS.FlexSlider.init(element ? element : '.fslider'); 912 }, 913 914 html5Video: function(element) { 915 CNVS.FullVideo && CNVS.FullVideo.init(element ? element : '.video-wrap'); 916 }, 917 918 youtubeBgVideo: function(element) { 919 CNVS.YoutubeBG && CNVS.YoutubeBG.init(element ? element : '.yt-bg-player'); 920 }, 921 922 toggle: function(element) { 923 CNVS.Toggle && CNVS.Toggle.init(element ? element : '.toggle'); 924 }, 925 926 accordion: function(element) { 927 CNVS.Accordion && CNVS.Accordion.init(element ? element : '.accordion'); 928 }, 929 930 counter: function(element) { 931 CNVS.Counter && CNVS.Counter.init(element ? element : '.counter'); 932 }, 933 934 countdown: function(element) { 935 CNVS.Countdown && CNVS.Countdown.init(element ? element : '.countdown'); 936 }, 937 938 gmap: function(element) { 939 CNVS.GoogleMaps && CNVS.GoogleMaps.init(element ? element : '.gmap'); 940 }, 941 942 roundedSkills: function(element) { 943 CNVS.RoundedSkills && CNVS.RoundedSkills.init(element ? element : '.rounded-skill'); 944 }, 945 946 progress: function(element) { 947 CNVS.Progress && CNVS.Progress.init(element ? element : '.skill-progress'); 948 }, 949 950 twitterFeed: function(element) { 951 CNVS.Twitter && CNVS.Twitter.init(element ? element : '.twitter-feed'); 952 }, 953 954 flickrFeed: function(element) { 955 CNVS.Flickr && CNVS.Flickr.init(element ? element : '.flickr-feed'); 956 }, 957 958 instagram: function(element) { 959 CNVS.Instagram && CNVS.Instagram.init(element ? element : '.instagram-photos'); 960 }, 961 962 // Dribbble Pending 963 964 navTree: function(element) { 965 CNVS.NavTree && CNVS.NavTree.init(element ? element : '.nav-tree'); 966 }, 967 968 carousel: function(element) { 969 CNVS.Carousel && CNVS.Carousel.init(element ? element : '.carousel-widget'); 970 }, 971 972 masonryThumbs: function(element) { 973 CNVS.MasonryThumbs && CNVS.MasonryThumbs.init(element ? element : '.masonry-thumbs'); 974 }, 975 976 notifications: function(element) { 977 CNVS.Notifications && CNVS.Notifications.init(element ? element : false); 978 }, 979 980 textRotator: function(element) { 981 CNVS.TextRotator && CNVS.TextRotator.init(element ? element : '.text-rotater'); 982 }, 983 984 onePage: function(element) { 985 CNVS.OnePage && CNVS.OnePage.init(element ? element : '[data-scrollto],.one-page-menu'); 986 }, 987 988 ajaxForm: function(element) { 989 CNVS.AjaxForm && CNVS.AjaxForm.init(element ? element : '.form-widget'); 990 }, 991 992 subscribe: function(element) { 993 CNVS.Subscribe && CNVS.Subscribe.init(element ? element : '.subscribe-widget'); 994 }, 995 996 conditional: function(element) { 997 CNVS.Conditional && CNVS.Conditional.init(element ? element : '.form-group[data-condition],.form-group[data-conditions]'); 998 }, 999 1000 shapeDivider: function(element) { 1001 CNVS.ShapeDivider && CNVS.ShapeDivider.init(element ? element : '.shape-divider'); 1002 }, 1003 1004 stickySidebar: function(element) { 1005 CNVS.StickySidebar && CNVS.StickySidebar.init(element ? element : '.sticky-sidebar-wrap'); 1006 }, 1007 1008 cookies: function(element) { 1009 CNVS.Cookies && CNVS.Cookies.init(element ? element : '.gdpr-settings,[data-cookies]'); 1010 }, 1011 1012 quantity: function(element) { 1013 CNVS.Quantity && CNVS.Quantity.init(element ? element : '.quantity'); 1014 }, 1015 1016 readmore: function(element) { 1017 CNVS.ReadMore && CNVS.ReadMore.init(element ? element : '[data-readmore]'); 1018 }, 1019 1020 pricingSwitcher: function(element) { 1021 CNVS.PricingSwitcher && CNVS.PricingSwitcher.init(element ? element : '.pricing-tenure-switcher'); 1022 }, 1023 1024 ajaxTrigger: function(element) { 1025 CNVS.AjaxTrigger && CNVS.AjaxTrigger.init(element ? element : '[data-ajax-loader]'); 1026 }, 1027 1028 videoFacade: function(element) { 1029 CNVS.VideoFacade && CNVS.VideoFacade.init(element ? element : '.video-facade'); 1030 }, 1031 1032 schemeToggle: function(element) { 1033 CNVS.SchemeToggle && CNVS.SchemeToggle.init(element ? element : '.body-scheme-toggle'); 1034 }, 1035 1036 clipboardCopy: function(element) { 1037 CNVS.Clipboard && CNVS.Clipboard.init(element ? element : '.clipboard-copy'); 1038 }, 1039 1040 codeHighlight: function(element) { 1041 CNVS.CodeHighlight && CNVS.CodeHighlight.init(element ? element : '.code-highlight'); 1042 }, 1043 1044 tips: function() { 1045 if( vars.tips ) { 1046 CNVS.Tips && CNVS.Tips.init('body'); 1047 } 1048 }, 1049 1050 textSplitter: function(element) { 1051 CNVS.TextSplitter && CNVS.TextSplitter.init(element ? element : '.text-splitter'); 1052 }, 1053 1054 mediaActions: function(element) { 1055 CNVS.MediaActions && CNVS.MediaActions.init(element ? element : '.media-wrap'); 1056 }, 1057 1058 viewportDetect: function(element) { 1059 CNVS.ViewportDetect && CNVS.ViewportDetect.init(element ? element : '.viewport-detect'); 1060 }, 1061 1062 scrollDetect: function(element) { 1063 CNVS.ScrollDetect && CNVS.ScrollDetect.init(element ? element : '.scroll-detect'); 1064 }, 1065 1066 fontSizer: function(element) { 1067 CNVS.FontSizer && CNVS.FontSizer.init(element ? element : '.font-sizer'); 1068 }, 1069 1070 hover3D: function(element) { 1071 CNVS.Hover3D && CNVS.Hover3D.init(element ? element : '.hover-3d'); 1072 }, 1073 1074 buttons: function(element) { 1075 CNVS.Buttons && CNVS.Buttons.init(element ? element : '.button-text-effect'); 1076 }, 1077 1078 bsComponents: function(element) { 1079 CNVS.BSComponents && CNVS.BSComponents.init(element ? element : '[data-bs-toggle="tooltip"],[data-bs-toggle="popover"],[data-bs-toggle="tab"],[data-bs-toggle="pill"],.style-msg'); 1080 } 1081 }; 1082 }(); 1083 1084 var Mobile = function() { 1085 return { 1086 Android: function() { 1087 return navigator.userAgent.match(/Android/i); 1088 }, 1089 BlackBerry: function() { 1090 return navigator.userAgent.match(/BlackBerry/i); 1091 }, 1092 iOS: function() { 1093 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 1094 }, 1095 Opera: function() { 1096 return navigator.userAgent.match(/Opera Mini/i); 1097 }, 1098 Windows: function() { 1099 return navigator.userAgent.match(/IEMobile/i); 1100 }, 1101 any: function() { 1102 return (Mobile.Android() || Mobile.BlackBerry() || Mobile.iOS() || Mobile.Opera() || Mobile.Windows()); 1103 } 1104 } 1105 }(); 1106 1107 // Add your Custom JS Codes here 1108 var Custom = function() { 1109 return { 1110 onReady: function() { 1111 // Add JS Codes here to Run on Document Ready 1112 }, 1113 1114 onLoad: function() { 1115 // Add JS Codes here to Run on Window Load 1116 }, 1117 1118 onResize: function() { 1119 // Add JS Codes here to Run on Window Resize 1120 } 1121 } 1122 }(); 1123 1124 var DocumentOnResize = function() { 1125 return { 1126 init: function() { 1127 Core.viewport(); 1128 Core.breakpoints();
1129 Base.menuBreakpoint(); 1130 1131 Core.run(vars.resizers); 1132 1133 Custom.onResize(); 1134 Core.addEvent( window, 'cnvsResize' ); 1135 } 1136 }; 1137 }(); 1138 1139 var DocumentOnReady = function() { 1140 return { 1141 init: function() { 1142 Core.breakpoints(); 1143 Core.colorScheme(); 1144 Core.runBase(); 1145 Core.runModules(); 1146 Core.topScrollOffset(); 1147 1148 if( vars.smoothScroll ) { 1149 new Core.smoothScroll(); 1150 } 1151 1152 DocumentOnReady.windowscroll(); 1153 1154 Custom.onReady(); 1155 }, 1156 1157 windowscroll: function() { 1158 Core.scrollEnd( function() { 1159 Base.pageMenu(); 1160 }); 1161 } 1162 }; 1163 }(); 1164 1165 var DocumentOnLoad = function() { 1166 return { 1167 init: function() { 1168 Custom.onLoad(); 1169 } 1170 }; 1171 }(); 1172 1173 document.addEventListener( 'DOMContentLoaded', function() { 1174 DocumentOnReady.init(); 1175 }); 1176 1177 window.addEventListener('load', function() { 1178 DocumentOnLoad.init(); 1179 }); 1180 1181 var resizeFunctions = Core.debouncedResize( function() { 1182 DocumentOnResize.init(); 1183 }, 250); 1184 1185 window.addEventListener('resize', function() { 1186 resizeFunctions(); 1187 }); 1188 1189 var canvas_umd = { 1190 Core, 1191 Base, 1192 Modules, 1193 Mobile, 1194 Custom, 1195 }; 1196 1197 return canvas_umd; 1198}))); 1199 1200(function (global, factory) { 1201 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 1202 typeof define === 'function' && define.amd ? define(factory) : 1203 ( global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CNVS = factory() ); 1204} (this, (function() { 1205 // USE STRICT 1206 "use strict"; 1207 1208 /** 1209 * -------------------------------------------------------------------------- 1210 * DO NOT DELETE!! Start (Required) 1211 * -------------------------------------------------------------------------- 1212 */ 1213 if( SEMICOLON === 'undefined' || SEMICOLON.Core === 'undefined' || SEMICOLON.Base === 'undefined' || SEMICOLON.Modules === 'undefined' || SEMICOLON.Mobile === 'undefined' ) { 1214 return false; 1215 } 1216 1217 var __core = SEMICOLON.Core; 1218 var __base = SEMICOLON.Base; 1219 var __modules = SEMICOLON.Modules; 1220 var __mobile = SEMICOLON.Mobile; 1221 // DO NOT DELETE!! End 1222 1223 return { 1224 /** 1225 * -------------------------------------------------------------------------- 1226 * Logo Functions Start (Required) 1227 * -------------------------------------------------------------------------- 1228 */ 1229 Logo: function() { 1230 return { 1231 init: function(selector) { 1232 selector = __core.getSelector( selector, false ); 1233 if( selector.length < 1 ){ 1234 return true; 1235 } 1236 1237 var head = __core.getVars.elHead, 1238 style, 1239 css; 1240 1241 if( selector[0].querySelector('.logo-dark') ) { 1242 style = document.createElement('style'); 1243 head.appendChild(style); 1244 css = '.dark #header-wrap:not(.not-dark) #logo [class^="logo-"], .dark .header-row:not(.not-dark) #logo [class^="logo-"] { display: none; } .dark #header-wrap:not(.not-dark) #logo .logo-dark, .dark .header-row:not(.not-dark) #logo .logo-dark { display: flex; }'; 1245 style.appendChild(document.createTextNode(css)); 1246 } 1247 1248 if( selector[0].querySelector('.logo-sticky') ) { 1249 style = document.createElement('style'); 1250 head.appendChild(style); 1251 css = '.sticky-header #logo [class^="logo-"] { display: none !important; } .sticky-header #logo .logo-sticky { display: flex !important; }'; 1252 style.appendChild(document.createTextNode(css)); 1253 } 1254 1255 if( selector[0].querySelector('.logo-sticky-shrink') ) { 1256 style = document.createElement('style'); 1257 head.appendChild(style); 1258 css = '.sticky-header-shrink #logo [class^="logo-"] { display: none; } .sticky-header-shrink #logo .logo-sticky-shrink { display: flex; }'; 1259 style.appendChild(document.createTextNode(css)); 1260 } 1261 1262 if( selector[0].querySelector('.logo-mobile') ) { 1263 style = document.createElement('style'); 1264 head.appendChild(style); 1265 css = 'body:not(.is-expanded-menu) #logo [class^="logo-"] { display: none; } body:not(.is-expanded-menu) #logo .logo-mobile { display: flex; }'; 1266 style.appendChild(document.createTextNode(css)); 1267 } 1268 } 1269 }; 1270 }(), 1271 // Logo Functions End 1272 1273 /** 1274 * -------------------------------------------------------------------------- 1275 * GoToTop Functions Start (Required) 1276 * -------------------------------------------------------------------------- 1277 */ 1278 GoToTop: function() { 1279 var _init = function(element) { 1280 var elSpeed = element.getAttribute('data-speed') || 700, 1281 elEasing = element.getAttribute('data-easing'); 1282 1283 element.onclick = function(e) { 1284 __core.scrollTo(0, Number(elSpeed), elEasing); 1285 e.preventDefault(); 1286 }; 1287 }; 1288 1289 var _scroll = function(element) { 1290 var body = __core.getVars.elBody.classList; 1291 1292 var elMobile = element.getAttribute('data-mobile') || 'false', 1293 elOffset = element.getAttribute('data-offset') || 450; 1294 1295 if( elMobile == 'false' && ( body.contains('device-xs') || body.contains('device-sm') || body.contains('device-md') ) ) { 1296 return true; 1297 } 1298 1299 if( window.scrollY > Number(elOffset) ) { 1300 body.add('gototop-active'); 1301 } else { 1302 body.remove('gototop-active'); 1303 } 1304 }; 1305 1306 return { 1307 init: function(selector) { 1308 selector = __core.getSelector( selector, false ); 1309 if( selector.length < 1 ){ 1310 return true; 1311 } 1312 1313 _init(selector[0]); 1314 _scroll(selector[0]); 1315 1316 window.addEventListener('scroll', function(){ 1317 _scroll(selector[0]); 1318 }, {passive:true}); 1319 } 1320 }; 1321 }(), 1322 // GoToTop Functions End 1323 1324 /** 1325 * -------------------------------------------------------------------------- 1326 * StickFooterOnSmall Functions Start 1327 * -------------------------------------------------------------------------- 1328 */ 1329 StickFooterOnSmall: function() { 1330 return { 1331 init: function(selector) { 1332 selector = __core.getSelector( selector, false ); 1333 if( selector.length < 1 ){ 1334 return true; 1335 } 1336 1337 __core.getVars.elFooter.style.marginTop = ''; 1338 1339 var windowH = __core.viewport().height, 1340 wrapperH = __core.getVars.elWrapper.offsetHeight; 1341 1342 if( !__core.getVars.elBody.classList.contains('sticky-footer') && __core.getVars.elFooter !== 'undefined' && __core.getVars.elWrapper.contains( __core.getVars.elFooter ) ) { 1343 if( windowH > wrapperH ) { 1344 __core.getVars.elFooter.style.marginTop = (windowH - wrapperH)+'px'; 1345 } 1346 } 1347 1348 if( __core.getVars.elAppMenu ) { 1349 if((__core.viewport().height - (__core.getVars.elAppMenu.getBoundingClientRect().top + __core.getVars.elAppMenu.getBoundingClientRect().height)) === 0) { 1350 __core.getVars.elFooter.style.marginBottom = __core.getVars.elAppMenu.offsetHeight+'px'; 1351 } 1352 } 1353 1354 __core.getVars.resizers.stickfooter = function() { 1355 __base.stickFooterOnSmall(); 1356 }; 1357 } 1358 }; 1359 }(), 1360 // StickFooterOnSmall Functions End 1361 1362 /** 1363 * -------------------------------------------------------------------------- 1364 * Header Functions Start (Required) 1365 * -------------------------------------------------------------------------- 1366 */ 1367 Headers: function() { 1368 var _offset = function() { 1369 var elHeader = __core.getVars.elHeader; 1370 var elHeaderInc = document.querySelector('.include-header'); 1371 1372 __core.getVars.headerOffset = elHeader.offsetTop; 1373 if( __core.getVars.elHeader?.classList.contains('floating-header') || elHeaderInc?.classList.contains('include-topbar') ) { 1374 __core.getVars.headerOffset = __core.offset(elHeader).top; 1375 } 1376 __core.getVars.elHeaderWrap?.classList.add('position-absolute'); 1377 __core.getVars.headerWrapOffset = __core.getVars.headerOffset + __core.getVars.elHeaderWrap?.offsetTop; 1378 __core.getVars.elHeaderWrap?.classList.remove('position-absolute'); 1379 1380 if( elHeader.hasAttribute('data-sticky-offset') ) { 1381 var headerDefinedOffset = elHeader.getAttribute('data-sticky-offset'); 1382 if( headerDefinedOffset == 'full' ) { 1383 __core.getVars.headerWrapOffset = __core.viewport().height; 1384 var headerOffsetNegative = elHeader.getAttribute('data-sticky-offset-negative'); 1385 if( typeof headerOffsetNegative !== 'undefined' ) { 1386 if( headerOffsetNegative == 'auto' ) { 1387 __core.getVars.headerWrapOffset = __core.getVars.headerWrapOffset - elHeader.offsetHeight - 1; 1388 } else { 1389 __core.getVars.headerWrapOffset = __core.getVars.headerWrapOffset - Number(headerOffsetNegative) - 1; 1390 } 1391 } 1392 } else { 1393 __core.getVars.headerWrapOffset = Number(headerDefinedOffset); 1394 } 1395 } 1396 }; 1397 1398 var _sticky = function(stickyOffset) { 1399 if( !__core.getVars.elBody.classList.contains('is-expanded-menu') && __core.getVars.mobileSticky != 'true' ) { 1400 return true; 1401 } 1402 1403 if( window.scrollY > stickyOffset ) { 1404 if( !__core.getVars.elBody.classList.contains('side-header') ) { 1405 __core.getVars.elHeader.classList.add('sticky-header'); 1406 _changeMenuClass('sticky'); 1407 1408 if( __core.getVars.elBody.classList.contains('is-expanded-menu') && __core.getVars.stickyShrink == 'true' && !__core.getVars.elHeader.classList.contains('no-sticky') ) { 1409 if( ( window.scrollY - stickyOffset ) > Number( __core.getVars.stickyShrinkOffset ) ) { 1410 __core.getVars.elHeader.classList.add('sticky-header-shrink'); 1411 } else { 1412 __core.getVars.elHeader.classList.remove('sticky-header-shrink'); 1413 } 1414 } 1415 } 1416 } else { 1417 _removeSticky(); 1418 if( __core.getVars.mobileSticky == 'true' ) { 1419 _changeMenuClass('responsive'); 1420 } 1421 } 1422 }; 1423 1424 var _removeSticky = function() { 1425 __core.getVars.elHeader.className = __core.getVars.headerClasses; 1426 __core.getVars.elHeader.classList.remove('sticky-header', 'sticky-header-shrink'); 1427 1428 if( __core.getVars.elHeaderWrap ) { 1429 __core.getVars.elHeaderWrap.className = __core.getVars.headerWrapClasses; 1430 } 1431 if( !__core.getVars.elHeaderWrap?.classList.contains('force-not-dark') ) { 1432 __core.getVars.elHeaderWrap?.classList.remove('not-dark'); 1433 } 1434 1435 __base.sliderMenuClass(); 1436 }; 1437 1438 var _changeMenuClass = function(type) { 1439 var newClassesArray = ''; 1440 1441 if( 'responsive' == type ) { 1442 if( __core.getVars.elBody.classList.contains('is-expanded-menu') ){ 1443 return true; 1444 } 1445 1446 if( __core.getVars.mobileHeaderClasses ) { 1447 newClassesArray = __core.getVars.mobileHeaderClasses.split(/ +/); 1448 } 1449 } else { 1450 if( !__core.getVars.elHeader.classList.contains('sticky-header') ){ 1451 return true; 1452 } 1453 1454 if( __core.getVars.stickyHeaderClasses ) { 1455 newClassesArray = __core.getVars.stickyHeaderClasses.split(/ +/); 1456 } 1457 } 1458 1459 var noOfNewClasses = newClassesArray.length; 1460 1461 if( noOfNewClasses > 0 ) { 1462 var i = 0; 1463 for( i=0; i<noOfNewClasses; i++ ) { 1464 if( newClassesArray[i] == 'not-dark' ) { 1465 __core.getVars.elHeader.classList.remove('dark'); 1466 if( !__core.getVars.elHeaderWrap?.classList.contains('.not-dark') ) { 1467 __core.getVars.elHeaderWrap?.classList.add('not-dark'); 1468 } 1469 }
1469 else if( newClassesArray[i] == 'dark' ) { 1470 __core.getVars.elHeaderWrap?.classList.remove('not-dark force-not-dark'); 1471 if( !__core.getVars.elHeader.classList.contains( newClassesArray[i] ) ) { 1472 __core.getVars.elHeader.classList.add( newClassesArray[i] ); 1473 } 1474 } else if( !__core.getVars.elHeader.classList.contains( newClassesArray[i] ) ) { 1475 __core.getVars.elHeader.classList.add( newClassesArray[i] ); 1476 } 1477 } 1478 } 1479 1480 __base.setBSTheme(); 1481 }; 1482 1483 var _includeHeader = function() { 1484 var elHeaderInc = document.querySelector('.include-header'); 1485 var elHeader = __core.getVars.elHeader; 1486 __core.getVars.headerHeight = elHeader.offsetHeight; 1487 1488 if( !elHeaderInc ) { 1489 return true; 1490 } 1491 1492 elHeaderInc.style.marginTop = ''; 1493 1494 if( !__core.getVars.elBody.classList.contains('is-expanded-menu') ) { 1495 return true; 1496 } 1497 1498 if( elHeader.classList.contains('floating-header') || elHeaderInc.classList.contains('include-topbar') ) { 1499 __core.getVars.headerHeight = elHeader.offsetHeight + __core.offset(elHeader).top; 1500 } 1501 1502 elHeaderInc.style.marginTop = (__core.getVars.headerHeight * -1) + 'px'; 1503 __modules.sliderParallax(); 1504 } 1505 1506 var _sideHeader = function() { 1507 var headerTrigger = document.getElementById("header-trigger"); 1508 if( headerTrigger ) { 1509 headerTrigger.onclick = function(e) { 1510 e.preventDefault(); 1511 __core.getVars.elBody.classList.contains('open-header') && __core.getVars.elBody.classList.toggle("side-header-open"); 1512 }; 1513 } 1514 }; 1515 1516 return { 1517 init: function(selector) { 1518 selector = __core.getSelector( selector, false ); 1519 if( selector.length < 1 ){ 1520 return true; 1521 } 1522 1523 var elHeader = __core.getVars.elHeader; 1524 var isSticky = elHeader.classList.contains('no-sticky') ? false : true; 1525 var headerWrapClone = elHeader.querySelector('.header-wrap-clone'); 1526 1527 __core.getVars.stickyHeaderClasses = elHeader.getAttribute('data-sticky-class'); 1528 __core.getVars.mobileHeaderClasses = elHeader.getAttribute('data-responsive-class'); 1529 __core.getVars.stickyShrink = elHeader.getAttribute('data-sticky-shrink') || 'true'; 1530 __core.getVars.stickyShrinkOffset = elHeader.getAttribute('data-sticky-shrink-offset') || 300; 1531 __core.getVars.mobileSticky = elHeader.getAttribute('data-mobile-sticky') || 'false'; 1532 __core.getVars.headerHeight = elHeader.offsetHeight; 1533 1534 if( !headerWrapClone ) { 1535 headerWrapClone = document.createElement('div'); 1536 headerWrapClone.classList = 'header-wrap-clone'; 1537 1538 __core.getVars.elHeaderWrap?.parentNode.insertBefore( headerWrapClone, __core.getVars.elHeaderWrap?.nextSibling); 1539 headerWrapClone = elHeader.querySelector('.header-wrap-clone'); 1540 } 1541 1542 if( isSticky ) { 1543 setTimeout( function() { 1544 _offset(); 1545 _sticky( __core.getVars.headerWrapOffset ); 1546 _changeMenuClass('sticky'); 1547 }, 500); 1548 1549 window.addEventListener('scroll', function(){ 1550 _sticky( __core.getVars.headerWrapOffset ); 1551 }, {passive:true}); 1552 } 1553 1554 _changeMenuClass('responsive'); 1555 _includeHeader(); 1556 _sideHeader(); 1557 1558 __core.getVars.resizers.headers = function() { 1559 setTimeout( function() { 1560 _removeSticky(); 1561 if( isSticky ) { 1562 _offset(); 1563 _sticky( __core.getVars.headerWrapOffset ); 1564 _changeMenuClass('sticky'); 1565 } 1566 _changeMenuClass('responsive'); 1567 _includeHeader(); 1568 }, 250); 1569 }; 1570 } 1571 }; 1572 }(), 1573 // Header Functions End 1574 1575 /** 1576 * -------------------------------------------------------------------------- 1577 * Menu Functions Start (Required) 1578 * -------------------------------------------------------------------------- 1579 */ 1580 Menus: function() { 1581 var _init = function() { 1582 __core.getVars.headerWrapHeight = __core.getVars.elHeaderWrap?.offsetHeight; 1583 1584 var onClickMenus = [].slice.call(__core.getVars.elPrimaryMenus).filter( function(elem) { 1585 return elem.matches('.on-click'); 1586 }); 1587 1588 var onClickTopMenus = document.querySelectorAll('.top-links.on-click'); 1589 1590 var onClickMenuCurrent = []; 1591
1592 onClickMenus.forEach( function(pMenu) { 1593 onClickMenuCurrent.push(pMenu.querySelector('.current')); 1594 }); 1595 1596 var onClickTopMenuCurrent = []; 1597 1598 onClickTopMenus.forEach( function(topMenu) { 1599 onClickTopMenuCurrent.push(topMenu.querySelector('.current')); 1600 }); 1601 1602 document.addEventListener('click', function(e) { 1603 if( !e.target.closest('.primary-menu-trigger') && !e.target.closest('.primary-menu') ) { 1604 _reset(); 1605 _functions(); 1606 } 1607 1608 if ( !e.target.closest('.primary-menu.on-click') ) { 1609 onClickMenus.forEach( function(pMenu) { 1610 pMenu.querySelectorAll('.menu-item').forEach( function(item) { 1611 item.classList.remove('current'); 1612 }); 1613 }); 1614 1615 onClickMenuCurrent?.forEach( function(current) { 1616 current?.classList.add('current'); 1617 }); 1618 } 1619 1620 if ( !e.target.closest('.top-links.on-click') ) { 1621 onClickTopMenus.forEach( function(topMenu) { 1622 topMenu.querySelectorAll('.top-links-sub-menu,.top-links-section').forEach( function(item) { 1623 item.classList.remove('d-block'); 1624 }); 1625 }); 1626 1627 onClickTopMenus.forEach( function(topMenu) { 1628 topMenu.querySelectorAll('.top-links-item').forEach( function(item) { 1629 item.classList.remove('current'); 1630 }); 1631 }); 1632 1633 onClickTopMenuCurrent?.forEach( function(current) { 1634 current?.classList.add('current'); 1635 }); 1636 } 1637 }, false); 1638 1639 document.querySelectorAll( '.menu-item' ).forEach(function(el) { 1640 if( el.querySelectorAll('.sub-menu-container').length > 0 ) { 1641 el.classList.add('sub-menu'); 1642 } 1643 1644 if( !el.classList.contains('mega-menu-title') && el.querySelectorAll('.sub-menu-container').length > 0 && el.querySelectorAll('.sub-menu-trigger').length < 1 ) { 1645 var subMenuTrigger = document.createElement('button'); 1646 subMenuTrigger.classList = 'sub-menu-trigger fa-solid fa-chevron-right'; 1647 subMenuTrigger.innerHTML = '<span class="visually-hidden">Open Sub-Menu</span>'; 1648 el.append( subMenuTrigger ); 1649 } 1650 }); 1651 }; 1652 1653 var _reset = function() { 1654 var body = __core.getVars.elBody, 1655 subMenusSel = '.mega-menu-content, .sub-menu-container', 1656 menuItemSel = '.menu-item'; 1657 1658 document.querySelectorAll('.primary-menu-trigger').forEach( function(el) { 1659 el.classList.remove('primary-menu-trigger-active'); 1660 }); 1661 1662 __core.getVars.elPrimaryMenus.forEach( function(el) { 1663 if( !body.classList.contains('is-expanded-menu') ) { 1664 el.querySelector('.menu-container')?.classList.remove('d-block'); 1665 } else { 1666 el.querySelector('.menu-container')?.classList.remove('d-block', 'd-none'); 1667 1668 el.querySelectorAll(subMenusSel)?.forEach( function(item) { 1669 item.classList.remove('d-none'); 1670 }); 1671 1672 document.querySelectorAll('.menu-container:not(.mobile-primary-menu)').forEach( function(el) { 1673 el.style.display = ''; 1674 }); 1675 1676 __core.getVars.elPrimaryMenus.forEach( function(el) { 1677 el.querySelectorAll('.mobile-primary-menu')?.forEach( function(elem) { 1678 elem.classList.remove('d-block'); 1679 }); 1680 }); 1681 } 1682 1683 el.querySelectorAll(subMenusSel)?.forEach( function(item) { 1684 item.classList.remove('d-block'); 1685 }); 1686 1687 el.classList.remove('primary-menu-active'); 1688 1689 var classes = body.className.split(" ").filter( function(classText) { 1690 return !classText.startsWith('primary-menu-open'); 1691 }); 1692 1693 body.className = classes.join(" ").trim(); 1694 }); 1695 }; 1696 1697 var _withIcon = function() { 1698 document.querySelectorAll('.mega-menu-content, .sub-menu-container').forEach( function(subMenu) { 1699 subMenu.querySelectorAll('.menu-item').forEach( function(item) { 1700 var link = item.querySelector('.menu-link'); 1701 link?.querySelector('i') && link.querySelector('span')?.classList.add('menu-subtitle-icon-offset'); 1702 }); 1703 }); 1704 }; 1705 1706 var _arrows = function() { 1707 var addArrow = function(menuItemDiv) { 1708 if( menuItemDiv && !menuItemDiv.querySelector('.sub-menu-indicator') ) { 1709 var arrow = document.createElement("i");
1710 arrow.classList.add('sub-menu-indicator'); 1711 1712 var customArrow = menuItemDiv.closest('.primary-menu')?.getAttribute('data-arrow-class') || 'fa-solid fa-caret-down'; 1713 customArrow && customArrow.split(" ").forEach( function(className) { 1714 arrow.classList.add(className); 1715 }); 1716 1717 menuItemDiv.append(arrow); 1718 } 1719 }; 1720 1721 // Arrows for Top Links Items 1722 document.querySelectorAll( '.top-links-item' ).forEach( function(menuItem) { 1723 var menuItemDiv = menuItem.querySelector(':scope > a'); 1724 menuItem.querySelector(':scope > .top-links-sub-menu, :scope > .top-links-section') && addArrow( menuItemDiv ); 1725 }); 1726 1727 // Arrows for Primary Menu Items 1728 document.querySelectorAll( '.menu-item' ).forEach( function(menuItem) { 1729 var menuItemDiv = menuItem.querySelector(':scope > .menu-link > div'); 1730 ( !menuItem.classList.contains('mega-menu-title') && menuItem.querySelector(':scope > .sub-menu-container, :scope > .mega-menu-content') ) && addArrow( menuItemDiv ); 1731 }); 1732 1733 // Arrows for Page Menu Items 1734 document.querySelectorAll( '.page-menu-item' ).forEach( function(menuItem) { 1735 var menuItemDiv = menuItem.querySelector(':scope > a > div'); 1736 menuItem.querySelector(':scope > .page-menu-sub-menu') && addArrow( menuItemDiv ); 1737 }); 1738 }; 1739 1740 var _invert = function(subMenuEl) { 1741 var subMenus = subMenuEl || document.querySelectorAll( '.mega-menu-content, .sub-menu-container, .top-links-section' ); 1742 1743 // if( !__core.getVars.elBody.classList.contains('is-expanded-menu') ) { 1744 // return false; 1745 // } 1746 1747 if( subMenus.length < 1 ) { 1748 return false; 1749 } 1750 1751 var primaryMenus; 1752 1753 subMenus.forEach( function(el) { 1754 primaryMenus = el.closest('.header-row')?.querySelectorAll('.primary-menu'); 1755 el.classList.remove('menu-pos-invert'); 1756 var elChildren = el.querySelectorAll(':scope > *'); 1757 1758 elChildren.forEach( function(elChild) { 1759 elChild.style.display = 'block'; 1760 }); 1761 el.style.display = 'block'; 1762 1763 var viewportOffset = el.getBoundingClientRect(); 1764 1765 if( el.closest('.mega-menu-small') ) { 1766 var outside = __core.viewport().width - (viewportOffset.left + viewportOffset.width); 1767 if( outside < 0 ) { 1768 el.style.left = outside + 'px'; 1769 } 1770 } 1771 1772 if( __core.getVars.elBody.classList.contains('rtl') ) { 1773 if( viewportOffset.left < 0 ) { 1774 el.classList.add('menu-pos-invert'); 1775 } 1776 } 1777 1778 if( __core.viewport().width - (viewportOffset.left + viewportOffset.width) < 0 ) { 1779 el.classList.add('menu-pos-invert'); 1780 } 1781 }); 1782 1783 subMenus.forEach( function(el) { 1784 var elChildren = el.querySelectorAll(':scope > *'); 1785 elChildren.forEach( function(elChild) { 1786 elChild.style.display = ''; 1787 }); 1788 el.style.display = ''; 1789 }); 1790 1791 primaryMenus?.forEach( function(pMenu){ 1792 pMenu.classList.add('primary-menu-init'); 1793 }); 1794 }; 1795 1796 var _hover = function() { 1797 if( !__core.getVars.elBody.classList.contains('is-expanded-menu') ) { 1798 return true; 1799 } 1800 1801 var menuHoverDelay = getComputedStyle(__core.getVars.elHeader).getPropertyValue('--cnvs-primary-menu-submenu-display-speed') || 666; 1802 1803 if( !isNaN(menuHoverDelay.split('ms')[0]) ) { 1804 menuHoverDelay = menuHoverDelay.split('ms')[0]; 1805 } else if( !isNaN(menuHoverDelay.split('s')[0]) ) { 1806 menuHoverDelay = menuHoverDelay.split('s')[0] * 1000; 1807 } 1808 1809 [].slice.call(__core.getVars.elPrimaryMenus).filter( function(elem) { 1810 return !elem.matches('.on-click'); 1811 }
1811).forEach( function(pMenu) { 1812 pMenu.querySelectorAll('.sub-menu').forEach( function(item){ 1813 var _t; 1814 1815 item.addEventListener('mouseenter', function() { 1816 clearTimeout(_t); 1817 item.classList.add('menu-item-hover'); 1818 _invert(item.querySelectorAll('.mega-menu-content, .sub-menu-container')); 1819 }); 1820 1821 item.addEventListener('mouseleave', function() { 1822 _t = setTimeout( function(){ 1823 item.classList.remove('menu-item-hover'); 1824 }, Number(menuHoverDelay)); 1825 }); 1826 }); 1827 }); 1828 }; 1829 1830 var _functions = function() { 1831 var subMenusSel = '.mega-menu-content, .sub-menu-container', 1832 menuItemSel = '.menu-item', 1833 subMenuSel = '.sub-menu', 1834 subMenuTriggerSel = '.sub-menu-trigger', 1835 body = __core.getVars.elBody.classList; 1836 1837 var triggersBtn = document.querySelectorAll( subMenuTriggerSel ); 1838 var triggerLinks = new Array; 1839 1840 triggersBtn.forEach( function(el) { 1841 var triggerLink = el.closest('.menu-item').querySelector('.menu-link[href^="#"]'); 1842 if( triggerLink ) { 1843 triggerLinks.push(triggerLink); 1844 } 1845 }); 1846 1847 var triggers = [].slice.call(triggersBtn).concat([].slice.call(triggerLinks)); 1848 1849 document.querySelectorAll(subMenuTriggerSel).forEach( function(el) { 1850 el.classList.remove('icon-rotate-90') 1851 }); 1852 1853 /** 1854 * Mobile Menu Functionality 1855 */ 1856 if( !body.contains('is-expanded-menu') ) { 1857 // Reset Menus to their Closed State 1858 __core.getVars.elPrimaryMenus.forEach( function(el) { 1859 el.querySelectorAll(subMenusSel).forEach( function(elem) { 1860 elem.classList.add('d-none'); 1861 body.remove("primary-menu-open"); 1862 }) 1863 }); 1864 1865 triggers.forEach( function(trigger) { 1866 trigger.onclick = function(e) { 1867 e.preventDefault(); 1868 1869 var triggerEl = trigger; 1870 1871 if( !trigger.classList.contains('sub-menu-trigger') ) { 1872 triggerEl = trigger.closest(menuItemSel).querySelector(':scope >
1872 ' + subMenuTriggerSel); 1873 } 1874 1875 __core.siblings(triggerEl.closest(menuItemSel)).forEach( function(item) { 1876 item.querySelectorAll(subMenusSel).forEach( function(item) { 1877 item.classList.add('d-none'); 1878 }); 1879 }); 1880 1881 if( triggerEl.closest('.mega-menu-content') ) { 1882 var parentSubMenuContainers = []; 1883 1884 __core.parents(triggerEl, menuItemSel).forEach( function(item) { 1885 parentSubMenuContainers.push(item.querySelector(':scope > ' + subMenusSel)); 1886 }); 1887 1888 [].slice.call(triggerEl.closest('.mega-menu-content').querySelectorAll(subMenusSel)).filter( function(item) { 1889 return !parentSubMenuContainers.includes(item); 1890 }).forEach( function(item) { 1891 item.classList.add('d-none'); 1892 }); 1893 } 1894 1895 _triggerState(triggerEl, menuItemSel, subMenusSel, subMenuTriggerSel, 'd-none'); 1896 }; 1897 }); 1898 } 1899 1900 /** 1901 * On-Click Menu Functionality 1902 */ 1903 if( body.contains('is-expanded-menu') ) { 1904 if( body.contains('side-header') || body.contains('overlay-menu') ) { 1905 __core.getVars.elPrimaryMenus.forEach( function(pMenu) { 1906 pMenu.classList.add('on-click'); 1907 pMenu.querySelectorAll(subMenuTriggerSel).forEach( function(item) { 1908 item.style.zIndex = '-1'; 1909 }); 1910 }); 1911 } 1912 1913 [].slice.call(__core.getVars.elPrimaryMenus).filter( function(elem) { 1914 return elem.matches('.on-click'); 1915 }
1915).forEach( function(pMenu) { 1916 var menuItemSubs = __core.has( pMenu.querySelectorAll(menuItemSel), subMenuTriggerSel ); 1917 1918 menuItemSubs.forEach( function(el) { 1919 var triggerEl = el.querySelector(':scope > .menu-link'); 1920 1921 triggerEl.onclick = function(e) { 1922 e.preventDefault(); 1923 1924 __core.siblings(triggerEl.closest(menuItemSel)).forEach( function(item) { 1925 item.querySelectorAll(subMenusSel).forEach( function(item) { 1926 item.classList.remove('d-block'); 1927 }); 1928 }); 1929 1930 if( triggerEl.closest('.mega-menu-content') ) { 1931 var parentSubMenuContainers = []; 1932 1933 __core.parents(triggerEl, menuItemSel).forEach( function(item) { 1934 parentSubMenuContainers.push(item.querySelector(':scope > ' + subMenusSel)); 1935 }); 1936 1937 [].slice.call(triggerEl.closest('.mega-menu-content').querySelectorAll(subMenusSel)).filter( function(item) { 1938 return !parentSubMenuContainers.includes(item); 1939 }).forEach( function(item) { 1940 item.classList.remove('d-block'); 1941 }); 1942 } 1943 1944 _triggerState(triggerEl, menuItemSel, subMenusSel, subMenuTriggerSel, 'd-block'); 1945 }; 1946 }); 1947 }); 1948 } 1949 1950 /** 1951 * Top-Links On-Click Functionality 1952 */ 1953 document.querySelectorAll('.top-links').forEach( function(item) { 1954 if( item.classList.contains('on-click') || !body.contains('device-up-lg') ) { 1955 item.querySelectorAll('.top-links-item').forEach( function(menuItem) { 1956 if( menuItem.querySelectorAll('.top-links-sub-menu,.top-links-section').length > 0 ) { 1957 var triggerEl = menuItem.querySelector(':scope > a'); 1958 1959 triggerEl.onclick = function(e) { 1960 e.preventDefault(); 1961 1962 __core.siblings(menuItem).forEach( function(item) { 1963 item.querySelectorAll('.top-links-sub-menu, .top-links-section').forEach( function(item) { 1964 item.classList.remove('d-block'); 1965 }); 1966 }); 1967 menuItem.querySelector(':scope > .top-links-sub-menu, :scope > .top-links-section').classList.toggle('d-block'); 1968 __core.siblings(menuItem).forEach( function(item) { 1969 item.classList.remove('current'); 1970 }); 1971 menuItem.classList.toggle('current'); 1972 }; 1973 } 1974 }) 1975 } 1976 }); 1977 1978 _invert( document.querySelectorAll('.top-links-section') ); 1979 1980 }; 1981 1982 var _triggerState = function(triggerEl, menuItemSel, subMenusSel, subMenuTriggerSel, classCheck) { 1983 triggerEl.closest('.menu-container').querySelectorAll(subMenuTriggerSel).forEach( function(el) { 1984 el.classList.remove('icon-rotate-90'); 1985 }); 1986 1987 var triggerredSubMenus = triggerEl.closest(menuItemSel).querySelector( ':scope > ' + subMenusSel ); 1988 var childSubMenus = triggerEl.closest(menuItemSel).querySelectorAll( subMenusSel ); 1989 1990 if( classCheck == 'd-none' ) { 1991 if( triggerredSubMenus.classList.contains('d-none') ) { 1992 triggerredSubMenus.classList.remove('d-none'); 1993 } else { 1994 childSubMenus.forEach( function(item) { 1995 item.classList.add('d-none'); 1996 }); 1997 } 1998 } else { 1999 if( triggerredSubMenus.classList.contains('d-block') ) { 2000 childSubMenus.forEach( function(item) { 2001 item.classList.remove('d-block'); 2002 }); 2003 } else { 2004 triggerredSubMenus.classList.add('d-block'); 2005 } 2006 } 2007 2008 _current(triggerEl, menuItemSel, subMenusSel, subMenuTriggerSel); 2009 } 2010 2011 var _current = function(triggerEl, menuItemSel, subMenusSel, subMenuTriggerSel) { 2012 [].slice.call(triggerEl.closest('.menu-container').querySelectorAll(menuItemSel)).forEach( function(item) { 2013 item.classList.remove('current'); 2014 }); 2015 2016 var setCurrent = function(item, menuItemSel, subMenusSel) { 2017 if( !__core.isHidden(item.closest(menuItemSel).querySelector(':scope > ' + subMenusSel)) ) { 2018 item.closest(menuItemSel).classList.add('current'); 2019 item.closest(menuItemSel).querySelector(':scope >
2019 ' + subMenuTriggerSel)?.classList.add('icon-rotate-90'); 2020 } else { 2021 item.closest(menuItemSel).classList.remove('current'); 2022 item.closest(menuItemSel).querySelector(':scope > ' + subMenuTriggerSel)?.classList.remove('icon-rotate-90'); 2023 } 2024 }; 2025 2026 setCurrent(triggerEl, menuItemSel, subMenusSel, subMenuTriggerSel); 2027 __core.parents(triggerEl, menuItemSel).forEach( function(item) { 2028 setCurrent(item, menuItemSel, subMenusSel, subMenuTriggerSel); 2029 }); 2030 }; 2031 2032 var _trigger = function() { 2033 var body = __core.getVars.elBody.classList; 2034 2035 document.querySelectorAll('.primary-menu-trigger').forEach( function(menuTrigger) { 2036 menuTrigger.onclick = function(e) { 2037 e.preventDefault(); 2038 2039 var elTarget = menuTrigger.getAttribute( 'data-target' ) || '*'; 2040 2041 if( __core.filtered( __core.getVars.elPrimaryMenus, elTarget ).length < 1 ) { 2042 return; 2043 } 2044 2045 if( !body.contains('is-expanded-menu') ) { 2046 __core.getVars.elPrimaryMenus.forEach( function(el) { 2047 if( el.querySelectorAll('.mobile-primary-menu').length > 0 ) { 2048 el.matches(elTarget) && el.querySelectorAll('.mobile-primary-menu').forEach( function(elem) { 2049 elem.classList.toggle('d-block'); 2050 }); 2051 } else { 2052 el.matches(elTarget) && el.querySelectorAll('.menu-container').forEach( function(elem) { 2053 elem.classList.toggle('d-block'); 2054 }); 2055 } 2056 }); 2057 } 2058 2059 menuTrigger.classList.toggle('primary-menu-trigger-active'); 2060 __core.getVars.elPrimaryMenus.forEach( function(elem) { 2061 elem.matches(elTarget) && elem.classList.toggle('primary-menu-active'); 2062 }); 2063 2064 body.toggle('primary-menu-open'); 2065 2066 if( elTarget != '*' ) { 2067 body.toggle('primary-menu-open-' + elTarget.replace(/[^a-zA-Z0-9-]/g, "")); 2068 } else { 2069 body.toggle('primary-menu-open-all'); 2070 } 2071 }; 2072 }); 2073 }; 2074 2075 var _fullWidth = function() { 2076 var body = __core.getVars.elBody.classList; 2077 2078 if( !body.contains('is-expanded-menu') ) { 2079 document.querySelectorAll('.mega-menu-content, .top-search-form').forEach( function(el) { 2080 el.style.width = ''; 2081 }); 2082 return true; 2083 } 2084 2085 var headerWidth = document.querySelector('.mega-menu:not(.mega-menu-full):not(.mega-menu-small) .mega-menu-content')?.closest('.header-row').offsetWidth; 2086 2087 if( __core.getVars.elHeader.querySelectorAll('.container-fullwidth').length > 0 ) { 2088 document.querySelectorAll('.mega-menu:not(.mega-menu-full):not(.mega-menu-small) .mega-menu-content').forEach( function(el) { 2089 el.style.width = headerWidth + 'px'; 2090 }); 2091 } 2092 2093 document.querySelectorAll('.mega-menu:not(.mega-menu-full):not(.mega-menu-small) .mega-menu-content, .top-search-form').forEach( function(el) { 2094 el.style.width = headerWidth + 'px'; 2095 }); 2096 2097 if( __core.getVars.elHeader.classList.contains('full-header') ) { 2098 document.querySelectorAll('.mega-menu:not(.mega-menu-full):not(.mega-menu-small) .mega-menu-content').forEach( function(el) { 2099 el.style.width = headerWidth + 'px'; 2100 }); 2101 } 2102 2103 if( __core.getVars.elHeader.classList.contains('floating-header') ) { 2104 var floatingHeaderPadding = getComputedStyle(document.querySelector('#header')).getPropertyValue('--cnvs-header-floating-padding'); 2105 document.querySelectorAll('.mega-menu:not(.mega-menu-full):not(.mega-menu-small) .mega-menu-content').forEach( function(el) { 2106 el.style.width = (headerWidth + (Number(floatingHeaderPadding.split('px')[0]) *2)) + 'px'; 2107 }); 2108 } 2109 }; 2110 2111 return { 2112 init: function(selector) { 2113 selector = __core.getSelector( selector, false ); 2114 if( selector.length < 1 ){ 2115 return true; 2116 } 2117 2118 _init(); 2119 _reset(); 2120 _withIcon(); 2121 _arrows(); 2122 _invert(); 2123 _hover(); 2124 _functions(); 2125 _trigger(); 2126 _fullWidth(); 2127 2128 var windowWidth = __core.viewport().width; 2129 __core.getVars.resizers.menus = function() { 2130 if( windowWidth != __core.viewport().width ) { 2131 __base.menus(); 2132 } 2133 }; 2134 2135 __core.getVars.recalls.menureset = function() { 2136 _reset(); 2137 _functions(); 2138 }; 2139 } 2140 }; 2141 }(), 2142 // Menu Functions End 2143 2144 /** 2145 * -------------------------------------------------------------------------- 2146 * Page-Menu Functions Start 2147 * -------------------------------------------------------------------------- 2148 */ 2149 PageMenu: function() { 2150 var _sticky = function(stickyOffset) { 2151 var pageMenu = __core.getVars.elPageMenu; 2152 2153 if( window.scrollY > stickyOffset ) { 2154 if( __core.getVars.elBody.classList.contains('device-up-lg') ) { 2155 pageMenu.classList.add('sticky-page-menu'); 2156 } else { 2157 if( pageMenu.getAttribute('data-mobile-sticky') == 'true' ) { 2158 pageMenu.classList.add('sticky-page-menu'); 2159 } 2160 } 2161 } else { 2162 pageMenu.classList.remove('sticky-page-menu'); 2163 } 2164 }; 2165 2166 return { 2167 init: function(selector) { 2168 selector = __core.getSelector( selector, false ); 2169 if( selector.length < 1 ){ 2170 return true; 2171 } 2172 2173 var pageMenu = __core.getVars.elPageMenu, 2174 pageMenuWrap = pageMenu.querySelector('#page-menu-wrap'), 2175 pageMenuClone = pageMenu.querySelector('.page-menu-wrap-clone'); 2176 2177 if( !pageMenuClone ) { 2178 pageMenuClone = document.createElement('div'); 2179 pageMenuClone.classList = 'page-menu-wrap-clone'; 2180 2181 pageMenuWrap.parentNode.insertBefore( pageMenuClone, pageMenuWrap.nextSibling); 2182 pageMenuClone = pageMenu.querySelector('.page-menu-wrap-clone'); 2183 } 2184 2185 pageMenuClone.style.height = pageMenu.querySelector('#page-menu-wrap').offsetHeight + 'px'; 2186 2187 pageMenu.querySelector('#page-menu-trigger').onclick = function(e) { 2188 e.preventDefault(); 2189 2190 __core.getVars.elBody.classList.remove('top-search-open'); 2191 pageMenu.classList.toggle('page-menu-open'); 2192 }; 2193 2194 pageMenu.querySelector('nav').onclick = function(e) { 2195 __core.getVars.elBody.classList.remove('top-search-open'); 2196 document.getElementById('top-cart').classList.remove('top-cart-open'); 2197 }; 2198 2199 document.addEventListener('click', function(e) { 2200 if( !e.target.closest('#page-menu') ) { 2201 pageMenu.classList.remove('page-menu-open'); 2202 } 2203 }, false); 2204 2205 if( pageMenu.classList.contains('no-sticky') || pageMenu.classList.contains('dots-menu') ) { 2206 return true; 2207 } 2208 2209 var headerHeight; 2210 2211 if( __core.getVars.elHeader.classList.contains('no-sticky') ) { 2212 headerHeight = 0; 2213 } else if( __core.getVars.elHeader.getAttribute('data-sticky-shrink') == 'false' ) { 2214 headerHeight = getComputedStyle(__core.getVars.elHeader).getPropertyValue('--cnvs-header-height').split('px')[0]; 2215 } else { 2216 headerHeight = getComputedStyle(__core.getVars.elHeader).getPropertyValue('--cnvs-header-height-shrink').split('px')[0]; 2217 } 2218 2219 pageMenu.style.setProperty("--cnvs-page-submenu-sticky-offset", headerHeight+'px'); 2220 2221 setTimeout(function() { 2222 __core.getVars.pageMenuOffset = __core.offset(pageMenu).top - headerHeight; 2223 _sticky( __core.getVars.pageMenuOffset ); 2224 }, 500); 2225 2226 window.addEventListener('scroll', function(){ 2227 _sticky( __core.getVars.pageMenuOffset ); 2228 }, {passive:true}); 2229 2230 __core.getVars.resizers.pagemenu = function() { 2231 setTimeout( function() { 2232 __core.getVars.pageMenuOffset = __core.offset(pageMenu).top - headerHeight; 2233 _sticky( __core.getVars.pageMenuOffset ); 2234 }, 250); 2235 }; 2236 } 2237 }; 2238 }(), 2239 // Page-Menu Functions End 2240 2241 /** 2242 * -------------------------------------------------------------------------- 2243 * SliderDimension Functions Start (Required if using Sliders) 2244 * -------------------------------------------------------------------------- 2245 */ 2246 SliderDimensions: function() { 2247 return { 2248 init: function(selector) { 2249 selector = __core.getSelector( selector, false ); 2250 if( selector.length < 1 ){ 2251 return true; 2252 } 2253 2254 var slider = document.querySelector('.slider-element'), 2255 sliderParallaxEl = document.querySelector('.slider-parallax'), 2256 body = __core.getVars.elBody, 2257 parallaxElHeight = sliderParallaxEl?.offsetHeight, 2258 parallaxElWidth = sliderParallaxEl?.offsetWidth, 2259 slInner = sliderParallaxEl?.querySelector('.slider-inner'), 2260 slSwiperW = slider.querySelector('.swiper-wrapper'), 2261 slSwiperS = slider.querySelector('.swiper-slide'), 2262 slFlexHeight = slider.classList.contains('h-auto') || slider.classList.contains('min-vh-0'); 2263 2264 if( body.classList.contains('device-up-lg') ) { 2265 setTimeout(function() { 2266 if( slInner ) { 2267 slInner.style.height = parallaxElHeight + 'px'; 2268 } 2269 if( slFlexHeight ) { 2270 parallaxElHeight = slider.querySelector('.slider-inner')?.querySelector('*').offsetHeight; 2271 slider.style.height = parallaxElHeight + 'px'; 2272 if( slInner ) { 2273 slInner.style.height = parallaxElHeight + 'px'; 2274 } 2275 } 2276 }, 500); 2277 2278 if( slFlexHeight && slSwiperS ) { 2279 var slSwiperFC = slSwiperS.querySelector('*'); 2280 if( slSwiperFC.classList.contains('container') || slSwiperFC.classList.contains('container-fluid') ) {
2281 slSwiperFC = slSwiperFC.querySelector('*'); 2282 } 2283 if( slSwiperFC.offsetHeight > slSwiperW.offsetHeight ) { 2284 slSwiperW.style.height = 'auto'; 2285 } 2286 } 2287 2288 if( body.classList.contains('side-header') && slInner ) { 2289 slInner.style.width = parallaxElWidth + 'px'; 2290 } 2291 2292 if( !body.classList.contains('stretched') ) { 2293 parallaxElWidth = __core.getVars.elWrapper.offsetWidth; 2294 if( slInner ) { 2295 slInner.style.width = parallaxElWidth + 'px'; 2296 } 2297 } 2298 } else { 2299 if( slSwiperW ) { 2300 slSwiperW.style.height = ''; 2301 } 2302 2303 if( sliderParallaxEl ) { 2304 sliderParallaxEl.style.height = ''; 2305 } 2306 2307 if( slInner ) { 2308 slInner.style.width = ''; 2309 slInner.style.height = ''; 2310 } 2311 } 2312 2313 __core.getVars.resizers.sliderdimensions = function() { 2314 __base.sliderDimensions(); 2315 }; 2316 } 2317 }; 2318 }(), 2319 // SliderDimension Functions End 2320 2321 /** 2322 * -------------------------------------------------------------------------- 2323 * SliderMenuClass Functions Start (Required if using Sliders with Transparent Headers) 2324 * -------------------------------------------------------------------------- 2325 */ 2326 SliderMenuClass: function() { 2327 var _swiper = function() { 2328 if( !__core.getVars.elHeader.classList.contains('ignore-slider') && ( __core.getVars.elBody.classList.contains('is-expanded-menu') || ( __core.getVars.elHeader.classList.contains('transparent-header-responsive') && !__core.getVars.elBody.classList.contains('primary-menu-open') ) ) ) { 2329 var activeSlide = __core.getVars.elSlider.querySelector('.swiper-slide-active'); 2330 _schemeChanger(activeSlide); 2331 } 2332 }; 2333 2334 var _revolution = function() { 2335 if( !__core.getVars.elHeader.classList.contains('ignore-slider') && ( __core.getVars.elBody.classList.contains('is-expanded-menu') || ( __core.getVars.elHeader.classList.contains('transparent-header-responsive') && !__core.getVars.elBody.classList.contains('primary-menu-open') ) ) ) { 2336 var activeSlide = __core.getVars.elSlider.querySelector('.active-revslide'); 2337 _schemeChanger(activeSlide); 2338 } 2339 }; 2340 2341 var _schemeChanger = function(activeSlide) { 2342 if( !activeSlide ) { 2343 return; 2344 } 2345 2346 var darkExists = false, 2347 oldClassesArray, 2348 noOfOldClasses; 2349 2350 if( activeSlide.classList.contains('dark') ){ 2351 if( __core.getVars.headerClasses ) { 2352 oldClassesArray = __core.getVars.headerClasses; 2353 } else { 2354 oldClassesArray = ''; 2355 } 2356 2357 noOfOldClasses = oldClassesArray.length; 2358 2359 if( noOfOldClasses > 0 ) { 2360 for( var i=0; i<noOfOldClasses; i++ ) { 2361 if( oldClassesArray[i] == 'dark' ) { 2362 darkExists = true; 2363 break; 2364 } 2365 } 2366 } 2367 2368 var headerToChange = document.querySelector('#header.transparent-header:not(.sticky-header,.semi-transparent,.floating-header)'); 2369 if( headerToChange ) { 2370 headerToChange.classList.add('dark'); 2371 } 2372 2373 if( !darkExists ) { 2374 var headerToChange = document.querySelector('#header.transparent-header.sticky-header,#header.transparent-header.semi-transparent.sticky-header,#header.transparent-header.floating-header.sticky-header'); 2375 if( headerToChange ) { 2376 headerToChange.classList.remove('dark'); 2377 } 2378 } 2379 __core.getVars.elHeaderWrap.classList.remove('not-dark'); 2380 } else { 2381 if( __core.getVars.elBody.classList.contains('dark') ) { 2382 activeSlide.classList.add('not-dark'); 2383 document.querySelector('#header.transparent-header:not(.semi-transparent,.floating-header)').classList.remove('dark'); 2384 document.querySelector('#header.transparent-header:not(.sticky-header,.semi-transparent,.floating-header)')?.querySelector('#header-wrap').classList.add('not-dark'); 2385 } else { 2386 document.querySelector('#header.transparent-header:not(.semi-transparent,.floating-header)').classList.remove('dark'); 2387 __core.getVars.elHeaderWrap.classList.remove('not-dark'); 2388 } 2389 } 2390 2391 if( __core.getVars.elHeader.classList.contains('sticky-header') ) { 2392 __base.headers(); 2393 } 2394 }; 2395 2396 return { 2397 init: function(selector) { 2398 selector = __core.getSelector( selector, false ); 2399 if( selector.length < 1 ){ 2400 return true; 2401 } 2402 2403 if( !__core.getVars.elBody.classList.contains('is-expanded-menu') ) { 2404 return true; 2405 } 2406 2407 _swiper(); 2408 _revolution(); 2409 __base.setBSTheme(); 2410 2411 __core.getVars.resizers.slidermenuclass = function() { 2412 __base.sliderMenuClass(); 2413 }; 2414 } 2415 }; 2416 }(), 2417 // SliderMenuClass Functions End 2418 2419 /** 2420 * -------------------------------------------------------------------------- 2421 * TopSearch Functions Start (Required) 2422 * -------------------------------------------------------------------------- 2423 */ 2424 TopSearch: function() { 2425 return { 2426 init: function(selector) { 2427 selector = __core.getSelector( selector, false ); 2428 if( selector.length < 1 ){ 2429 return true; 2430 } 2431 2432 var searchForm = document.querySelector('.top-search-form'); 2433 2434 if( !searchForm ) { 2435 return true; 2436 } 2437 2438 searchForm.closest('.header-row')?.classList.add( 'top-search-parent' ); 2439 2440 var topSearchParent = document.querySelector('.top-search-parent'), 2441 timeout; 2442 2443 selector[0].onclick = function(e) { 2444 e.stopPropagation(); 2445 e.preventDefault(); 2446 2447 clearTimeout( timeout ); 2448 2449 __core.getVars.elBody.classList.toggle('top-search-open'); 2450 document.getElementById('top-cart')?.classList.remove('top-cart-open'); 2451 2452 __core.getVars.recalls.menureset(); 2453 2454 if( __core.getVars.elBody.classList.contains('top-search-open') ) { 2455 topSearchParent?.classList.add('position-relative'); 2456 } else { 2457 timeout = setTimeout( function() { 2458 topSearchParent?.classList.remove('position-relative'); 2459 }, 500); 2460 } 2461 2462 __core.getVars.elBody.classList.remove("primary-menu-open"); 2463 __core.getVars.elPageMenu && __core.getVars.elPageMenu.classList.remove('page-menu-open'); 2464 2465 if (__core.getVars.elBody.classList.contains('top-search-open')){ 2466 searchForm.querySelector('input').focus(); 2467 } 2468 }; 2469 2470 document.addEventListener( 'click', function(e) { 2471 if (!e.target.closest('.top-search-form')) { 2472 __core.getVars.elBody.classList.remove('top-search-open'); 2473 timeout = setTimeout( function() { 2474 topSearchParent?.classList.remove('position-relative'); 2475 }, 500); 2476 } 2477 }, false); 2478 } 2479 }; 2480 }(), 2481 // TopSearch Functions End 2482 2483 /** 2484 * -------------------------------------------------------------------------- 2485 * TopCart Functions Start (Required) 2486 * -------------------------------------------------------------------------- 2487 */ 2488 TopCart: function() { 2489 return { 2490 init: function(selector) { 2491 selector = __core.getSelector( selector, false ); 2492 if( selector.length < 1 ){ 2493 return true; 2494 } 2495 2496 if( !document.getElementById('top-cart-trigger') ) { 2497 return false;
2498 } 2499 2500 document.getElementById('top-cart-trigger').onclick = function(e) { 2501 e.stopPropagation(); 2502 e.preventDefault(); 2503 2504 selector[0].classList.toggle('top-cart-open'); 2505 }; 2506 2507 document.addEventListener('click', function(e) { 2508 if( !e.target.closest('#top-cart') ) { 2509 selector[0].classList.remove('top-cart-open'); 2510 } 2511 }, false); 2512 } 2513 }; 2514 }(), 2515 // TopCart Functions End 2516 2517 /** 2518 * -------------------------------------------------------------------------- 2519 * SidePanel Functions Start 2520 * -------------------------------------------------------------------------- 2521 */ 2522 SidePanel: function() { 2523 return { 2524 init: function(selector) { 2525 selector = __core.getSelector( selector, false ); 2526 if( selector.length < 1 ){ 2527 return true; 2528 } 2529 2530 var body = __core.getVars.elBody.classList; 2531 2532 document.addEventListener('click', function(e) { 2533 if( !e.target.closest('#side-panel') && !e.target.closest('.side-panel-trigger') ) { 2534 body.remove('side-panel-open'); 2535 } 2536 }, false); 2537 2538 document.querySelectorAll('.side-panel-trigger').forEach( function(el) { 2539 el.onclick = function(e) { 2540 e.preventDefault(); 2541 2542 body.toggle('side-panel-open'); 2543 if( body.contains('device-touch') && body.contains('side-push-panel') ) { 2544 body.toggle('ohidden'); 2545 } 2546 }; 2547 }); 2548 } 2549 }; 2550 }(), 2551 // SidePanel Functions End 2552 2553 /** 2554 * -------------------------------------------------------------------------- 2555 * AdaptiveColorScheme Functions Start 2556 * -------------------------------------------------------------------------- 2557 */ 2558 AdaptiveColorScheme: function() { 2559 return { 2560 init: function(selector) { 2561 if( __core.getSelector(selector, false, false).length < 1 ){ 2562 return true; 2563 } 2564 2565 __core.initFunction({ class: 'has-plugin-adaptivecolorscheme', event: 'pluginAdaptiveColorSchemeReady' }); 2566 2567 selector = __core.getSelector( selector, false ); 2568 if( selector.length < 1 ){ 2569 return true; 2570 } 2571 2572 var adaptiveEl = document.querySelector('[data-adaptive-light-class],[data-adaptive-dark-class]'); 2573 var adaptLightClass; 2574 var adaptDarkClass; 2575 2576 if( __core.getVars.elBody.contains(adaptiveEl) ) { 2577 adaptLightClass = adaptiveEl.getAttribute( 'data-adaptive-light-class' ); 2578 adaptDarkClass = adaptiveEl.getAttribute( 'data-adaptive-dark-class' ); 2579 } 2580 2581 var adaptClasses = function(dark) { 2582 if( dark ) { 2583 __core.getVars.elBody.classList.add( 'dark' ); 2584 } else { 2585 __core.getVars.elBody.classList.remove('dark'); 2586 } 2587 2588 if( __core.getVars.elBody.contains(adaptiveEl) ) { 2589 if( dark ) { 2590 adaptiveEl.classList.remove( adaptLightClass ); 2591 adaptiveEl.classList.add( adaptDarkClass ); 2592 } else { 2593 adaptiveEl.classList.remove( adaptDarkClass ); 2594 adaptiveEl.classList.add( adaptLightClass ); 2595 } 2596 } 2597 2598 __base.setBSTheme(); 2599 }; 2600 2601 if( window.matchMedia ) { 2602 adaptClasses( window.matchMedia('(prefers-color-scheme: dark)').matches ); 2603 2604 window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function(e) { 2605 adaptClasses( e.matches ); 2606 }); 2607 } 2608 } 2609 }; 2610 }(), 2611 // AdaptiveColorScheme Functions End 2612 2613 /** 2614 * -------------------------------------------------------------------------- 2615 * PortfolioAjax Functions Start 2616 * -------------------------------------------------------------------------- 2617 */ 2618 PortfolioAjax: function() { 2619 var _newNextPrev = function(portPostId) { 2620 var portNext = _getNext(portPostId); 2621 var portPrev = _getPrev(portPostId); 2622 var portNav = document.getElementById('portfolio-navigation'); 2623 2624 if( !document.getElementById('prev-portfolio') && portPrev ) { 2625 var prevPortItem = document.createElement('a'); 2626 prevPortItem.setAttribute('href', '#'); 2627 prevPortItem.setAttribute('id', 'prev-portfolio'); 2628 prevPortItem.setAttribute('data-id', portPrev); 2629 prevPortItem.innerHTML = '<i class="bi-arrow-left"></i>'; 2630 prevPortItem && portNav?.insertBefore(prevPortItem, document.getElementById('close-portfolio')); 2631 } 2632 2633 if( !document.getElementById('next-portfolio') && portNext ) { 2634 var nextPortItem = document.createElement('a'); 2635 nextPortItem.setAttribute('href', '#'); 2636 nextPortItem.setAttribute('id', 'next-portfolio'); 2637 nextPortItem.setAttribute('data-id', portNext); 2638 nextPortItem.innerHTML = '<i class="bi-arrow-right"></i>'; 2639 nextPortItem && portNav?.insertBefore(nextPortItem, document.getElementById('close-portfolio')); 2640 } 2641 }; 2642 2643 var _load = function(portPostId, prevPostPortId, getIt) { 2644 if( !getIt ) { 2645 getIt = false;
2646 } 2647 2648 var portNext = _getNext(portPostId); 2649 var portPrev = _getPrev(portPostId); 2650 2651 if( getIt == false ) { 2652 _close(); 2653 __core.getVars.elBody.classList.add('portfolio-ajax-loading'); 2654 // __core.getVars.portfolioAjax.loader.classList.add('loader-overlay-display'); 2655 var portfolioDataLoader = document.getElementById(portPostId).getAttribute('data-loader'); 2656 2657 fetch(portfolioDataLoader).then( function(response) { 2658 return response.text(); 2659 }).then( function(html) { 2660 __core.getVars.portfolioAjax.container.innerHTML = html; 2661 2662 var nextPortfolio = document.getElementById('next-portfolio'), 2663 prevPortfolio = document.getElementById('prev-portfolio'); 2664 2665 nextPortfolio?.classList.add('d-none'); 2666 prevPortfolio?.classList.add('d-none'); 2667 2668 if( portNext ) { 2669 nextPortfolio?.setAttribute('data-id', portNext); 2670 nextPortfolio?.classList.remove('d-none'); 2671 } 2672 2673 if( portPrev ) { 2674 prevPortfolio?.setAttribute('data-id', portPrev); 2675 prevPortfolio?.classList.remove('d-none'); 2676 } 2677 2678 _initAjax(portPostId); 2679 _open(); 2680 2681 __core.getVars.portfolioAjax.items.forEach( function(item) { 2682 item.classList.remove('portfolio-active'); 2683 }); 2684 2685 document.getElementById(portPostId).classList.add('portfolio-active'); 2686 }).catch( function(error) { 2687 console.warn('Something went wrong.', error); 2688 }); 2689 } 2690 }; 2691 2692 var _close = function() { 2693 if( __core.getVars.portfolioAjax.wrapper && __core.getVars.portfolioAjax.wrapper.offsetHeight > 32 ) { 2694 __core.getVars.elBody.classList.remove('portfolio-ajax-loading'); 2695 // __core.getVars.portfolioAjax.loader.classList.add('loader-overlay-display'); 2696 __core.getVars.portfolioAjax.wrapper.classList.remove('portfolio-ajax-opened'); 2697 2698 __core.getVars.portfolioAjax.wrapper.querySelector('#portfolio-ajax-single').addEventListener('transitionend', function() { 2699 __core.getVars.portfolioAjax.wrapper.querySelector('#portfolio-ajax-single').remove(); 2700 }); 2701 2702 __core.getVars.portfolioAjax.items.forEach( function(item) { 2703 item.classList.remove('portfolio-active'); 2704 }); 2705 } 2706 }; 2707 2708 var _open = function() { 2709 var countImages = __core.getVars.portfolioAjax.container.querySelectorAll('img').length; 2710 2711 if( countImages < 1 ) { 2712 _display(); 2713 } else { 2714 __core.imagesLoaded(__core.getVars.portfolioAjax.container); 2715 __core.getVars.portfolioAjax.container.addEventListener( 'CanvasImagesLoaded', function() { 2716 _display(); 2717 }); 2718 } 2719 }; 2720 2721 var _display = function() { 2722 __core.getVars.portfolioAjax.container.style.display = 'block'; 2723 __core.getVars.portfolioAjax.wrapper.classList.add('portfolio-ajax-opened'); 2724 __core.getVars.elBody.classList.remove('portfolio-ajax-loading'); 2725 // __core.getVars.portfolioAjax.loader.classList.remove('loader-overlay-display'); 2726 setTimeout( function() { 2727 __core.runContainerModules( __core.getVars.portfolioAjax.wrapper ); 2728 __core.scrollTo((__core.getVars.portfolioAjax.wrapperOffset - __core.getVars.topScrollOffset - 60), false, false); 2729 }, 500); 2730 } 2731 2732 var _getNext = function(portPostId) { 2733 var portNext = false; 2734 var hasNext = document.getElementById(portPostId).nextElementSibling; 2735 2736 if( hasNext ) { 2737 portNext = hasNext.getAttribute('id'); 2738 } 2739 2740 return portNext; 2741 }; 2742 2743 var _getPrev = function(portPostId) { 2744 var portPrev = false; 2745 var hasPrev = document.getElementById(portPostId).previousElementSibling; 2746 2747 if( hasPrev ) { 2748 portPrev = hasPrev.getAttribute('id'); 2749 } 2750 2751 return portPrev; 2752 }; 2753 2754 var _initAjax = function(portPostId) { 2755 __core.getVars.portfolioAjax.prevItem = document.getElementById(portPostId); 2756 2757 _newNextPrev(portPostId); 2758 2759 document.querySelectorAll('#next-portfolio, #prev-portfolio').forEach( function(el) { 2760 el.onclick = function(e) { 2761 e.preventDefault(); 2762 _close(); 2763 2764 var portPostId = el.getAttribute('data-id'); 2765 document.getElementById(portPostId).classList.add('portfolio-active'); 2766 _load(portPostId, __core.getVars.portfolioAjax.prevItem); 2767 }; 2768 }) 2769 2770 document.getElementById('close-portfolio').onclick = function(e) { 2771 e.preventDefault(); 2772 _close(); 2773 }; 2774 }; 2775 2776 return { 2777 init: function(selector) { 2778 if( __core.getSelector(selector, false, false).length < 1 ){ 2779 return true; 2780 } 2781 2782 __core.initFunction({ class: 'has-plugin-ajaxportfolio', event: 'pluginAjaxPortfolioReady' }); 2783 2784 selector = __core.getSelector( selector, false ); 2785 if( selector.length < 1 ){ 2786 return true; 2787 } 2788 2789 __core.getVars.portfolioAjax.items = selector[0].querySelectorAll('.portfolio-item'); 2790 __core.getVars.portfolioAjax.wrapper = document.getElementById('portfolio-ajax-wrap'); 2791 __core.getVars.portfolioAjax.wrapperOffset = __core.offset(__core.getVars.portfolioAjax.wrapper).top; 2792 __core.getVars.portfolioAjax.container = document.getElementById('portfolio-ajax-container'); 2793 __core.getVars.portfolioAjax.loader = document.getElementById('portfolio-ajax-loader'); 2794 __core.getVars.portfolioAjax.prevItem = ''; 2795 2796 selector[0].querySelectorAll('.portfolio-ajax-trigger').forEach( function(el) { 2797 if( !el.querySelector('i:nth-child(2)') ) { 2798 el.innerHTML += '<i class="bi-arrow-repeat icon-spin"></i>'; 2799 } 2800 2801 el.onclick = function(e) { 2802 e.preventDefault(); 2803 2804 var portPostId = e.target.closest('.portfolio-item').getAttribute('id'); 2805 2806 if( !e.target.closest('.portfolio-item').classList.contains('portfolio-active') ) { 2807 _load(portPostId, __core.getVars.portfolioAjax.prevItem); 2808 } 2809 }; 2810 }); 2811 } 2812 }; 2813 }(), 2814 // PortfolioAjax Functions End 2815 2816 /** 2817 * --------------------------------------------------------------------------
2818 * Cursor Functions Start 2819 * -------------------------------------------------------------------------- 2820 */ 2821 Cursor: function() { 2822 return { 2823 init: function(selector) { 2824 __core.initFunction({ class: 'has-plugin-cursor', event: 'pluginCursorReady' }); 2825 2826 var cursor = document.querySelector('.cnvs-cursor'); 2827 var cursorFollower = document.querySelector('.cnvs-cursor-follower'); 2828 var cursorDot = document.querySelector('.cnvs-cursor-dot'); 2829 2830 var addCursorEl = function(selector, parent) { 2831 var el = document.createElement('div'); 2832 el.classList.add(selector.split('.')[1]); 2833 2834 parent.prepend( el ); 2835 return document.querySelector(selector); 2836 }; 2837 2838 if( !cursor ) { 2839 cursor = addCursorEl('.cnvs-cursor', __core.getVars.elWrapper); 2840 } 2841 2842 if( !cursorFollower ) { 2843 cursorFollower = addCursorEl('.cnvs-cursor-follower', cursor); 2844 } 2845 2846 if( !cursorDot ) { 2847 cursorDot = addCursorEl('.cnvs-cursor-dot', cursor); 2848 } 2849 2850 var onMouseMove = function(event) { 2851 cursor.style.transform = "translate3d("+ event.clientX + 'px'+","+event.clientY+'px'+",0px)"; 2852 } 2853 2854 document.addEventListener('mousemove', onMouseMove); 2855 2856 document.querySelectorAll('a,button').forEach( function(el) { 2857 el.addEventListener('mouseenter', function() { 2858 cursor.classList.add('cnvs-cursor-action'); 2859 }); 2860 2861 el.addEventListener('mouseleave', function() { 2862 cursor.classList.remove('cnvs-cursor-action'); 2863 }); 2864 }); 2865 2866 document.querySelectorAll('.cursor-disable').forEach( function(el) { 2867 el.addEventListener('mouseenter', function() { 2868 cursor.classList.add('cnvs-cursor-disabled'); 2869 }); 2870 2871 el.addEventListener('mouseleave', function() { 2872 cursor.classList.remove('cnvs-cursor-disabled'); 2873 }); 2874 }); 2875 } 2876 }; 2877 }(), 2878 // Cursor Functions End 2879 2880 /** 2881 * -------------------------------------------------------------------------- 2882 * Bootstrap Functions Start 2883 * -------------------------------------------------------------------------- 2884 */ 2885 Bootstrap: function() { 2886 return { 2887 init: function(selector) { 2888 __core.isFuncTrue( function() { 2889 return typeof bootstrap !== 'undefined'; 2890 }).then( function(cond) { 2891 if( !cond ) { 2892 return false; 2893 } 2894 2895 __core.initFunction({ class: 'has-plugin-bootstrap', event: 'pluginBootstrapReady' }); 2896 }); 2897 } 2898 }; 2899 }(), 2900 // Bootstrap Functions End 2901 2902 /** 2903 * -------------------------------------------------------------------------- 2904 * ResizeVideos Functions Start 2905 * -------------------------------------------------------------------------- 2906 */ 2907 ResizeVideos: function() { 2908 return { 2909 init: function(selector) { 2910 if( __core.getSelector(selector, false, false).length < 1 ){ 2911 return true; 2912 } 2913 2914 __core.isFuncTrue( function() { 2915 return typeof jQuery !== 'undefined' && jQuery().fitVids; 2916 }).then( function(cond) { 2917 if( !cond ) { 2918 return false; 2919 } 2920 2921 __core.initFunction({ class: 'has-plugin-fitvids', event: 'pluginFitVidsReady' }); 2922 2923 selector = __core.getSelector( selector ); 2924 if( selector.length < 1 ){ 2925 return true; 2926 } 2927 2928 selector.parent().fitVids({ 2929 customSelector: 'iframe[src*="youtube"],iframe[src*="vimeo"],iframe[src*="dailymotion"],iframe[src*="maps.google.com"],iframe[src*="google.com/maps"]', 2930 ignore: '.no-fv' 2931 }); 2932 }); 2933 } 2934 }; 2935 }(), 2936 // ResizeVideos Functions End 2937 2938 /** 2939 * -------------------------------------------------------------------------- 2940 * PageTransition Functions Start 2941 * -------------------------------------------------------------------------- 2942 */ 2943 PageTransition: function() { 2944 return { 2945 init: function(selector) { 2946 var body = __core.getVars.elBody; 2947 2948 __core.initFunction({ class: 'has-plugin-pagetransition', event: 'pluginPageTransitionReady' }); 2949 2950 if( body.classList.contains('no-transition') ) { 2951 return true; 2952 } 2953 2954 if( !body.classList.contains('page-transition') ) { 2955 body.classList.add('page-transition'); 2956 } 2957 2958 window.onpageshow = function(event) { 2959 if(event.persisted) { 2960 window.location.reload(); 2961 } 2962 }; 2963 2964 var pageTransition = document.querySelector('.page-transition-wrap'); 2965 2966 var elAnimIn = body.getAttribute('data-animation-in') || 'fadeIn', 2967 elSpeedIn = body.getAttribute('data-speed-in') || 1000, 2968 elTimeoutActive = false, 2969 elTimeout = body.getAttribute('data-loader-timeout'), 2970 elLoader = body.getAttribute('data-loader'), 2971 elLoaderColor = body.getAttribute('data-loader-color'), 2972 elLoaderHtml = body.getAttribute('data-loader-html'), 2973 elLoaderAppend = '', 2974 elLoaderCSSVar = ''; 2975 2976 if( !elTimeout ) { 2977 elTimeoutActive = false;
2978 elTimeout = false; 2979 } else { 2980 elTimeoutActive = true; 2981 elTimeout = Number(elTimeout); 2982 } 2983 2984 if( elLoaderColor ) { 2985 if( elLoaderColor == 'theme' ) { 2986 elLoaderCSSVar = ' style="--cnvs-loader-color:var(--cnvs-themecolor);"'; 2987 } else { 2988 elLoaderCSSVar = ' style="--cnvs-loader-color:'+elLoaderColor+';"'; 2989 } 2990 } 2991 2992 var elLoaderBefore = '<div class="css3-spinner"'+elLoaderCSSVar+'>', 2993 elLoaderAfter = '</div>'; 2994 2995 if( elLoader == '2' ) { 2996 elLoaderAppend = '<div class="css3-spinner-flipper"></div>'; 2997 } else if( elLoader == '3' ) { 2998 elLoaderAppend = '<div class="css3-spinner-double-bounce1"></div><div class="css3-spinner-double-bounce2"></div>'; 2999 } else if( elLoader == '4' ) { 3000 elLoaderAppend = '<div class="css3-spinner-rect1"></div><div class="css3-spinner-rect2"></div><div class="css3-spinner-rect3"></div><div class="css3-spinner-rect4"></div><div class="css3-spinner-rect5"></div>'; 3001 } else if( elLoader == '5' ) { 3002 elLoaderAppend = '<div class="css3-spinner-cube1"></div><div class="css3-spinner-cube2"></div>'; 3003 } else if( elLoader == '6' ) { 3004 elLoaderAppend = '<div class="css3-spinner-scaler"></div>'; 3005 } else if( elLoader == '7' ) { 3006 elLoaderAppend = '<div class="css3-spinner-grid-pulse"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'; 3007 } else if( elLoader == '8' ) { 3008 elLoaderAppend = '<div class="css3-spinner-clip-rotate"><div></div></div>'; 3009 } else if( elLoader == '9' ) { 3010 elLoaderAppend = '<div class="css3-spinner-ball-rotate"><div></div><div></div><div></div></div>'; 3011 } else if( elLoader == '10' ) { 3012 elLoaderAppend = '<div class="css3-spinner-zig-zag"><div></div><div></div></div>'; 3013 } else if( elLoader == '11' ) { 3014 elLoaderAppend = '<div class="css3-spinner-triangle-path"><div></div><div></div><div></div></div>'; 3015 } else if( elLoader == '12' ) { 3016 elLoaderAppend = '<div class="css3-spinner-ball-scale-multiple"><div></div><div></div><div></div></div>'; 3017 } else if( elLoader == '13' ) { 3018 elLoaderAppend = '<div class="css3-spinner-ball-pulse-sync"><div></div><div></div><div></div></div>'; 3019 } else if( elLoader == '14' ) { 3020 elLoaderAppend = '<div class="css3-spinner-scale-ripple"><div></div><div></div><div></div></div>'; 3021 } else { 3022 elLoaderAppend = '<div class="css3-spinner-bounce1"></div><div class="css3-spinner-bounce2"></div><div class="css3-spinner-bounce3"></div>'; 3023 } 3024 3025 if( !elLoaderHtml ) { 3026 elLoaderHtml = elLoaderAppend; 3027 } 3028 3029 elLoaderHtml = elLoaderBefore + elLoaderHtml + elLoaderAfter; 3030 3031 if( elAnimIn == 'fadeIn' ) { 3032 __core.getVars.elWrapper.classList.add('op-1'); 3033 } else { 3034 __core.getVars.elWrapper.classList.add('not-animated'); 3035 } 3036 3037 if( !pageTransition ) { 3038 var divPT = document.createElement('div'); 3039 divPT.classList.add('page-transition-wrap'); 3040 divPT.innerHTML = elLoaderHtml; 3041 body.prepend( divPT ); 3042 pageTransition = document.querySelector('.page-transition-wrap'); 3043 } 3044 3045 if( elSpeedIn ) { 3046 __core.getVars.elWrapper.style.setProperty('--cnvs-animate-duration', Number(elSpeedIn)+'ms'); 3047 if( elAnimIn == 'fadeIn' ) { 3048 pageTransition.style.setProperty('--cnvs-animate-duration', Number(elSpeedIn)+'ms'); 3049 } 3050 } 3051 3052 var endPageTransition = function() { 3053 elAnimIn.split(" ").forEach( function(_class) { 3054 pageTransition.classList.remove(_class); 3055 }); 3056 3057 pageTransition.classList.add('fadeOut', 'animated'); 3058 3059 var removePageTransition = function() { 3060 pageTransition.remove(); 3061 if( elAnimIn != 'fadeIn' ) { 3062 __core.getVars.elWrapper.classList.remove('not-animated'); 3063 (elAnimIn + ' animated').split(" ").forEach(function(_class) { 3064 __core.getVars.elWrapper.classList.add(_class); 3065 }); 3066 } 3067 }; 3068 3069 var displayContent = function() { 3070 body.classList.remove('page-transition'); 3071 3072 setTimeout(function() { 3073 (elAnimIn + ' animated').split(" ").forEach( function(_class) { 3074 __core.getVars.elWrapper.classList.remove(_class); 3075 }); 3076 }, 333); 3077 3078 setTimeout(function() { 3079 __core.getVars.elWrapper.style.removeProperty('--cnvs-animate-duration'); 3080 }, 666); 3081 }; 3082 3083 pageTransition.addEventListener('transitionend', removePageTransition); 3084 pageTransition.addEventListener('animationend', removePageTransition); 3085 __core.getVars.elWrapper.addEventListener('transitionend', displayContent); 3086 __core.getVars.elWrapper.addEventListener('animationend', displayContent); 3087 3088 return true; 3089 }; 3090 3091 if( document.readyState === 'complete' ) { 3092 endPageTransition(); 3093 } 3094 3095 if( elTimeoutActive ) { 3096 setTimeout( endPageTransition, elTimeout ); 3097 } 3098 3099 window.addEventListener('load', function(){ 3100 endPageTransition(); 3101 }); 3102 } 3103 }; 3104 }(), 3105 // PageTransition Functions End 3106 3107 /** 3108 * -------------------------------------------------------------------------- 3109 * LazyLoad Functions Start 3110 * -------------------------------------------------------------------------- 3111 */ 3112 LazyLoad: function() { 3113 return { 3114 init: function(selector) { 3115 if( __core.getSelector(selector, false, false).length < 1 ){ 3116 return true; 3117 } 3118 3119 __core.isFuncTrue( function() { 3120 return typeof LazyLoad !== "undefined" 3121 }).then( function(cond) { 3122 if( !cond ) { 3123 return false;
3124 } 3125 3126 __core.initFunction({ class: 'has-plugin-lazyload', event: 'pluginlazyLoadReady' }); 3127 3128 window.lazyLoadInstance = new LazyLoad({ 3129 threshold: 0, 3130 elements_selector: '.lazy:not(.lazy-loaded)', 3131 class_loading: 'lazy-loading', 3132 class_loaded: 'lazy-loaded', 3133 class_error: 'lazy-error', 3134 callback_loaded: function(el) { 3135 __core.addEvent( window, 'lazyLoadLoaded' ); 3136 if( el.parentNode.getAttribute('data-lazy-container') == 'true' ) { 3137 __core.runContainerModules( el.parentNode ); 3138 } 3139 } 3140 }); 3141 }); 3142 } 3143 }; 3144 }(), 3145 // LazyLoad Functions End 3146 3147 /** 3148 * -------------------------------------------------------------------------- 3149 * DataClasses Functions Start 3150 * -------------------------------------------------------------------------- 3151 */ 3152 DataClasses: function() { 3153 return { 3154 init: function(selector) { 3155 if( __core.getSelector(selector, false, false).length < 1 ){ 3156 return true; 3157 } 3158 3159 __core.initFunction({ class: 'has-plugin-dataclasses', event: 'pluginDataClassesReady' }); 3160 3161 selector = __core.getSelector( selector, false, false ); 3162 if( selector.length < 1 ){ 3163 return true; 3164 } 3165 3166 selector.forEach( function(el) { 3167 var classes = el.getAttribute('data-class'); 3168 3169 classes = classes.split(/ +/); 3170 if( classes.length > 0 ) { 3171 classes.forEach( function(_class) { 3172 var deviceClass = _class.split(":"); 3173 if( __core.getVars.elBody.classList.contains(deviceClass[0] == 'dark' ? deviceClass[0] : 'device-' + deviceClass[0]) ) { 3174 el.classList.add(deviceClass[1]); 3175 } else { 3176 el.classList.remove(deviceClass[1]); 3177 } 3178 }); 3179 } 3180 }); 3181 3182 __core.getVars.resizers.dataClasses = function() { 3183 setTimeout( function() { 3184 __modules.dataClasses(); 3185 }, 333); 3186 }; 3187 } 3188 }; 3189 }(), 3190 // DataClasses Functions End 3191 3192 /** 3193 * -------------------------------------------------------------------------- 3194 * DataHeights Functions Start 3195 * -------------------------------------------------------------------------- 3196 */ 3197 DataHeights: function() { 3198 return { 3199 init: function(selector) { 3200 if( __core.getSelector(selector, false, false).length < 1 ){ 3201 return true; 3202 } 3203 3204 __core.initFunction({ class: 'has-plugin-dataheights', event: 'pluginDataHeightsReady' }); 3205 3206 selector = __core.getSelector( selector, false, false ); 3207 if( selector.length < 1 ){ 3208 return true; 3209 } 3210 3211 selector.forEach( function(el) { 3212 var heightXs = el.getAttribute('data-height-xs') || 'auto', 3213 heightSm = el.getAttribute('data-height-sm') || heightXs, 3214 heightMd = el.getAttribute('data-height-md') || heightSm, 3215 heightLg = el.getAttribute('data-height-lg') || heightMd, 3216 heightXl = el.getAttribute('data-height-xl') || heightLg, 3217 heightXxl = el.getAttribute('data-height-xxl') || heightXl, 3218 body = __core.getVars.elBody.classList, 3219 elHeight; 3220 3221 if( body.contains('device-xs') ) { 3222 elHeight = heightXs; 3223 } else if( body.contains('device-sm') ) { 3224 elHeight = heightSm; 3225 } else if( body.contains('device-md') ) { 3226 elHeight = heightMd; 3227 } else if( body.contains('device-lg') ) { 3228 elHeight = heightLg; 3229 } else if( body.contains('device-xl') ) { 3230 elHeight = heightXl; 3231 } else if( body.contains('device-xxl') ) { 3232 elHeight = heightXxl; 3233 } 3234 3235 if( elHeight ) { 3236 el.style.height = !isNaN( elHeight ) ? elHeight + 'px' : elHeight; 3237 } 3238 }); 3239 3240 __core.getVars.resizers.dataHeights = function() { 3241 __modules.dataHeights(); 3242 }; 3243 } 3244 }; 3245 }(), 3246 // DataHeights Functions End 3247 3248 /** 3249 * -------------------------------------------------------------------------- 3250 * Lightbox Functions Start 3251 * -------------------------------------------------------------------------- 3252 */ 3253 Lightbox: function() { 3254 return { 3255 init: function(selector) { 3256 if( __core.getSelector(selector, false, false).length < 1 ){ 3257 return true; 3258 } 3259 3260 __core.isFuncTrue( function() { 3261 return typeof jQuery !== 'undefined' && jQuery().magnificPopup; 3262 }).then( function(cond) { 3263 if( !cond ) { 3264 return false;
3265 } 3266 3267 __core.initFunction({ class: 'has-plugin-lightbox', event: 'pluginLightboxReady' }); 3268 3269 selector = __core.getSelector( selector ); 3270 if( selector.length < 1 ){ 3271 return true; 3272 } 3273 3274 var closeButtonIcon = '<i class="bi-x-lg"></i>'; 3275 3276 selector.each( function(){ 3277 var element = jQuery(this), 3278 elType = element.attr('data-lightbox'), 3279 elCloseButton = element.attr('data-close-button') || 'outside', 3280 elDisableUnder = element.attr('data-disable-under') || 600, 3281 elFixedContent = element.attr('data-content-position') || 'auto', 3282 elZoom = element.attr('data-zoom'), 3283 $body = jQuery('body'); 3284 3285 elCloseButton = elCloseButton == 'inside' ? true : false; 3286 elFixedContent = elFixedContent == 'fixed' ? true : false; 3287 3288 if( elType == 'image' ) { 3289 var settings = { 3290 type: 'image', 3291 tLoading: '', 3292 closeOnContentClick: true, 3293 closeBtnInside: elCloseButton, 3294 fixedContentPos: true, 3295 mainClass: 'mfp-no-margins mfp-fade', 3296 image: { 3297 verticalFit: true 3298 }, 3299 closeIcon: closeButtonIcon, 3300 }; 3301 3302 if( elZoom == 'true' ) { 3303 settings.zoom = { 3304 enabled: true, 3305 duration: 300, 3306 easing: 'ease-in-out', 3307 opener: function(openerElement) { 3308 return openerElement.is('img') ? openerElement : openerElement.find('img'); 3309 } 3310 }; 3311 } 3312 3313 element.magnificPopup(settings); 3314 } 3315 3316 if( elType == 'gallery' ) { 3317 if( element.find('a[data-lightbox="gallery-item"]').parent('.clone').hasClass('clone') ) { 3318 element.find('a[data-lightbox="gallery-item"]').parent('.clone').find('a[data-lightbox="gallery-item"]').attr('data-lightbox',''); 3319 } 3320 3321 if( element.find('a[data-lightbox="gallery-item"]').parents('.cloned').hasClass('cloned') ) { 3322 element.find('a[data-lightbox="gallery-item"]').parents('.cloned').find('a[data-lightbox="gallery-item"]').attr('data-lightbox',''); 3323 } 3324 3325 element.magnificPopup({ 3326 delegate: element.hasClass('grid-container-filterable') ? 'a.grid-lightbox-filtered[data-lightbox="gallery-item"]' : 'a[data-lightbox="gallery-item"]', 3327 type: 'image', 3328 tLoading: '', 3329 closeOnContentClick: true, 3330 closeBtnInside: elCloseButton, 3331 fixedContentPos: true, 3332 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 3333 image: { 3334 verticalFit: true 3335 }, 3336 gallery: { 3337 enabled: true, 3338 navigateByImgClick: true, 3339 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 3340 }, 3341 closeIcon: closeButtonIcon, 3342 }); 3343 } 3344 3345 if( elType == 'iframe' ) { 3346 element.magnificPopup({ 3347 disableOn: Number( elDisableUnder ), 3348 type: 'iframe', 3349 tLoading: '', 3350 removalDelay: 160, 3351 preloader: false, 3352 closeBtnInside: elCloseButton, 3353 fixedContentPos: elFixedContent, 3354 closeIcon: closeButtonIcon, 3355 }); 3356 } 3357 3358 if( elType == 'inline' ) { 3359 element.magnificPopup({ 3360 type: 'inline', 3361 tLoading: '', 3362 mainClass: 'mfp-no-margins mfp-fade', 3363 closeBtnInside: elCloseButton, 3364 fixedContentPos: true, 3365 overflowY: 'scroll', 3366 closeIcon: closeButtonIcon, 3367 }); 3368 } 3369 3370 if( elType == 'ajax' ) { 3371 element.magnificPopup({ 3372 type: 'ajax', 3373 tLoading: '', 3374 closeBtnInside: elCloseButton, 3375 autoFocusLast: false, 3376 closeIcon: closeButtonIcon, 3377 callbacks: { 3378 ajaxContentAdded: function(mfpResponse) { 3379 __core.runContainerModules( document.querySelector('.mfp-content') ); 3380 }, 3381 open: function() { 3382 $body.addClass('ohidden'); 3383 }, 3384 close: function() { 3385 $body.removeClass('ohidden'); 3386 } 3387 } 3388 }); 3389 } 3390 3391 if( elType == 'ajax-gallery' ) { 3392 element.magnificPopup({ 3393 delegate: 'a[data-lightbox="ajax-gallery-item"]', 3394 type: 'ajax', 3395 tLoading: '', 3396 closeBtnInside: elCloseButton, 3397 closeIcon: closeButtonIcon, 3398 autoFocusLast: false, 3399 gallery: { 3400 enabled: true, 3401 preload: 0, 3402 navigateByImgClick: false 3403 }, 3404 callbacks: { 3405 ajaxContentAdded: function(mfpResponse) { 3406 __core.runContainerModules( document.querySelector('.mfp-content') ); 3407 }, 3408 open: function() { 3409 $body.addClass('ohidden'); 3410 }, 3411 close: function() { 3412 $body.removeClass('ohidden'); 3413 } 3414 } 3415 }); 3416 } 3417 3418 element.on( 'mfpOpen', function(){ 3419 var lightboxItem = jQuery.magnificPopup.instance.currItem.el, 3420 lightboxClass = jQuery( lightboxItem ).attr('data-lightbox-class'),
3421 lightboxBgClass = jQuery( lightboxItem ).attr('data-lightbox-bg-class'); 3422 3423 if( lightboxClass != '' ) { 3424 jQuery(jQuery.magnificPopup.instance.container).addClass( lightboxClass ); 3425 } 3426 3427 if( lightboxBgClass != '' ) { 3428 jQuery(jQuery.magnificPopup.instance.bgOverlay).addClass( lightboxBgClass ); 3429 } 3430 }); 3431 }); 3432 }); 3433 } 3434 }; 3435 }(), 3436 // Lightbox Functions End 3437 3438 /** 3439 * -------------------------------------------------------------------------- 3440 * Modal Functions Start 3441 * -------------------------------------------------------------------------- 3442 */ 3443 Modal: function() { 3444 return { 3445 init: function(selector) { 3446 if( __core.getSelector(selector, false, false).length < 1 ){ 3447 return true; 3448 } 3449 3450 __core.isFuncTrue( function() { 3451 return typeof jQuery !== 'undefined' && jQuery().magnificPopup; 3452 }).then( function(cond) { 3453 if( !cond ) { 3454 return false; 3455 } 3456 3457 __core.initFunction({ class: 'has-plugin-modal', event: 'pluginModalReady' }); 3458 3459 selector = __core.getSelector( selector ); 3460 if( selector.length < 1 ){ 3461 return true; 3462 } 3463 3464 var closeButtonIcon = '<i class="bi-x-lg"></i>'; 3465 3466 selector.each( function(){ 3467 var element = jQuery(this), 3468 elTarget = element.attr('data-target'), 3469 elTargetValue = '__cnvs_' + elTarget.split('#')[1], 3470 elDelay = element.attr('data-delay') || 500, 3471 elTimeout = element.attr('data-timeout'), 3472 elAnimateIn = element.attr('data-animate-in'), 3473 elAnimateOut = element.attr('data-animate-out'), 3474 elBgClick = element.attr('data-bg-click'), 3475 elCloseBtn = element.attr('data-close-btn'), 3476 elCookies = element.attr('data-cookies'), 3477 elCookiePath = element.attr('data-cookie-path'), 3478 elCookieExp = element.attr('data-cookie-expire'); 3479 3480 if( elCookies == "false" ) { 3481 __core.cookie.remove( elTargetValue ); 3482 } 3483 3484 if( elCookies == 'true' ) { 3485 var elementCookie = __core.cookie.get( elTargetValue ); 3486 3487 if( typeof elementCookie !== 'undefined' && elementCookie == '0' ) { 3488 return true; 3489 } 3490 } 3491 3492 if( elBgClick == 'false' ) { 3493 elBgClick = false; 3494 } else { 3495 elBgClick = true; 3496 } 3497 3498 if( elCloseBtn == 'false' ) { 3499 elCloseBtn = false; 3500 } else { 3501 elCloseBtn = true; 3502 } 3503 3504 elDelay = Number(elDelay) + 500; 3505 3506 setTimeout(function() { 3507 jQuery.magnificPopup.open({ 3508 items: { src: elTarget }, 3509 type: 'inline', 3510 mainClass: 'mfp-no-margins mfp-fade', 3511 closeBtnInside: false, 3512 fixedContentPos: true, 3513 closeOnBgClick: elBgClick, 3514 showCloseBtn: elCloseBtn, 3515 removalDelay: 500, 3516 closeIcon: closeButtonIcon, 3517 callbacks: { 3518 open: function(){ 3519 if( elAnimateIn != '' ) { 3520 jQuery(elTarget).addClass( elAnimateIn + ' animated' ); 3521 } 3522 }, 3523 beforeClose: function(){ 3524 if( elAnimateOut != '' ) { 3525 jQuery(elTarget).removeClass( elAnimateIn ).addClass( elAnimateOut ); 3526 } 3527 }, 3528 afterClose: function() { 3529 if( elAnimateIn != '' || elAnimateOut != '' ) { 3530 jQuery(elTarget).removeClass( elAnimateIn + ' ' + elAnimateOut + ' animated' ); 3531 } 3532 } 3533 } 3534 }, 0); 3535 }, elDelay ); 3536 3537 if( document.querySelector('.modal-cookies-close') ) { 3538 document.querySelector('.modal-cookies-close').onclick = function() { 3539 jQuery.magnificPopup.close(); 3540 3541 if( elCookies == 'true' ) { 3542 var cookieOps = {}; 3543 3544 if( elCookieExp ) { 3545 cookieOps.expires = Number( elCookieExp ); 3546 } 3547 3548 if( elCookiePath ) { 3549 cookieOps.path = elCookiePath; 3550 } 3551 3552 __core.cookie.set( elTargetValue, '0', cookieOps ); 3553 } 3554 } 3555 } 3556 3557 if( elTimeout != '' ) { 3558 setTimeout(function() { 3559 jQuery.magnificPopup.close(); 3560 }, elDelay + Number(elTimeout) ); 3561 } 3562 }); 3563 }); 3564 } 3565 }; 3566 }(), 3567 // Modal Functions End 3568 3569 /** 3570 * -------------------------------------------------------------------------- 3571 * Animations Functions Start 3572 * -------------------------------------------------------------------------- 3573 */ 3574 Animations: function() { 3575 return { 3576 init: function(selector) { 3577 if( __core.getSelector(selector, false, false).length < 1 ){ 3578 return true; 3579 } 3580 3581 __core.initFunction({ class: 'has-plugin-animations', event: 'pluginAnimationsReady' }); 3582 3583 selector = __core.getSelector( selector, false ); 3584 if( selector.length < 1 ){ 3585 return true; 3586 } 3587 3588 var SELECTOR = '[data-animate]', 3589 ANIMATE_CLASS_NAME = 'animated'; 3590 3591 var isAnimated = function(element) { 3592 element.classList.contains(ANIMATE_CLASS_NAME); 3593 }; 3594 3595 var intersectionObserver = new IntersectionObserver( 3596 function(entries, observer) {
3597 entries.forEach( function(entry) { 3598 var element = entry.target, 3599 elAnimation = element.getAttribute('data-animate'), 3600 elAnimOut = element.getAttribute('data-animate-out'), 3601 elAnimDelay = element.getAttribute('data-delay'), 3602 elAnimDelayOut = element.getAttribute('data-delay-out'), 3603 elAnimDelayTime = 0, 3604 elAnimDelayOutTime = 3000, 3605 elAnimations = elAnimation.split(' '); 3606 3607 if( element.closest('.fslider.no-thumbs-animate') ) { 3608 return true; 3609 } 3610 3611 if( element.closest('.swiper-slide') ) { 3612 return true; 3613 } 3614 3615 if( elAnimDelay ) { 3616 elAnimDelayTime = Number( elAnimDelay ) + 500; 3617 } else { 3618 elAnimDelayTime = 500; 3619 } 3620 3621 if( elAnimOut && elAnimDelayOut ) { 3622 elAnimDelayOutTime = Number( elAnimDelayOut ) + elAnimDelayTime; 3623 } 3624 3625 if( !element.classList.contains('animated') ) { 3626 element.classList.add('not-animated'); 3627 if( entry.intersectionRatio > 0 ) { 3628 setTimeout( function() { 3629 element.classList.remove('not-animated'); 3630 elAnimations.forEach( function(item) { 3631 element.classList.add(item); 3632 }); 3633 element.classList.add('animated'); 3634 }, elAnimDelayTime); 3635 3636 if( elAnimOut ) { 3637 setTimeout( function() { 3638 elAnimations.forEach( function(item) { 3639 element.classList.remove(item); 3640 }); 3641 3642 elAnimOut.split(' ').forEach( function(item) { 3643 element.classList.add(item); 3644 }); 3645 }, elAnimDelayOutTime); 3646 } 3647 } 3648 } 3649 3650 if( !element.classList.contains('not-animated') ) { 3651 observer.unobserve(element); 3652 } 3653 }); 3654 } 3655 ); 3656 3657 var elements = [].filter.call(document.querySelectorAll(SELECTOR), function(element) { 3658 return !isAnimated(element, ANIMATE_CLASS_NAME); 3659 }); 3660 3661 elements.forEach( function(element) { 3662 return intersectionObserver.observe(element); 3663 }); 3664 } 3665 }; 3666 }(), 3667 // Animations Functions End 3668 3669 /** 3670 * -------------------------------------------------------------------------- 3671 * HoverAnimations Functions Start 3672 * -------------------------------------------------------------------------- 3673 */ 3674 HoverAnimations: function() { 3675 var _t, _x; 3676 3677 var _showOverlay = function(params) { 3678 clearTimeout(_x); 3679 3680 _t = setTimeout( function() { 3681 params.element.classList.add( 'not-animated' ); 3682 3683 (params.elAnimateOut + ' not-animated').split(" ").forEach( function(_class) { 3684 params.element.classList.remove(_class); 3685 }); 3686 3687 (params.elAnimate + ' animated').split(" ").forEach( function(_class) { 3688 params.element.classList.add(_class); 3689 }); 3690 }, params.elDelayT ); 3691 }; 3692 3693 var _hideOverlay = function(params) { 3694 params.element.classList.add( 'not-animated' ); 3695 3696 (params.elAnimate + ' not-animated').split(" ").forEach( function(_class) { 3697 params.element.classList.remove(_class); 3698 }); 3699 3700 (params.elAnimateOut + ' animated').split(" ").forEach( function(_class) { 3701 params.element.classList.add(_class); 3702 }); 3703 3704 if( params.elReset == 'true' ) { 3705 _x = setTimeout( function() { 3706 (params.elAnimateOut + ' animated').split(" ").forEach( function(_class) { 3707 params.element.classList.remove(_class); 3708 }); 3709 3710 params.element.classList.add( 'not-animated' ); 3711 }, Number( params.elSpeed ) ); 3712 } 3713 3714 clearTimeout(_t); 3715 }; 3716 3717 var _isInsideElement = function(touch){ 3718 var rect = element.getBoundingClientRect(); 3719 3720 return ( 3721 touch.clientX >= rect.left && 3722 touch.clientX <= rect.right && 3723 touch.clientY >= rect.top && 3724 touch.clientY <= rect.bottom 3725 ); 3726 }; 3727 3728 return { 3729 init: function(selector) { 3730 if( __core.getSelector(selector, false, false).length < 1 ){ 3731 return true; 3732 } 3733 3734 __core.initFunction({ class: 'has-plugin-hoveranimation', event: 'pluginHoverAnimationReady' }); 3735 3736 selector = __core.getSelector( selector, false ); 3737 if( selector.length < 1 ){ 3738 return true; 3739 } 3740 3741 selector.forEach( function(element) { 3742 var elAnimate = element.getAttribute( 'data-hover-animate' ), 3743 elAnimateOut = element.getAttribute( 'data-hover-animate-out' ) || 'fadeOut', 3744 elSpeed = element.getAttribute( 'data-hover-speed' ) || 600, 3745 elDelay = element.getAttribute( 'data-hover-delay' ), 3746 elParent = element.getAttribute( 'data-hover-parent' ), 3747 elReset = element.getAttribute( 'data-hover-reset' ) || 'false', 3748 elMobile = element.getAttribute( 'data-hover-mobile' ) || 'true'; 3749 3750 if( elMobile != 'true' ) { 3751 if( elMobile == 'false' ) { 3752 if( !__core.getVars.elBody.classList.contains('device-up-lg') ) { 3753 return true; 3754 } 3755 } else { 3756 if( !__core.getVars.elBody.classList.contains('device-up-' + elMobile) ) { 3757 return true; 3758 } 3759 } 3760 } 3761 3762 element.classList.add( 'not-animated' ); 3763 3764 if( !elParent ) { 3765 if( element.closest( '.bg-overlay' ) ) { 3766 elParent = element.closest( '.bg-overlay' ); 3767 } else { 3768 elParent = element; 3769 } 3770 } else { 3771 if( elParent == 'self' ) { 3772 elParent = element; 3773 } else { 3774 elParent = element.closest( elParent ); 3775 } 3776 } 3777 3778 var elDelayT = 0; 3779 3780 if( elDelay ) { 3781 elDelayT = Number( elDelay ); 3782 } 3783 3784 if( elSpeed ) { 3785 element.style.animationDuration = Number( elSpeed ) + 'ms'; 3786 } 3787 3788 var params = { 3789 element: element, 3790 elAnimate: elAnimate, 3791 elAnimateOut: elAnimateOut, 3792 elSpeed: elSpeed, 3793 elDelayT: elDelayT, 3794 elParent: elParent, 3795 elReset: elReset, 3796 } 3797 3798 elParent.addEventListener( 'mouseenter', function(){ 3799 _showOverlay(params); 3800 }, false); 3801 3802 elParent.addEventListener( 'mouseleave', function(){ 3803 _hideOverlay(params); 3804 }, false); 3805 3806 // elParent.addEventListener( 'touchstart', function(e){ 3807 // e.preventDefault(); 3808 3809 // _showOverlay(params); 3810 3811 // elParent.addEventListener('touchmove', function(e){ 3812 // if (!_isInsideElement(e.touches[0])) { 3813 // _hideOverlay(params); 3814 // elParent.removeEventListener('touchmove'); 3815 // } 3816 // }); 3817 3818 // elParent.addEventListener('touchend', function(){ 3819 // _hideOverlay(params); 3820 // elParent.removeEventListener('touchmove'); 3821 // elParent.removeEventListener('touchend'); 3822 // }); 3823 // }); 3824 }); 3825 } 3826 }; 3827 }(), 3828 // HoverAnimations Functions End 3829 3830 /** 3831 * -------------------------------------------------------------------------- 3832 * Grid Functions Start 3833 * -------------------------------------------------------------------------- 3834 */ 3835 Grid: function() { 3836 var _reLayout = function(el) { 3837 el.filter('.has-init-isotope').isotope('layout'); 3838 }; 3839 3840 return { 3841 init: function(selector) { 3842 if( __core.getSelector(selector, false, false).length < 1 ){ 3843 return true; 3844 } 3845 3846 __core.isFuncTrue( function() { 3847 return typeof jQuery !== 'undefined' && typeof Isotope !== 'undefined'; 3848 }).then( function(cond) { 3849 if( !cond ) { 3850 return false;
3851 } 3852 3853 __core.initFunction({ class: 'has-plugin-isotope', event: 'pluginIsotopeReady' }); 3854 3855 selector = __core.getSelector( selector ); 3856 if( selector.length < 1 ){ 3857 return true; 3858 } 3859 3860 selector.each( function() { 3861 var element = jQuery(this), 3862 elTransition = element.attr('data-transition') || '0.65s', 3863 elLayoutMode = element.attr('data-layout') || 'masonry', 3864 elStagger = element.attr('data-stagger') || 0, 3865 elBase = element.attr('data-basewidth') || '.portfolio-item:not(.wide):eq(0)', 3866 elOriginLeft = true, 3867 elGrid; 3868 3869 _reLayout(element); 3870 3871 if( __core.getVars.isRTL ) { 3872 elOriginLeft = false; 3873 } 3874 3875 if( element.hasClass('portfolio') || element.hasClass('post-timeline') ){ 3876 elGrid = element.filter(':not(.has-init-isotope)').isotope({ 3877 layoutMode: elLayoutMode, 3878 isOriginLeft: elOriginLeft, 3879 transitionDuration: elTransition, 3880 stagger: Number( elStagger ), 3881 percentPosition: true, 3882 masonry: { 3883 columnWidth: element.find( elBase )[0] 3884 } 3885 }); 3886 } else { 3887 elGrid = element.filter(':not(.has-init-isotope)').isotope({ 3888 layoutMode: elLayoutMode, 3889 isOriginLeft: elOriginLeft, 3890 transitionDuration: elTransition, 3891 stagger: Number( elStagger ), 3892 percentPosition: true, 3893 }); 3894 } 3895 3896 if( element.data('isotope') ) { 3897 element.addClass('has-init-isotope'); 3898 } 3899 3900 var int = setInterval( function() { 3901 if( element.find('.lazy.lazy-loaded').length == element.find('.lazy').length ) { 3902 setTimeout( function() { 3903 _reLayout(element); 3904 }, 666); 3905 3906 clearInterval(int); 3907 } 3908 }, 1000); 3909 3910 window.addEventListener( 'lazyLoadLoaded', function() { 3911 _reLayout(element); 3912 }); 3913 3914 window.addEventListener( 'load', function() { 3915 _reLayout(element); 3916 }); 3917 3918 __core.getVars.resizers.isotope = function() { 3919 _reLayout(element); 3920 }; 3921 }); 3922 }); 3923 } 3924 }; 3925 }(), 3926 // Grid Functions End 3927 3928 /** 3929 * -------------------------------------------------------------------------- 3930 * Filter Functions Start 3931 * -------------------------------------------------------------------------- 3932 */ 3933 Filter: function() { 3934 return { 3935 init: function(selector) { 3936 if( __core.getSelector(selector, false, false).length < 1 ){ 3937 return true; 3938 } 3939 3940 __core.isFuncTrue( function() { 3941 return typeof jQuery !== 'undefined' && typeof Isotope !== 'undefined'; 3942 }).then( function(cond) { 3943 if( !cond ) { 3944 return false; 3945 } 3946 3947 __core.initFunction({ class: 'has-plugin-isotope-filter', event: 'pluginGridFilterReady' }); 3948 3949 selector = __core.getSelector( selector ); 3950 if( selector.length < 1 ){ 3951 return true; 3952 } 3953 3954 selector.each( function() { 3955 var element = jQuery(this), 3956 elCon = element.attr('data-container'), 3957 elActClass = element.attr('data-active-class'), 3958 elDefFilter = element.attr('data-default'); 3959 3960 if( !elActClass ) { 3961 elActClass = 'activeFilter'; 3962 } 3963 3964 if( !jQuery(elCon).hasClass('grid-container') ) { 3965 return false; 3966 } 3967 3968 element.find('a').off( 'click' ).on( 'click', function(){ 3969 element.find('li').removeClass( elActClass ); 3970 jQuery(this).parent('li').addClass( elActClass ); 3971 var selector = jQuery(this).attr('data-filter'); 3972 jQuery(elCon).isotope({ filter: selector }); 3973 return false; 3974 }); 3975 3976 if( elDefFilter ) { 3977 element.find('li').removeClass( elActClass ); 3978 element.find('[data-filter="'+ elDefFilter +'"]').parent('li').addClass( elActClass ); 3979 jQuery(elCon).isotope({ filter: elDefFilter }); 3980 } 3981 3982 jQuery(elCon).on( 'arrangeComplete layoutComplete', function(event, filteredItems) { 3983 jQuery(elCon).addClass('grid-container-filterable'); 3984 if( jQuery(elCon).attr('data-lightbox') == 'gallery' ) { 3985 jQuery(elCon).find("[data-lightbox]").removeClass('grid-lightbox-filtered');
3986 filteredItems.forEach( function(item) { 3987 jQuery(item.element).find("[data-lightbox]").addClass('grid-lightbox-filtered'); 3988 }); 3989 } 3990 __modules.lightbox(); 3991 }); 3992 }); 3993 3994 jQuery('.grid-shuffle').off( 'click' ).on( 'click', function(){ 3995 var element = jQuery(this), 3996 elCon = element.attr('data-container'); 3997 3998 if( !jQuery(elCon).hasClass('grid-container') ) { 3999 return false; 4000 } 4001 4002 jQuery(elCon).isotope('shuffle'); 4003 }); 4004 }); 4005 } 4006 }; 4007 }(), 4008 // Filter Functions End 4009 4010 /** 4011 * -------------------------------------------------------------------------- 4012 * CanvasSlider Functions Start 4013 * -------------------------------------------------------------------------- 4014 */ 4015 CanvasSlider: function() { 4016 return { 4017 init: function(selector) { 4018 if( __core.getSelector(selector, false, false).length < 1 ){ 4019 return true; 4020 } 4021 4022 __core.isFuncTrue( function() { 4023 return typeof Swiper !== "undefined"; 4024 }).then( function(cond) { 4025 if( !cond ) { 4026 return false; 4027 } 4028 4029 __core.initFunction({ class: 'has-plugin-swiper', event: 'pluginSwiperReady' }); 4030 4031 selector = __core.getSelector( selector, false ); 4032 if( selector.length < 1 ){ 4033 return true; 4034 } 4035 4036 selector.forEach( function(element) { 4037 if( !element.classList.contains('swiper_wrapper') ) { 4038 return true; 4039 } 4040 4041 if( element.querySelectorAll('.swiper-slide').length < 1 ) { 4042 return true; 4043 } 4044 4045 var elDirection = element.getAttribute('data-direction') || 'horizontal', 4046 elSpeed = element.getAttribute('data-speed') || 300, 4047 elAutoPlay = element.getAttribute('data-autoplay'), 4048 elAutoPlayDisableOnInteraction = element.getAttribute('data-autoplay-disable-on-interaction') || true, 4049 elPauseOnHover = element.getAttribute('data-hover'), 4050 elLoop = element.getAttribute('data-loop'), 4051 elStart = element.getAttribute('data-start') || 1, 4052 elEffect = element.getAttribute('data-effect') || 'slide', 4053 elGrabCursor = element.getAttribute('data-grab'), 4054 elParallax = element.getAttribute('data-parallax'), 4055 elAutoHeight = element.getAttribute('data-autoheight'), 4056 slideNumberTotal = element.querySelector('.slide-number-total'), 4057 slideNumberCurrent = element.querySelector('.slide-number-current'), 4058 elVideoAutoPlay = element.getAttribute('data-video-autoplay'), 4059 elSettings = element.getAttribute('data-settings'), 4060 elPagination, elPaginationClickable; 4061 4062 elAutoPlay = elAutoPlay ? Number( elAutoPlay ) : 999999999; 4063 elPauseOnHover = elPauseOnHover == 'true' ? true : false; 4064 elAutoPlayDisableOnInteraction = elAutoPlayDisableOnInteraction == 'false' ? false : true; 4065 elLoop = elLoop == 'true' ? true : false; 4066 elParallax = elParallax == 'true' ? true : false; 4067 elGrabCursor = elGrabCursor == 'false' ? false : true; 4068 elAutoHeight = elAutoHeight == 'true' ? true : false; 4069 elVideoAutoPlay = elVideoAutoPlay == 'false' ? false : true; 4070 elStart = elStart == 'random' ? Math.floor( Math.random() * element.querySelectorAll('.swiper-slide:not(.swiper-slide-duplicate)').length ) : Number( elStart ) - 1; 4071 4072 if( element.querySelector('.swiper-pagination') ) { 4073 elPagination = element.querySelector('.swiper-pagination'); 4074 elPaginationClickable = true; 4075 } else { 4076 elPagination = ''; 4077 elPaginationClickable = false; 4078 } 4079 4080 var elementNavNext = element.querySelector('.slider-arrow-right'), 4081 elementNavPrev = element.querySelector('.slider-arrow-left'), 4082 elementScollBar = element.querySelector('.swiper-scrollbar'); 4083 4084 var cnvsSwiper = new Swiper( element.querySelector('.swiper-parent'), { 4085 direction: elDirection, 4086 speed: Number( elSpeed ), 4087 autoplay: { 4088 delay: elAutoPlay, 4089 pauseOnMouseEnter: elPauseOnHover, 4090 disableOnInteraction: elAutoPlayDisableOnInteraction 4091 }, 4092 loop: elLoop, 4093 initialSlide: elStart, 4094 effect: elEffect, 4095 parallax: elParallax, 4096 slidesPerView: 1, 4097 grabCursor: elGrabCursor, 4098 autoHeight: elAutoHeight, 4099 pagination: { 4100 el: elPagination, 4101 clickable: elPaginationClickable 4102 }, 4103 navigation: { 4104 prevEl: elementNavPrev, 4105 nextEl: elementNavNext 4106 }, 4107 scrollbar: { 4108 el: elementScollBar 4109 }, 4110 on: { 4111 afterInit: function(swiper) { 4112 __base.sliderDimensions(); 4113 4114 if( element.querySelectorAll('.yt-bg-player').length > 0 ) { 4115 element.querySelectorAll('.yt-bg-player').forEach( function(el) { 4116 el.setAttribute('data-autoplay', 'false'); 4117 el.classList.remove('customjs'); 4118 }); 4119 4120 __modules.youtubeBgVideo(); 4121 4122 var activeYTVideo = jQuery('.swiper-slide-active').find('.yt-bg-player:not(.customjs)'); 4123 activeYTVideo.on('YTPReady', function() { 4124 setTimeout( function() { 4125 activeYTVideo.filter('.mb_YTPlayer').YTPPlay(); 4126 }, 1200); 4127 }); 4128 } 4129 4130 document.querySelectorAll('.swiper-slide-active [data-animate]').forEach( function(el) { 4131 var toAnimateDelay = el.getAttribute('data-delay'), 4132 toAnimateDelayTime = 0; 4133 4134 if( toAnimateDelay ) { 4135 toAnimateDelayTime = Number( toAnimateDelay ) + 750; 4136 } else { 4137 toAnimateDelayTime = 750; 4138 } 4139 4140 if( !el.classList.contains('animated') ) { 4141 el.classList.add('not-animated'); 4142 4143 var elementAnimation = el.getAttribute('data-animate'); 4144 4145 setTimeout( function() { 4146 el.classList.remove('not-animated'); 4147 4148 ( elementAnimation + ' animated').split(" ").forEach( function(_class) { 4149 el.classList.add(_class); 4150 }); 4151 }, toAnimateDelayTime); 4152 } 4153 }); 4154 4155 element.querySelectorAll('[data-animate]').forEach( function(el) { 4156 var elementAnimation = el.getAttribute('data-animate'); 4157 4158 if( el.closest('.swiper-slide') && el.closest('.swiper-slide').classList.contains('swiper-slide-active') ) { 4159 return true; 4160 } 4161 4162 ( elementAnimation + ' animated').split(" ").forEach( function(_class) { 4163 el.classList.remove(_class); 4164 }); 4165 4166 el.classList.add('not-animated'); 4167 }); 4168 4169 if( elAutoHeight ) { 4170 setTimeout( function() { 4171 swiper.updateAutoHeight(300); 4172 }, 1000); 4173 } 4174 }, 4175 transitionStart: function(swiper) { 4176 element.querySelectorAll('[data-animate]').forEach( function(el) { 4177 var elementAnimation = el.getAttribute('data-animate'); 4178 4179 if( el.closest('.swiper-slide') && el.closest('.swiper-slide').classList.contains('swiper-slide-active') ) { 4180 return true; 4181 } 4182 4183 ( elementAnimation + ' animated').split(" ").forEach( function(_class) { 4184 el.classList.remove(_class); 4185 }); 4186 4187 el.classList.add('not-animated'); 4188 }); 4189 4190 SEMICOLON.Base.sliderMenuClass(); 4191 }, 4192 transitionEnd: function(swiper) { 4193 if( slideNumberCurrent ){ 4194 if( elLoop == true ) { 4195 slideNumberCurrent.innerHTML = Number( element.querySelector('.swiper-slide.swiper-slide-active').getAttribute('data-swiper-slide-index') ) + 1; 4196 } else { 4197 slideNumberCurrent.innerHTML = swiper.activeIndex + 1; 4198 } 4199 } 4200 4201 element.querySelectorAll('.swiper-slide').forEach( function(slide) { 4202 if( slide.querySelector('video') && elVideoAutoPlay == true ) { 4203 slide.querySelector('video').pause(); 4204 } 4205 4206 if( slide.querySelector('.yt-bg-player.mb_YTPlayer:not(.customjs)') ) { 4207 jQuery(slide).find('.yt-bg-player.mb_YTPlayer:not(.customjs)').YTPPause(); 4208 } 4209 }); 4210 4211 element.querySelectorAll('.swiper-slide:not(.swiper-slide-active)').forEach( function(slide) { 4212 if( slide.querySelector('video') ) { 4213 if( slide.querySelector('video').currentTime != 0 ) { 4214 slide.querySelector('video').currentTime = 0; 4215 } 4216 } 4217 4218 var activeYTPlayer = slide.querySelector('.yt-bg-player.mb_YTPlayer:not(.customjs)'); 4219 4220 if( activeYTPlayer ) { 4221 jQuery(activeYTPlayer).YTPSeekTo( activeYTPlayer.getAttribute('data-start') ); 4222 } 4223 }); 4224 4225 if( element.querySelector('.swiper-slide.swiper-slide-active').querySelector('video') && elVideoAutoPlay == true ) { 4226 element.querySelector('.swiper-slide.swiper-slide-active').querySelector('video').play(); 4227 } 4228 4229 if( element.querySelector('.swiper-slide.swiper-slide-active').querySelector('.yt-bg-player.mb_YTPlayer:not(.customjs)') && elVideoAutoPlay == true ) { 4230 jQuery(element).find('.swiper-slide.swiper-slide-active').find('.yt-bg-player.mb_YTPlayer:not(.customjs)').YTPPlay(); 4231 } 4232 4233 element.querySelectorAll('.swiper-slide.swiper-slide-active [data-animate]').forEach( function(el) { 4234 var toAnimateDelay = el.getAttribute('data-delay'), 4235 toAnimateDelayTime = 0; 4236 4237 if( toAnimateDelay ) { 4238 toAnimateDelayTime = Number( toAnimateDelay ) + 300; 4239 } else { 4240 toAnimateDelayTime = 300; 4241 } 4242 4243 if( !el.classList.contains('animated') ) { 4244 el.classList.add('not-animated'); 4245 4246 var elementAnimation = el.getAttribute('data-animate'); 4247 4248 setTimeout( function() { 4249 el.classList.remove('not-animated'); 4250 4251 ( elementAnimation + ' animated').split(" ").forEach( function(_class) { 4252 el.classList.add(_class); 4253 }); 4254 }, toAnimateDelayTime); 4255 } 4256 }); 4257 } 4258 } 4259 }); 4260 4261 if( slideNumberCurrent ) { 4262 if( elLoop == true ) { 4263 slideNumberCurrent.innerHTML = cnvsSwiper.realIndex + 1; 4264 } else { 4265 slideNumberCurrent.innerHTML = cnvsSwiper.activeIndex + 1; 4266 } 4267 } 4268 4269 if( slideNumberTotal ) { 4270 slideNumberTotal.innerHTML = element.querySelectorAll('.swiper-slide:not(.swiper-slide-duplicate)').length; 4271 } 4272 }); 4273 }); 4274 } 4275 }; 4276 }(), 4277 // CanvasSlider Functions End 4278 4279 /** 4280 * -------------------------------------------------------------------------- 4281 * SliderParallax Functions Start 4282 * -------------------------------------------------------------------------- 4283 */ 4284 SliderParallax: function() { 4285 var _settings; 4286 var _transform; 4287 var _transform2; 4288 4289 var _parallax = function(_settings) { 4290 if( !_settings.sliderPx.el ) { 4291 return true; 4292 } 4293 4294 fastdom.measure( function(){ 4295 _settings.scrollPos.y = window.scrollY; 4296 4297 if( _settings.body.classList.contains('is-expanded-menu') && !_settings.isMobile ) { 4298 if( ( _settings.height + _settings.sliderPx.offset + 50 ) > _settings.scrollPos.y ){ 4299 _settings.classes.add('slider-parallax-visible'); 4300 _settings.classes.remove('slider-parallax-invisible'); 4301 if ( _settings.scrollPos.y > _settings.sliderPx.offset ) { 4302 if( typeof _settings.sliderPx.el.querySelector('.slider-inner') === 'object' ) { 4303 _transform = ((_settings.scrollPos.y-_settings.sliderPx.offset) * -.4); 4304 _transform2 = ((_settings.scrollPos.y-_settings.sliderPx.offset) * -.15); 4305 4306 _setParallax(0, _transform, _settings.sliderPx.inner); 4307 _setParallax(0, _transform2, _settings.sliderPx.caption); 4308 } else { 4309 _transform = ((_settings.scrollPos.y-_settings.sliderPx.offset) / 1.5); 4310 _transform2 = ((_settings.scrollPos.y-_settings.sliderPx.offset) / 7); 4311 4312 _setParallax(0, _transform, _settings.sliderPx.el); 4313 _setParallax(0, _transform2, _settings.sliderPx.caption); 4314 } 4315 } else { 4316 if( _settings.sliderPx.el.querySelector('.slider-inner') ) { 4317 _setParallax(0, 0, _settings.sliderPx.inner); 4318 _setParallax(0, 0, _settings.sliderPx.caption); 4319 } else { 4320 _setParallax(0, 0, _settings.sliderPx.el); 4321 _setParallax(0, 0, _settings.sliderPx.caption); 4322 } 4323 } 4324 } else { 4325 _settings.classes.add('slider-parallax-invisible'); 4326 _settings.classes.remove('slider-parallax-visible'); 4327 } 4328 } else { 4329 if( _settings.sliderPx.el.querySelector('.slider-inner') ) { 4330 _setParallax(0, 0, _settings.sliderPx.inner); 4331 _setParallax(0, 0, _settings.sliderPx.caption); 4332 } else { 4333 _setParallax(0, 0, _settings.sliderPx.el); 4334 _setParallax(0, 0, _settings.sliderPx.caption); 4335 } 4336 4337 _settings.classes.add('slider-parallax-visible'); 4338 _settings.classes.remove('slider-parallax-invisible'); 4339 } 4340 }); 4341 }; 4342 4343 var _offset = function() { 4344 var sliderPx = __core.getVars.sliderParallax; 4345 4346 var sliderParallaxOffsetTop = 0, 4347 headerHeight = __core.getVars.elHeader?.offsetHeight || 0; 4348 4349 if( __core.getVars.elBody.classList.contains('side-header') || (__core.getVars.elHeader && __core.getNext(__core.getVars.elHeader, '.include-header').length > 0) ) { 4350 headerHeight = 0; 4351 } 4352 4353 // if( $pageTitle.length > 0 ) { 4354 // sliderParallaxOffsetTop = $pageTitle.outerHeight() + headerHeight - 20; 4355 // } else { 4356 // sliderParallaxOffsetTop = headerHeight - 20; 4357 // } 4358 4359 if( __core.getNext(__core.getVars.elSlider, '#header').length > 0 ) { 4360 sliderParallaxOffsetTop = 0; 4361 } 4362 4363 sliderPx.offset = sliderParallaxOffsetTop; 4364 }; 4365 4366 var _setParallax = function(xPos, yPos, el) { 4367 if( el ) { 4368 fastdom.mutate( function(){ 4369 el.style.transform = "translate3d(" + xPos + ", " + yPos + "px, 0)"; 4370 }); 4371 } 4372 }; 4373 4374 var _elementFade = function(_settings) { 4375 if( _settings.sliderPx.el.length < 1 ) { 4376 return true; 4377 } 4378 4379 fastdom.mutate( function(){ 4380 if( _settings.body.classList.contains('is-expanded-menu') && !_settings.isMobile ) { 4381 var tHeaderOffset; 4382 4383 if( (_settings.header && _settings.header.classList.contains('transparent-header')) || _settings.body.classList.contains('side-header') ) { 4384 tHeaderOffset = 100; 4385 } else { 4386 tHeaderOffset = 0; 4387 } 4388 4389 if( _settings.sliderPx.el.classList.contains('slider-parallax-visible') ) { 4390 _settings.sliderPx.el.querySelectorAll('.slider-arrow-left,.slider-arrow-right,.slider-caption,.slider-element-fade').forEach( function(el) { 4391 el.style.opacity = 1 - ( ( ( _settings.scrollPos.y - tHeaderOffset ) * 1.85 ) / _settings.height ); 4392 }); 4393 } 4394 } else { 4395 _settings.sliderPx.el.querySelectorAll('.slider-arrow-left,.slider-arrow-right,.slider-caption,.slider-element-fade').forEach( function(el) { 4396 el.style.opacity = 1; 4397 }); 4398 } 4399 }); 4400 }; 4401 4402 return { 4403 init: function(selector) { 4404 if( __core.getSelector(selector, false, false).length < 1 ){ 4405 return true; 4406 } 4407 4408 __core.isFuncTrue( function() { 4409 return typeof fastdom !== 'undefined'; 4410 }).then( function(cond) { 4411 if( !cond ) { 4412 return false;
4413 } 4414 4415 _settings = { 4416 sliderPx: __core.getVars.sliderParallax, 4417 body: __core.getVars.elBody, 4418 header: __core.getVars.elHeader, 4419 scrollPos: __core.getVars.scrollPos, 4420 isMobile: __mobile.any(), 4421 get height() { 4422 return this.sliderPx.el.offsetHeight; 4423 }, 4424 get classes() { 4425 return this.sliderPx.el.classList; 4426 }, 4427 }; 4428 4429 if( _settings.sliderPx.el.querySelector('.slider-inner') ) { 4430 _setParallax(0, 0, _settings.sliderPx.inner); 4431 _setParallax(0, 0, _settings.sliderPx.caption); 4432 } else { 4433 _setParallax(0, 0, _settings.sliderPx.el); 4434 _setParallax(0, 0, _settings.sliderPx.caption); 4435 } 4436 4437 window.addEventListener('scroll', function(){ 4438 _parallax(_settings); 4439 _elementFade(_settings); 4440 }, {passive:true}); 4441 4442 __core.getVars.resizers.sliderparallax = function() { 4443 _parallax(_settings); 4444 _elementFade(_settings); 4445 }; 4446 }); 4447 } 4448 }; 4449 }(), 4450 // SliderParallax Functions End 4451 4452 /** 4453 * -------------------------------------------------------------------------- 4454 * FlexSlider Functions Start 4455 * -------------------------------------------------------------------------- 4456 */ 4457 FlexSlider: function() { 4458 return { 4459 init: function(selector) { 4460 if( __core.getSelector(selector, false, false).length < 1 ){ 4461 return true; 4462 } 4463 4464 __core.isFuncTrue( function() { 4465 return typeof jQuery !== 'undefined' && jQuery().flexslider; 4466 }).then( function(cond) { 4467 if( !cond ) { 4468 return false; 4469 } 4470 4471 __core.initFunction({ class: 'has-plugin-flexslider', event: 'pluginFlexSliderReady' }); 4472 4473 selector = __core.getSelector( selector ); 4474 if( selector.length < 1 ){ 4475 return true; 4476 } 4477 4478 selector.each(function() { 4479 var element = jQuery(this), 4480 elLazy = element.find('.lazy'), 4481 elAnimation = element.attr('data-animation') || 'slide', 4482 elEasing = element.attr('data-easing') || 'swing', 4483 elDirection = element.attr('data-direction') || 'horizontal', 4484 elReverse = element.attr('data-reverse'), 4485 elSlideshow = element.attr('data-slideshow'), 4486 elPause = element.attr('data-pause') || 5000, 4487 elSpeed = element.attr('data-speed') || 600, 4488 elVideo = element.attr('data-video'), 4489 elPagi = element.attr('data-pagi'), 4490 elArrows = element.attr('data-arrows'), 4491 elArrowLeft = element.attr('data-arrow-left') || 'uil uil-angle-left-b', 4492 elArrowRight = element.attr('data-arrow-right') || 'uil uil-angle-right-b', 4493 elThumbs = element.attr('data-thumbs'), 4494 elHover = element.attr('data-hover'), 4495 elSheight = element.attr('data-smooth-height'), 4496 elTouch = element.attr('data-touch'), 4497 elUseCSS = false; 4498 4499 if( elEasing == 'swing' ) { 4500 elEasing = 'swing'; 4501 elUseCSS = true; 4502 } 4503 if( elReverse == 'true' ) { elReverse = true; } else { elReverse = false; } 4504 if( elSlideshow == "false" ) { elSlideshow = false; } else { elSlideshow = true; } 4505 if( !elVideo ) { elVideo = false; } 4506 if( elSheight == 'false' ) { elSheight = false; } else { elSheight = true; } 4507 if( elDirection == 'vertical' ) { elSheight = false; } 4508 if( elPagi == 'false' ) { elPagi = false; } else { elPagi = true; } 4509 if( elThumbs == 'true' ) { elPagi = 'thumbnails'; } else { elPagi = elPagi; } 4510 if( elArrows == 'false' ) { elArrows = false; } else { elArrows = true; } 4511 if( elHover == 'false' ) { elHover = false; } else { elHover = true; } 4512 if( elTouch == 'false' ) { elTouch = false; } else { elTouch = true; } 4513 4514 element.find('.flexslider').flexslider({ 4515 selector: ".slider-wrap > .slide", 4516 animation: elAnimation, 4517 easing: elEasing, 4518 direction: elDirection,
4519 reverse: elReverse, 4520 slideshow: elSlideshow, 4521 slideshowSpeed: Number(elPause), 4522 animationSpeed: Number(elSpeed), 4523 pauseOnHover: elHover, 4524 video: elVideo, 4525 controlNav: elPagi, 4526 directionNav: elArrows, 4527 smoothHeight: elSheight, 4528 useCSS: elUseCSS, 4529 touch: elTouch, 4530 start: function( slider ){ 4531 __modules.animations(); 4532 __modules.lightbox(); 4533 4534 jQuery('.flex-prev').html('<i class="'+ elArrowLeft +'"></i>'); 4535 jQuery('.flex-next').html('<i class="'+ elArrowRight +'"></i>'); 4536 setTimeout( function(){ 4537 if( slider.parents( '.grid-container.has-init-isotope' ).length > 0 ) { 4538 slider.parents( '.grid-container.has-init-isotope' ).isotope('layout'); 4539 } 4540 }, 1200 ); 4541 4542 if( typeof skrollrInstance !== "undefined" ) { 4543 skrollrInstance.refresh(); 4544 } 4545 }, 4546 after: function( slider ){ 4547 if( slider.parents( '.grid-container.has-init-isotope' ).length > 0 && !slider.hasClass('flexslider-grid-relayout') ) { 4548 slider.parents( '.grid-container.has-init-isotope' ).isotope('layout'); 4549 slider.addClass('flexslider-grid-relayout'); 4550 } 4551 4552 jQuery('.menu-item:visible').find('.flexslider .slide').resize(); 4553 } 4554 }); 4555 4556 // jQuery(window).on( 'lazyLoadLoaded', function(){ 4557 // if( elLazy.length == element.find('.lazy.lazy-loaded').length ) { 4558 // lazyLoadInstance.update(); 4559 // setTimeout( function() { 4560 // element.find('.flexslider .slide').resize(); 4561 // }, 500 ); 4562 // } 4563 // }); 4564 }); 4565 }); 4566 } 4567 }; 4568 }(), 4569 // FlexSlider Functions End 4570 4571 /** 4572 * -------------------------------------------------------------------------- 4573 * FullVideo Functions Start 4574 * -------------------------------------------------------------------------- 4575 */ 4576 FullVideo: function() { 4577 return { 4578 init: function(selector) { 4579 if( __core.getSelector(selector, false, false).length < 1 ){ 4580 return true; 4581 } 4582 4583 __core.initFunction({ class: 'has-plugin-html5video', event: 'pluginHtml5VideoReady' }); 4584 4585 selector = __core.getSelector( selector, false, false ); 4586 if( selector.length < 1 ){ 4587 return true; 4588 } 4589 4590 selector.forEach( function(element) { 4591 var elVideo = element.querySelector('video'), 4592 elRatio = element.getAttribute('data-ratio') || '16/9'; 4593 4594 if( !elVideo ) { 4595 return true; 4596 } 4597 4598 elRatio = elRatio.split('/'); 4599 4600 elVideo.style.left = ''; 4601 elVideo.style.top = ''; 4602 4603 var divWidth = element.offsetWidth, 4604 divHeight = element.offsetHeight, 4605 elWidth = ( Number(elRatio[0])*divHeight)/Number(elRatio[1]), 4606 elHeight = divHeight; 4607 4608 if( elWidth < divWidth ) { 4609 elWidth = divWidth; 4610 elHeight = (Number(elRatio[1])*divWidth)/Number(elRatio[0]); 4611 } 4612 4613 elVideo.style.width = elWidth + 'px'; 4614 elVideo.style.height = elHeight + 'px'; 4615 4616 if( elHeight > divHeight ) { 4617 elVideo.style.left = ''; 4618 elVideo.style.top = -( ( elHeight - divHeight )/2 ) + 'px'; 4619 } 4620 4621 if( elWidth > divWidth ) { 4622 elVideo.style.left = -( ( elWidth - divWidth )/2 ) + 'px'; 4623 elVideo.style.top = ''; 4624 } 4625 4626 if( SEMICOLON.Mobile.any() && !element.classList.contains('no-placeholder') ) { 4627 var placeholderImg = elVideo.getAttribute('poster') || elVideo.getAttribute('data-poster'); 4628 4629 if( placeholderImg != '' ) { 4630 element.innerHTML += '<div class="video-placeholder" style="background-image: url('+ placeholderImg +');"></div>'; 4631 } 4632 4633 elVideo.classList.add('d-none'); 4634 } 4635 }); 4636 4637 __core.getVars.resizers.html5video = function() { 4638 __modules.html5Video(); 4639 }; 4640 } 4641 }; 4642 }(), 4643 // FullVideo Functions End 4644 4645 /** 4646 * -------------------------------------------------------------------------- 4647 * YoutubeBG Functions Start 4648 * -------------------------------------------------------------------------- 4649 */ 4650 YoutubeBG: function() { 4651 return { 4652 init: function(selector) { 4653 if( __core.getSelector(selector, false, false).length < 1 ){ 4654 return true; 4655 } 4656 4657 __core.isFuncTrue( function() { 4658 return typeof jQuery !== 'undefined' && jQuery().YTPlayer; 4659 }).then( function(cond) { 4660 if( !cond ) { 4661 return false;
4662 } 4663 4664 __core.initFunction({ class: 'has-plugin-youtubebg', event: 'pluginYoutubeBgVideoReady' }); 4665 4666 selector = __core.getSelector( selector, true, '.mb_YTPlayer,.customjs' ); 4667 if( selector.length < 1 ){ 4668 return true; 4669 } 4670 4671 selector.each( function(){ 4672 var element = jQuery(this), 4673 elVideo = element.attr('data-video'), 4674 elMute = element.attr('data-mute') || true, 4675 elRatio = element.attr('data-ratio') || '16/9', 4676 elQuality = element.attr('data-quality') || 'hd720', 4677 elOpacity = element.attr('data-opacity') || 1, 4678 elContainer = element.attr('data-container') || 'parent', 4679 elOptimize = element.attr('data-optimize') || true, 4680 elLoop = element.attr('data-loop') || true, 4681 elControls = element.attr('data-controls') || false, 4682 elVolume = element.attr('data-volume') || 50, 4683 elStart = element.attr('data-start') || 0, 4684 elStop = element.attr('data-stop') || 0, 4685 elAutoPlay = element.attr('data-autoplay') || true, 4686 elFullScreen = element.attr('data-fullscreen') || false, 4687 elCoverImage = element.attr('data-coverimage') || '', 4688 elPauseOnBlur = element.attr('data-pauseonblur') || true, 4689 elPlayIfVisible = element.attr('data-playifvisible') || false; 4690 4691 if( elMute == 'false' ) { 4692 elMute = false; 4693 } 4694 4695 if( elContainer == 'parent' ) { 4696 var parent = element.parent(); 4697 if( parent.attr('id') ) { 4698 elContainer = '#' + parent.attr('id'); 4699 } else { 4700 var ytPid = 'yt-bg-player-parent-' + Math.floor( Math.random() * 10000 ); 4701 parent.attr( 'id', ytPid ); 4702 elContainer = '#' + ytPid; 4703 } 4704 } 4705 4706 if( elOptimize == 'false' ) { 4707 elOptimize = false; 4708 } 4709 4710 if( elLoop == 'false' ) { 4711 elLoop = false; 4712 } 4713 4714 if( elControls == 'true' ) { 4715 elControls = true; 4716 } 4717 4718 if( elAutoPlay == 'false' ) { 4719 elAutoPlay = false; 4720 } 4721 4722 if( elFullScreen == 'true' ) { 4723 elFullScreen = true; 4724 } 4725 4726 if( elPauseOnBlur == 'true' ) { 4727 elPauseOnBlur = true; 4728 } 4729 4730 if( elPlayIfVisible == 'true' ) { 4731 elPlayIfVisible = true; 4732 } 4733 4734 element.YTPlayer({ 4735 videoURL: elVideo, 4736 mute: elMute, 4737 ratio: elRatio, 4738 quality: elQuality, 4739 opacity: Number(elOpacity), 4740 containment: elContainer, 4741 optimizeDisplay: elOptimize, 4742 loop: elLoop, 4743 vol: Number(elVolume), 4744 startAt: Number(elStart), 4745 stopAt: Number(elStop), 4746 autoPlay: elAutoPlay, 4747 realfullscreen: elFullScreen, 4748 showYTLogo: false, 4749 showControls: false, 4750 coverImage: elCoverImage, 4751 stopMovieOnBlur: elPauseOnBlur, 4752 playOnlyIfVisible: elPlayIfVisible, 4753 }); 4754 }); 4755 }); 4756 } 4757 }; 4758 }(), 4759 // YoutubeBG Functions End 4760 4761 /** 4762 * -------------------------------------------------------------------------- 4763 * Toggle Functions Start 4764 * -------------------------------------------------------------------------- 4765 */ 4766 Toggle: function() { 4767 return { 4768 init: function(selector) { 4769 if( __core.getSelector(selector, false, false).length < 1 ){ 4770 return true; 4771 } 4772 4773 __core.isFuncTrue( function() { 4774 return typeof jQuery !== 'undefined'; 4775 }).then( function(cond) { 4776 if( !cond ) { 4777 return false; 4778 } 4779 4780 __core.initFunction({ class: 'has-plugin-toggles', event: 'pluginTogglesReady' }); 4781 4782 selector = __core.getSelector( selector ); 4783 if( selector.length < 1 ){ 4784 return true; 4785 } 4786 4787 selector.each( function(){ 4788 var element = jQuery(this), 4789 elSpeed = element.attr('data-speed') || 300, 4790 elState = element.attr('data-state'); 4791 4792 if( elState != 'open' ){ 4793 element.children('.toggle-content').hide(); 4794 } else { 4795 element.addClass('toggle-active').children('.toggle-content').slideDown( Number(elSpeed) ); 4796 } 4797 4798 element.children('.toggle-header').off( 'click' ).on( 'click', function(){ 4799 element.toggleClass('toggle-active').children('.toggle-content').slideToggle( Number(elSpeed) ); 4800 return true; 4801 }); 4802 }); 4803 }); 4804 } 4805 }; 4806 }(), 4807 // Toggle Functions End 4808 4809 /** 4810 * -------------------------------------------------------------------------- 4811 * Accordion Functions Start 4812 * -------------------------------------------------------------------------- 4813 */ 4814 Accordion: function() { 4815 return { 4816 init: function(selector) { 4817 if( __core.getSelector(selector, false, false).length < 1 ){ 4818 return true; 4819 } 4820 4821 __core.isFuncTrue( function() { 4822 return typeof jQuery !== 'undefined'; 4823 }).then( function(cond) { 4824 if( !cond ) { 4825 return false;
4826 } 4827 4828 __core.initFunction({ class: 'has-plugin-accordions', event: 'pluginAccordionsReady' }); 4829 4830 selector = __core.getSelector( selector ); 4831 if( selector.length < 1 ){ 4832 return true; 4833 } 4834 4835 selector.each( function(){ 4836 var element = jQuery(this), 4837 elState = element.attr('data-state'), 4838 elActive = element.attr('data-active') || 1, 4839 elActiveClass = element.attr('data-active-class') || '', 4840 elCollapsible = element.attr('data-collapsible') || 'false', 4841 windowHash = location.hash, 4842 accActive; 4843 4844 elActive = Number( elActive ) - 1; 4845 4846 if( typeof windowHash !== 'undefined' && windowHash != '' ) { 4847 accActive = element.find('.accordion-header'+ windowHash); 4848 if( accActive.length > 0 ) { 4849 elActive = accActive.index() / 2; 4850 } 4851 } 4852 4853 element.find('.accordion-content').hide(); 4854 4855 if( elState != 'closed' ) { 4856 element.find('.accordion-header:eq('+ Number(elActive) +')').addClass('accordion-active ' + elActiveClass).next().show(); 4857 } 4858 4859 element.find('.accordion-header').off( 'click' ).on( 'click', function(){ 4860 var clickTarget = jQuery(this); 4861 4862 if( clickTarget.next().is(':hidden') ) { 4863 element.find('.accordion-header').removeClass('accordion-active ' + elActiveClass).next().slideUp("normal"); 4864 clickTarget.toggleClass('accordion-active ' + elActiveClass, true).next().stop(true,true).slideDown("normal", function(){ 4865 if( ( jQuery('body').hasClass('device-sm') || jQuery('body').hasClass('device-xs') ) && element.hasClass('scroll-on-open') ) { 4866 __core.scrollTo((__core.offset(clickTarget).top - __core.getVars.topScrollOffset - 40), 800, 'easeOutQuad'); 4867 } 4868 4869 __core.runContainerModules( clickTarget.next()[0] ); 4870 }); 4871 } else { 4872 if( elCollapsible == 'true' ) { 4873 clickTarget.toggleClass('accordion-active ' + elActiveClass, false).next().stop(true,true).slideUp("normal"); 4874 } 4875 } 4876 4877 return false; 4878 }); 4879 }); 4880 }); 4881 } 4882 }; 4883 }(), 4884 // Accordion Functions End 4885 4886 /** 4887 * -------------------------------------------------------------------------- 4888 * Counter Functions Start 4889 * -------------------------------------------------------------------------- 4890 */ 4891 Counter: function() { 4892 var _run = function(elCounter, elFormat) { 4893 if( elFormat.comma == 'true' ) { 4894 var reFormat = '\\B(?=(\\d{'+ elFormat.places +'})+(?!\\d))', 4895 regExp = new RegExp( reFormat, "g" ); 4896 4897 elCounter.find('span').countTo({ 4898 formatter: function(value, options) { 4899 value = value.toFixed( options.decimals ); 4900 value = value.replace( regExp, elFormat.sep ); 4901 return value; 4902 } 4903 }); 4904 } else { 4905 elCounter.find('span').countTo(); 4906 } 4907 }; 4908 4909 return { 4910 init: function(selector) { 4911 if( __core.getSelector(selector, false, false).length < 1 ){ 4912 return true; 4913 } 4914 4915 __core.isFuncTrue( function() { 4916 return typeof jQuery !== 'undefined' && jQuery().countTo; 4917 }).then( function(cond) { 4918 if( !cond ) { 4919 return false; 4920 } 4921 4922 __core.initFunction({ class: 'has-plugin-counter', event: 'pluginCounterReady' }); 4923 4924 selector = __core.getSelector( selector ); 4925 if( selector.length < 1 ){ 4926 return true; 4927 } 4928 4929 selector.each(function(){ 4930 var element = jQuery(this), 4931 elComma = element.find('span').attr('data-comma'), 4932 elSep = element.find('span').attr('data-sep') || ',', 4933 elPlaces = element.find('span').attr('data-places') || 3; 4934 4935 var elCommaObj = { 4936 comma: elComma, 4937 sep: elSep, 4938 places: Number( elPlaces ) 4939 } 4940 4941 if( element.hasClass('counter-instant') ) { 4942 _run(element, elCommaObj); 4943 return; 4944 } 4945 4946 var observer = new IntersectionObserver( function(entries, observer) { 4947 entries.forEach( function(entry) { 4948 if (entry.isIntersecting) { 4949 _run(element, elCommaObj); 4950 observer.unobserve(entry.target); 4951 } 4952 }); 4953 }, {rootMargin: '0px 0px 50px'}); 4954 4955 observer.observe( element[0] ); 4956 }); 4957 }); 4958 } 4959 }; 4960 }(), 4961 // Counter Functions End 4962 4963 /** 4964 * -------------------------------------------------------------------------- 4965 * Countdown Functions Start 4966 * -------------------------------------------------------------------------- 4967 */ 4968 Countdown: function() { 4969 return { 4970 init: function(selector) { 4971 if( __core.getSelector(selector, false, false).length < 1 ){ 4972 return true; 4973 } 4974 4975 __core.isFuncTrue( function() { 4976 return typeof jQuery !== 'undefined' && typeof moment !== "undefined" && jQuery().countdown; 4977 }).then( function(cond) { 4978 if( !cond ) { 4979 return false;
4980 } 4981 4982 __core.initFunction({ class: 'has-plugin-countdown', event: 'pluginCountdownReady' }); 4983 4984 selector = __core.getSelector( selector ); 4985 if( selector.length < 1 ){ 4986 return true; 4987 } 4988 4989 selector.each( function(){ 4990 var element = jQuery(this), 4991 elFormat = element.attr( 'data-format' ) || 'dHMS', 4992 elSince = element.attr( 'data-since' ), 4993 elYear = element.attr( 'data-year' ), 4994 elMonth = element.attr( 'data-month' ), 4995 elDay = element.attr( 'data-day' ), 4996 elHour = element.attr( 'data-hour' ), 4997 elMin = element.attr( 'data-minute' ), 4998 elSec = element.attr( 'data-second' ), 4999 elRedirect = element.attr( 'data-redirect' ), 5000 dateFormat, setDate; 5001 5002 if( elYear ){ 5003 dateFormat = elYear; 5004 } 5005 5006 if( elMonth && elMonth < 13 ){ 5007 dateFormat = dateFormat +"-"+ ( elMonth < 10 ? '0'+elMonth : elMonth); 5008 } else { 5009 if( elYear ) { 5010 dateFormat = dateFormat +"-01"; 5011 } 5012 } 5013 5014 if( elDay && elDay < 32 ){ 5015 dateFormat = dateFormat +"-"+ ( elDay < 10 ? '0'+elDay : elDay); 5016 } else { 5017 if( elYear ) { 5018 dateFormat = dateFormat +"-01"; 5019 } 5020 } 5021 5022 setDate = dateFormat != '' ? new Date( moment( dateFormat ) ) : new Date(); 5023 5024 if( elHour && elHour < 25 ){ 5025 setDate.setHours( setDate.getHours() + Number( elHour ) ); 5026 } 5027 5028 if( elMin && elMin < 60 ){ 5029 setDate.setMinutes( setDate.getMinutes() + Number( elMin ) ); 5030 } 5031 5032 if( elSec && elSec < 60 ){ 5033 setDate.setSeconds( setDate.getSeconds() + Number( elSec ) ); 5034 } 5035 5036 if( !elRedirect ) { 5037 elRedirect = false; 5038 } 5039 5040 if( elSince == 'true' ) { 5041 element.countdown({ 5042 since: setDate, 5043 format: elFormat, 5044 expiryUrl: elRedirect, 5045 }); 5046 } else { 5047 element.countdown({ 5048 until: setDate, 5049 format: elFormat, 5050 expiryUrl: elRedirect, 5051 }); 5052 } 5053 }); 5054 }); 5055 } 5056 }; 5057 }(), 5058 // Countdown Functions End 5059 5060 /** 5061 * -------------------------------------------------------------------------- 5062 * GoogleMaps Functions Start 5063 * -------------------------------------------------------------------------- 5064 */ 5065 GoogleMaps: function() { 5066 return { 5067 init: function(selector) { 5068 if( __core.getSelector(selector, false, false).length < 1 ){ 5069 return true; 5070 } 5071 5072 if( !__core.getOptions.gmapAPI ) { 5073 console.warn( 'No API Key defined for Google Maps! Please set an API Key in js/functions.js File!' ); 5074 return true; 5075 } 5076 5077 __core.loadJS({file: 'https://maps.google.com/maps/api/js?key='+__core.getOptions.gmapAPI+"&callback=SEMICOLON.Modules.gmap", id: 'canvas-gmapapi-js'}); 5078 __core.isFuncTrue( function() { 5079 return typeof jQuery !== 'undefined' && typeof google !== "undefined" && jQuery().gMap; 5080 }).then( function(cond) { 5081 if( !cond ) { 5082 return false; 5083 } 5084 5085 __core.initFunction({ class: 'has-plugin-gmap', event: 'pluginGmapReady' }); 5086 5087 selector = __core.getSelector( selector ); 5088 if( selector.length < 1 ){ 5089 return true; 5090 } 5091 5092 selector.each( function() { 5093 var element = jQuery(this), 5094 elLat = element.attr( 'data-latitude' ), 5095 elLon = element.attr( 'data-longitude' ), 5096 elAdd = element.attr( 'data-address' ), 5097 elCon = element.attr( 'data-content' ), 5098 elScroll = element.attr( 'data-scrollwheel' ) || true, 5099 elType = element.attr( 'data-maptype' ) || 'ROADMAP', 5100 elZoom = element.attr( 'data-zoom' ) || 12, 5101 elStyles = element.attr( 'data-styles' ), 5102 elMarkers = element.attr( 'data-markers' ), 5103 elIcon = element.attr( 'data-icon' ), 5104 elConPan = element.attr( 'data-control-pan' ) || false, 5105 elConZoom = element.attr( 'data-control-zoom' )|| false, 5106 elConMapT = element.attr( 'data-control-maptype' )|| false, 5107 elConScale = element.attr( 'data-control-scale' )|| false, 5108 elConStreetV = element.attr( 'data-control-streetview' )|| false, 5109 elConOverview = element.attr( 'data-control-overview' )|| false; 5110 5111 if( elAdd ) { 5112 elLat = elLon = false;
5113 } else { 5114 if( !elLat && !elLon ) { 5115 console.log( 'Google Map co-ordinates not entered.' ); 5116 return true; 5117 } 5118 } 5119 5120 if( elStyles ) { elStyles = JSON.parse( elStyles ); } 5121 if( elScroll == 'false' ) { elScroll = false; } 5122 if( elConPan == 'true' ) { elConPan = true; } 5123 if( elConZoom == 'true' ) { elConZoom = true; } 5124 if( elConMapT == 'true' ) { elConMapT = true; } 5125 if( elConScale == 'true' ) { elConScale = true; } 5126 if( elConStreetV == 'true' ) { elConStreetV = true; } 5127 if( elConOverview == 'true' ) { elConOverview = true; } 5128 5129 if( elMarkers ) { 5130 elMarkers = Function( 'return ' + elMarkers )(); 5131 } else { 5132 if( elAdd ) { 5133 elMarkers = [ 5134 { 5135 address: elAdd, 5136 html: elCon ? elCon : elAdd 5137 } 5138 ] 5139 } else { 5140 elMarkers = [ 5141 { 5142 latitude: elLat, 5143 longitude: elLon, 5144 html: elCon ? elCon : false 5145 } 5146 ] 5147 } 5148 } 5149 5150 if( elIcon ) { 5151 elIcon = Function( 'return ' + elIcon )(); 5152 } else { 5153 elIcon = { 5154 image: "https://www.google.com/mapfiles/marker.png", 5155 shadow: "https://www.google.com/mapfiles/shadow50.png", 5156 iconsize: [20, 34], 5157 shadowsize: [37, 34], 5158 iconanchor: [9, 34], 5159 shadowanchor: [19, 34] 5160 }; 5161 } 5162 5163 element.gMap({ 5164 controls: { 5165 panControl: elConPan, 5166 zoomControl: elConZoom, 5167 mapTypeControl: elConMapT, 5168 scaleControl: elConScale, 5169 streetViewControl: elConStreetV, 5170 overviewMapControl: elConOverview 5171 }, 5172 scrollwheel: elScroll, 5173 maptype: elType, 5174 markers: elMarkers, 5175 icon: elIcon, 5176 latitude: elLat, 5177 longitude: elLon, 5178 address: elAdd, 5179 zoom: Number( elZoom ), 5180 styles: elStyles 5181 }); 5182 }); 5183 }); 5184 } 5185 }; 5186 }(), 5187 // GoogleMaps Functions End 5188 5189 /** 5190 * -------------------------------------------------------------------------- 5191 * RoundedSkills Functions Start 5192 * -------------------------------------------------------------------------- 5193 */ 5194 RoundedSkills: function() { 5195 var _run = function(element, properties) { 5196 element.easyPieChart({ 5197 size: properties.size, 5198 animate: properties.speed, 5199 scaleColor: false, 5200 trackColor: properties.trackcolor, 5201 lineWidth: properties.width, 5202 lineCap: 'square', 5203 barColor: properties.color 5204 }); 5205 }; 5206 5207 return { 5208 init: function(selector) { 5209 if( __core.getSelector(selector, false, false).length < 1 ){ 5210 return true; 5211 } 5212 5213 __core.isFuncTrue( function() { 5214 return typeof jQuery !== 'undefined' && jQuery().easyPieChart; 5215 }).then( function(cond) { 5216 if( !cond ) { 5217 return false; 5218 } 5219 5220 __core.initFunction({ class: 'has-plugin-piechart', event: 'pluginRoundedSkillReady' }); 5221 5222 selector = __core.getSelector( selector ); 5223 if( selector.length < 1 ){ 5224 return true; 5225 } 5226 5227 selector.each(function(){ 5228 var element = jQuery(this), 5229 elSize = element.attr('data-size') || 140, 5230 elSpeed = element.attr('data-speed') || 2000, 5231 elWidth = element.attr('data-width') || 4, 5232 elColor = element.attr('data-color') || '#0093BF', 5233 elTrackColor = element.attr('data-trackcolor') || 'rgba(0,0,0,0.04)'; 5234 5235 var properties = { 5236 size: Number( elSize ), 5237 speed: Number( elSpeed ), 5238 width: Number( elWidth ), 5239 color: elColor, 5240 trackcolor: elTrackColor 5241 }; 5242 5243 element.css({ 'width': elSize+'px', 'height': elSize+'px', 'line-height': elSize+'px' }); 5244 5245 if( jQuery('body').hasClass('device-up-lg') ){ 5246 element.animate({opacity:0}
5246, 10); 5247 var observer = new IntersectionObserver( function(entries, observer){ 5248 entries.forEach( function(entry){ 5249 if (entry.isIntersecting) { 5250 if (!element.hasClass('skills-animated')) { 5251 setTimeout( function(){ 5252 element.css({opacity: 1}); 5253 }, 100); 5254 5255 _run(element, properties); 5256 element.addClass('skills-animated'); 5257 } 5258 observer.unobserve( entry.target ); 5259 } 5260 }); 5261 }, {rootMargin: '0px 0px 50px'}); 5262 observer.observe( element[0] ); 5263 } else { 5264 _run(element, properties); 5265 } 5266 }); 5267 }); 5268 } 5269 }; 5270 }(), 5271 // RoundedSkills Functions End 5272 5273 /** 5274 * -------------------------------------------------------------------------- 5275 * Progress Functions Start 5276 * -------------------------------------------------------------------------- 5277 */ 5278 Progress: function() { 5279 return { 5280 init: function(selector) { 5281 if( __core.getSelector(selector, false, false).length < 1 ){ 5282 return true; 5283 } 5284 5285 __core.isFuncTrue( function() { 5286 return typeof jQuery !== 'undefined' && jQuery().countTo; 5287 }).then( function(cond) { 5288 5289 __core.initFunction({ class: 'has-plugin-progress', event: 'pluginProgressReady' }); 5290 5291 selector = __core.getSelector( selector, false ); 5292 if( selector.length < 1 ){ 5293 return true; 5294 } 5295 5296 selector.forEach( function(element) { 5297 var elValue = element.getAttribute('data-percent') || 90, 5298 elSpeed = element.getAttribute('data-speed') || 1200, 5299 elBar = element.querySelector('.skill-progress-percent'); 5300 5301 elSpeed = Number(elSpeed) + 'ms'; 5302 5303 elBar.style.setProperty( '--cnvs-progress-speed', elSpeed ); 5304 5305 var observer = new IntersectionObserver( function(entries, observer){ 5306 entries.forEach( function(entry) { 5307 if (entry.isIntersecting) { 5308 if (!elBar.classList.contains('skill-animated')) { 5309 __modules.counter(element.querySelector('.counter')); 5310 5311 if ( element.classList.contains('skill-progress-vertical') ) { 5312 elBar.style.height = elValue + "%"; 5313 elBar.classList.add('skill-animated'); 5314 } else { 5315 elBar.style.width = elValue + "%"; 5316 elBar.classList.add('skill-animated'); 5317 } 5318 } 5319 5320 observer.unobserve( entry.target ); 5321 } 5322 }); 5323 }, {rootMargin: '0px 0px 50px'}); 5324 5325 observer.observe( elBar ); 5326 }); 5327 }); 5328 } 5329 }; 5330 }(), 5331 // Progress Functions End 5332 5333 /** 5334 * -------------------------------------------------------------------------- 5335 * Twitter Functions Start 5336 * -------------------------------------------------------------------------- 5337 */ 5338 Twitter: function() { 5339 var _build = function(tweet, element, username) { 5340 var elFontClass = element.getAttribute('data-font-class') || 'font-body'; 5341 5342 var status = tweet.text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { 5343 return '<a href="'+url+'" target="_blank">'+url+'</a>'; 5344 }).replace(/\B@([_a-z0-9]+)/ig, function(reply) { 5345 return reply.charAt(0)+'<a href="https://twitter.com/'+reply.substring(1)+'" target="_blank">'+reply.substring(1)+'</a>'; 5346 }); 5347 5348 if( element.classList.contains('fslider') ) { 5349 var slide = document.createElement('div'); 5350 slide.classList.add('slide'); 5351 slide.innerHTML += '<p class="mb-3 '+elFontClass+'">'+status+'</p><small class="d-block"><a href="https://twitter.com/'+username+'/statuses/'+tweet.id_str+'" target="_blank">'+_time(tweet.created_at)+'</a></small>'; 5352 element.querySelector('.slider-wrap').append(slide); 5353 } else { 5354 element.innerHTML += '<li><i class="fa-brands fa-x-twitter"></i><div><span>'+status+'</span><small><a href="https://twitter.com/'+username+'/statuses/'+tweet.id_str+'" target="_blank">'+_time(tweet.created_at)+'</a></small></div></li>'; 5355 } 5356 } 5357 5358 var _time = function(time_value) { 5359 var parsed_date = new Date(time_value); 5360 var relative_to = new Date(); 5361 var delta = parseInt((relative_to.getTime() - parsed_date) / 1000); 5362 delta = delta + (relative_to.getTimezoneOffset() * 60); 5363 5364 if (delta < 60) { 5365 return 'less than a minute ago'; 5366 } else if(delta < 120) { 5367 return 'about a minute ago'; 5368 } else if(delta < (60*60)) { 5369 return (parseInt(delta / 60)).toString() + ' minutes ago'; 5370 } else if(delta < (120*60)) { 5371 return 'about an hour ago'; 5372 } else if(delta < (24*60*60)) { 5373 return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago'; 5374 } else if(delta < (48*60*60)) { 5375 return '1 day ago'; 5376 } else { 5377 return (parseInt(delta / 86400)).toString() + ' days ago'; 5378 } 5379 } 5380 5381 return { 5382 init: function(selector) { 5383 if( __core.getSelector(selector, false, false).length < 1 ){ 5384 return true; 5385 } 5386 5387 __core.initFunction({ class: 'has-plugin-twitter', event: 'pluginTwitterFeedReady' }); 5388 5389 selector = __core.getSelector( selector, false, false ); 5390 if( selector.length < 1 ){ 5391 return true; 5392 } 5393 5394 selector.forEach( function(element) { 5395 var elUser = element.getAttribute('data-username') || 'twitter', 5396 elCount = element.getAttribute('data-count') || 3, 5397 elLoader = element.getAttribute('data-loader') || 'include/twitter/tweets.php', 5398 elFetch = element.getAttribute('data-fetch-message') || 'Fetching Tweets from Twitter...'; 5399 5400 var alert = element.querySelector('.twitter-widget-alert'); 5401 5402 if( !alert ) { 5403 alert = document.createElement('div'); 5404 alert.classList.add( 'alert', 'alert-warning', 'twitter-widget-alert', 'text-center' );
5405 element.prepend(alert); 5406 alert.innerHTML = '<div class="spinner-grow spinner-grow-sm me-2" role="status"><span class="visually-hidden">Loading...</span></div> ' + elFetch; 5407 } 5408 5409 fetch( elLoader + '?username='+ elUser ).then( function(response) { 5410 return response.json(); 5411 }).then( function(tweets) { 5412 if( typeof tweets === 'object' && !tweets.isArray() ) { 5413 return false; 5414 } 5415 5416 alert.remove(); 5417 var i = 0; 5418 tweets?.some( function(tw) { 5419 if( i == Number(elCount) ) { 5420 return; 5421 } 5422 5423 _build(tw, element, elUser); 5424 i++; 5425 }); 5426 5427 if( element.classList.contains('fslider') ) { 5428 var timer = setInterval( function() { 5429 if( element.querySelectorAll('.slide').length > 1 ) { 5430 element.classList.remove('customjs'); 5431 5432 setTimeout( function() { 5433 __modules.flexSlider(); 5434 jQuery(element).find( '.flexslider .slide' ).resize(); 5435 }, 500); 5436 5437 clearInterval(timer); 5438 } 5439 }, 1000); 5440 } 5441 }).catch( function(err) { 5442 console.log(err); 5443 alert.classList.remove( 'alert-warning' ); 5444 alert.classList.add( 'alert-danger' ); 5445 alert.innerHTML = 'Could not fetch Tweets from Twitter API. Please try again later.'; 5446 }); 5447 }); 5448 } 5449 }; 5450 }(), 5451 // Twitter Functions End 5452 5453 /** 5454 * -------------------------------------------------------------------------- 5455 * Flickr Functions Start 5456 * -------------------------------------------------------------------------- 5457 */ 5458 Flickr: function() { 5459 return { 5460 init: function(selector) { 5461 if( __core.getSelector(selector, false, false).length < 1 ){ 5462 return true; 5463 } 5464 5465 __core.isFuncTrue( function() { 5466 return typeof jQuery !== 'undefined' && jQuery().jflickrfeed; 5467 }).then( function(cond) { 5468 if( !cond ) { 5469 return false; 5470 } 5471 5472 __core.initFunction({ class: 'has-plugin-flickr', event: 'pluginFlickrFeedReady' }); 5473 5474 selector = __core.getSelector( selector, true, false ); 5475 if( selector.length < 1 ){ 5476 return true; 5477 } 5478 5479 selector.each(function() { 5480 var element = jQuery(this), 5481 elID = element.attr('data-id'), 5482 elCount = element.attr('data-count') || 9, 5483 elType = element.attr('data-type'), 5484 elTypeGet = 'photos_public.gne'; 5485 5486 if( elType == 'group' ) { elTypeGet = 'groups_pool.gne'; } 5487 5488 element.jflickrfeed({ 5489 feedapi: elTypeGet, 5490 limit: Number(elCount), 5491 qstrings: { 5492 id: elID 5493 }, 5494 itemTemplate: '<a class="grid-item" href="{{image_b}}" title="{{title}}" data-lightbox="gallery-item">' + 5495 '<img src="{{image_s}}" alt="{{title}}" />' + 5496 '</a>' 5497 }, function(data) { 5498 element.removeClass('customjs'); 5499 __core.imagesLoaded(element[0]); 5500 __modules.lightbox(); 5501 5502 element[0].addEventListener( 'CanvasImagesLoaded', function() { 5503 __modules.gridInit(); 5504 __modules.masonryThumbs(); 5505 }); 5506 }); 5507 }); 5508 }); 5509 } 5510 }; 5511 }(), 5512 // Flickr Functions End 5513 5514 /** 5515 * -------------------------------------------------------------------------- 5516 * Instagram Functions Start 5517 * -------------------------------------------------------------------------- 5518 */ 5519 Instagram: function() { 5520 var _get = function(element, loader, limit, fetchAlert) { 5521 var alert = element.closest('.instagram-widget-alert'); 5522 5523 if( !alert ) { 5524 alert = document.createElement('div'); 5525 alert.classList.add( 'alert', 'alert-warning', 'instagram-widget-alert', 'text-center' ); 5526 element.insertAdjacentElement( 'beforebegin', alert ); 5527 alert.innerHTML = '<div class="spinner-grow spinner-grow-sm me-2" role="status"><span class="visually-hidden">Loading...</span></div> ' + fetchAlert; 5528 } 5529 5530 fetch(loader).then( function(response) { 5531 return response.json(); 5532 }).then( function(images) { 5533 if( images.length > 0 ) { 5534 alert.remove(); 5535 for (var i = 0; i < limit; i++) { 5536 if ( i === limit ) 5537 continue; 5538 5539 var photo = images[i], 5540 thumb = photo.media_url; 5541 if( photo.media_type === 'VIDEO' ) { 5542 thumb = photo.thumbnail_url; 5543 } 5544 5545 element.innerHTML += '<a class="grid-item" href="'+ photo.permalink +'" target="_blank"><img src="'+ thumb +'" alt="Image"></a>'; 5546 } 5547 } 5548 5549 element.classList.remove('customjs'); 5550 __core.imagesLoaded(element); 5551 5552 element.addEventListener( 'CanvasImagesLoaded', function() { 5553 __modules.masonryThumbs(); 5554 __modules.lightbox(); 5555 }); 5556 }).catch( function(err) { 5557 console.log(err); 5558 alert.classList.remove( 'alert-warning' ); 5559 alert.classList.add( 'alert-danger' ); 5560 alert.innerHTML = 'Could not fetch Photos from Instagram API. Please try again later.'; 5561 }); 5562 }; 5563 5564 return { 5565 init: function(selector) { 5566 if( __core.getSelector(selector, false, false).length < 1 ){ 5567 return true; 5568 } 5569 5570 __core.initFunction({ class: 'has-plugin-instagram', event: 'pluginInstagramReady' }); 5571 5572 selector = __core.getSelector( selector, false, false ); 5573 if( selector.length < 1 ){ 5574 return true; 5575 } 5576 5577 selector.forEach( function(element) { 5578 var elLimit = element.getAttribute('data-count') || 12, 5579 elLoader = element.getAttribute('data-loader') || 'include/instagram/instagram.php', 5580 elFetch = element.getAttribute('data-fetch-message') || 'Fetching Photos from Instagram...'; 5581 5582 if( Number( elLimit ) > 12 ) { 5583 elLimit = 12; 5584 } 5585 5586 _get(element, elLoader, elLimit, elFetch); 5587 }); 5588 } 5589 }; 5590 }(), 5591 // Instagram Functions End 5592 5593 /** 5594 * -------------------------------------------------------------------------- 5595 * NavTree Functions Start 5596 * -------------------------------------------------------------------------- 5597 */ 5598 NavTree: function() { 5599 return { 5600 init: function(selector) { 5601 if( __core.getSelector(selector, false, false).length < 1 ){ 5602 return true; 5603 } 5604 5605 __core.isFuncTrue( function() { 5606 return typeof jQuery !== 'undefined'; 5607 }).then( function(cond) { 5608 if( !cond ) { 5609 return false;
5610 } 5611 5612 __core.initFunction({ class: 'has-plugin-navtree', event: 'pluginNavTreeReady' }); 5613 5614 selector = __core.getSelector( selector ); 5615 if( selector.length < 1 ){ 5616 return true; 5617 } 5618 5619 selector.each( function(){ 5620 var element = jQuery(this), 5621 elSpeed = element.attr('data-speed') || 250, 5622 elEasing = element.attr('data-easing') || 'swing', 5623 elArrow = element.attr('data-arrow-class') || 'fa-solid fa-angle-right'; 5624 5625 element.find( 'ul li:has(ul)' ).addClass('sub-menu'); 5626 element.find( 'ul li:has(ul) > a' ).filter(':not(:has(.sub-menu-indicator))').append( '<i class="sub-menu-indicator '+ elArrow +'"></i>' ); 5627 5628 if( element.hasClass('on-hover') ){ 5629 element.find( 'ul li:has(ul):not(.active)' ).hover( function(e){ 5630 jQuery(this).children('ul').stop(true, true).slideDown( Number(elSpeed), elEasing); 5631 }, function(){ 5632 jQuery(this).children('ul').delay(250).slideUp( Number(elSpeed), elEasing); 5633 }); 5634 } else { 5635 element.find( 'ul li:has(ul) > a' ).off( 'click' ).on( 'click', function(){ 5636 var childElement = jQuery(this); 5637 5638 element.find( 'ul li' ).not(childElement.parents()).removeClass('active'); 5639 5640 childElement.parent().children('ul').slideToggle( Number(elSpeed), elEasing, function(){ 5641 jQuery(this).find('ul').hide(); 5642 jQuery(this).find('li.active').removeClass('active'); 5643 }); 5644 5645 element.find( 'ul li > ul' ).not(childElement.parent().children('ul')).not(childElement.parents('ul')).slideUp( Number(elSpeed), elEasing ); 5646 childElement.parent('li:has(ul)').toggleClass('active'); 5647 5648 return true; 5649 }); 5650 } 5651 }); 5652 }); 5653 } 5654 }; 5655 }(), 5656 // NavTree Functions End 5657 5658 /** 5659 * -------------------------------------------------------------------------- 5660 * Carousel Functions Start 5661 * -------------------------------------------------------------------------- 5662 */ 5663 Carousel: function() { 5664 return { 5665 init: function(selector) { 5666 if( __core.getSelector(selector, false, false).length < 1 ){ 5667 return true; 5668 } 5669 5670 __core.isFuncTrue( function() { 5671 return typeof jQuery !== 'undefined' && jQuery().owlCarousel; 5672 }).then( function(cond) { 5673 if( !cond ) { 5674 return false; 5675 } 5676 5677 __core.initFunction({ class: 'has-plugin-carousel', event: 'pluginCarouselReady' }); 5678 5679 selector = __core.getSelector( selector ); 5680 if( selector.length < 1 ){ 5681 return true; 5682 } 5683 5684 selector.each( function(){ 5685 var element = jQuery(this), 5686 elItems = element.attr('data-items') || 4, 5687 elItemsXs = element.attr('data-items-xs') || Number( elItems ), 5688 elItemsSm = element.attr('data-items-sm') || Number( elItemsXs ), 5689 elItemsMd = element.attr('data-items-md') || Number( elItemsSm ), 5690 elItemsLg = element.attr('data-items-lg') || Number( elItemsMd ), 5691 elItemsXl = element.attr('data-items-xl') || Number( elItemsLg ), 5692 elItemsXxl = element.attr('data-items-xxl') || Number( elItemsXl ), 5693 elLoop = element.attr('data-loop'), 5694 elAutoPlay = element.attr('data-autoplay'), 5695 elSpeed = element.attr('data-speed') || 250, 5696 elAnimateIn = element.attr('data-animate-in'), 5697 elAnimateOut = element.attr('data-animate-out'), 5698 elAutoWidth = element.attr('data-auto-width'), 5699 elNav = element.attr('data-nav'), 5700 elNavPrev = element.attr('data-nav-prev') || '<i class="uil uil-angle-left-b"></i>', 5701 elNavNext = element.attr('data-nav-next') || '<i class="uil uil-angle-right-b"></i>', 5702 elPagi = element.attr('data-pagi'), 5703 elMargin = element.attr('data-margin') || 20, 5704 elStage = element.attr('data-stage-padding') || 0, 5705 elMerge = element.attr('data-merge'), 5706 elStart = element.attr('data-start') || 0, 5707 elRewind = element.attr('data-rewind'), 5708 elSlideBy = element.attr('data-slideby') || 1, 5709 elCenter = element.attr('data-center'), 5710 elLazy = element.attr('data-lazyload'), 5711 elVideo = element.attr('data-video'), 5712 elRTL = element.attr('data-rtl'), 5713 elAutoPlayTime = 5000, 5714 elAutoPlayHoverP = true; 5715 5716 if( elSlideBy == 'page' ) { 5717 elSlideBy = 'page'; 5718 } else { 5719 elSlideBy = Number(elSlideBy); 5720 } 5721 5722 if( elLoop == 'true' ){ elLoop = true; } else { elLoop = false; } 5723 if( !elAutoPlay ){ 5724 elAutoPlay = false;
5725 elAutoPlayHoverP = false; 5726 } else { 5727 elAutoPlayTime = Number(elAutoPlay); 5728 elAutoPlay = true; 5729 } 5730 if( !elAnimateIn ) { elAnimateIn = false; } 5731 if( !elAnimateOut ) { elAnimateOut = false; } 5732 if( elAutoWidth == 'true' ){ elAutoWidth = true; } else { elAutoWidth = false; } 5733 if( elNav == 'false' ){ elNav = false; } else { elNav = true; } 5734 if( elPagi == 'false' ){ elPagi = false; } else { elPagi = true; } 5735 if( elRewind == 'true' ){ elRewind = true; } else { elRewind = false; } 5736 if( elMerge == 'true' ){ elMerge = true; } else { elMerge = false; } 5737 if( elCenter == 'true' ){ elCenter = true; } else { elCenter = false; } 5738 if( elLazy == 'true' ){ elLazy = true; } else { elLazy = false; } 5739 if( elVideo == 'true' ){ elVideo = true; } else { elVideo = false; } 5740 if( elRTL == 'true' || jQuery('body').hasClass('rtl') ){ elRTL = true; } else { elRTL = false; } 5741 5742 var carousel = element.owlCarousel({ 5743 margin: Number(elMargin), 5744 loop: elLoop, 5745 stagePadding: Number(elStage), 5746 merge: elMerge, 5747 startPosition: Number(elStart), 5748 rewind: elRewind, 5749 slideBy: elSlideBy, 5750 center: elCenter, 5751 lazyLoad: elLazy, 5752 autoWidth: elAutoWidth, 5753 nav: elNav, 5754 navText: [elNavPrev,elNavNext], 5755 autoplay: elAutoPlay, 5756 autoplayTimeout: elAutoPlayTime, 5757 autoplayHoverPause: elAutoPlayHoverP, 5758 dots: elPagi, 5759 smartSpeed: Number(elSpeed), 5760 fluidSpeed: Number(elSpeed), 5761 video: elVideo, 5762 animateIn: elAnimateIn, 5763 animateOut: elAnimateOut, 5764 rtl: elRTL, 5765 responsive:{ 5766 0:{ items: elItemsXs }, 5767 576:{ items: elItemsSm }, 5768 768:{ items: elItemsMd }, 5769 992:{ items: elItemsLg }, 5770 1200:{ items: elItemsXl }, 5771 1400:{ items: elItemsXxl } 5772 }, 5773 onInitialized: function(){ 5774 __base.sliderDimensions(element.parents('.slider-element')[0]); 5775 __core.runContainerModules(element[0]); 5776 5777 if( element.find('.owl-dot').length > 0 ) { 5778 element.addClass('with-carousel-dots'); 5779 } 5780 } 5781 }); 5782 5783 jQuery(window).on( 'lazyLoadLoaded', function(){ 5784 if( element.find('.lazy').length == element.find('.lazy.lazy-loaded').length ) { 5785 lazyLoadInstance.update(); 5786 setTimeout( function(){ 5787 carousel.trigger( 'refresh.owl.carousel' ); 5788 }, 500); 5789 } 5790 }); 5791 }); 5792 }); 5793 } 5794 }; 5795 }(), 5796 // Carousel Functions End 5797 5798 /** 5799 * -------------------------------------------------------------------------- 5800 * MasonryThumbs Functions Start 5801 * -------------------------------------------------------------------------- 5802 */ 5803 MasonryThumbs: function() { 5804 return { 5805 init: function(selector) { 5806 if( __core.getSelector(selector, false, false).length < 1 ){ 5807 return true; 5808 } 5809 5810 __core.isFuncTrue( function() { 5811 return typeof jQuery !== 'undefined' && typeof Isotope !== 'undefined'; 5812 }).then( function(cond) { 5813 if( !cond ) { 5814 return false; 5815 } 5816 5817 __core.initFunction({ class: 'has-plugin-masonrythumbs', event: 'pluginMasonryThumbsReady' }); 5818 5819 selector = __core.getSelector( selector ); 5820 if( selector.length < 1 ){ 5821 return true; 5822 } 5823 5824 selector.each( function() { 5825 var element = jQuery(this), 5826 elChildren = element.children(), 5827 elBig = element.attr('data-big'); 5828 5829 if( elChildren.length < 1 ) { 5830 return false; 5831 } 5832
5833 elChildren.removeClass('grid-item-big').css({ 'width': '' }); 5834 5835 var compStyle = window.getComputedStyle( elChildren.eq(0)[0] ); 5836 var firstElementWidth = Number(compStyle.getPropertyValue('width').split('px')[0]); 5837 5838 if( element.filter('.has-init-isotope').length > 0 ) { 5839 element.isotope({ 5840 masonry: { 5841 columnWidth: firstElementWidth 5842 } 5843 }); 5844 } 5845 5846 if( elBig ) { 5847 elBig = elBig.split(","); 5848 5849 var elBigNum = '', 5850 bigi = ''; 5851 5852 for( bigi = 0; bigi < elBig.length; bigi++ ){ 5853 elBigNum = Number(elBig[bigi]) - 1; 5854 elChildren.eq(elBigNum).addClass('grid-item-big'); 5855 } 5856 } 5857 5858 setTimeout( function() { 5859 element.find('.grid-item-big').css({ width: (firstElementWidth * 2) + 'px' }); 5860 }, 500); 5861 5862 setTimeout( function() { 5863 element.filter('.has-init-isotope').isotope( 'layout' ); 5864 }, 1000); 5865 5866 element[0].addEventListener( 'transitionend', function() { 5867 __modules.readmore(); 5868 }); 5869 }); 5870 5871 __core.getVars.resizers.masonryThumbs = function() { 5872 __modules.masonryThumbs(); 5873 }; 5874 }); 5875 } 5876 }; 5877 }(), 5878 // MasonryThumbs Functions End 5879 5880 /** 5881 * -------------------------------------------------------------------------- 5882 * Notifications Functions Start 5883 * -------------------------------------------------------------------------- 5884 */ 5885 Notifications: function() { 5886 return { 5887 init: function(selector) { 5888 if( __core.getSelector(selector, false, false).length < 1 ){ 5889 return true; 5890 } 5891 5892 __core.isFuncTrue( function() { 5893 return typeof jQuery !== 'undefined' && typeof bootstrap !== "undefined"; 5894 }).then( function(cond) { 5895 if( !cond ) { 5896 return false; 5897 } 5898 5899 __core.initFunction({ class: 'has-plugin-notify', event: 'pluginNotifyReady' }); 5900 5901 selector = __core.getSelector( selector ); 5902 if( selector.length < 1 ){ 5903 return true; 5904 } 5905 5906 var element = selector, 5907 elPosition = element.attr('data-notify-position') || 'top-right', 5908 elType = element.attr('data-notify-type'), 5909 elMsg = element.attr('data-notify-msg') || 'Please set a message!', 5910 elTimeout = element.attr('data-notify-timeout') || 5000, 5911 elClose = element.attr('data-notify-close') || 'true', 5912 elAutoHide = element.attr('data-notify-autohide') || 'true', 5913 elId = 'toast-' + Math.floor( Math.random() * 10000 ), 5914 elTrigger = element.attr('data-notify-trigger') || 'self', 5915 elTarget = element.attr('data-notify-target'), 5916 elCloseHtml = '', 5917 elPosClass, elTypeClass, elCloseClass; 5918 5919 if( jQuery(elTarget).length > 0 && elTrigger == 'self' ) { 5920 var toast = bootstrap.Toast.getOrCreateInstance(jQuery(elTarget).get(0)); 5921 toast.hide(); 5922 5923 jQuery(elTarget).get(0).addEventListener('hidden.bs.toast', function() { 5924 CNVS.Notifications.init( selector ); 5925 }); 5926 } 5927 5928 switch( elType ){ 5929 5930 case 'primary': 5931 elTypeClass = 'text-white bg-primary border-0'; 5932 break; 5933 5934 case 'warning': 5935 elTypeClass = 'text-dark bg-warning border-0'; 5936 break; 5937 5938 case 'error': 5939 elTypeClass = 'text-white bg-danger border-0'; 5940 break; 5941 5942 case 'success': 5943 elTypeClass = 'text-white bg-success border-0'; 5944 break; 5945 5946 case 'info': 5947 elTypeClass = 'bg-info text-dark border-0'; 5948 break; 5949 5950 case 'dark': 5951 elTypeClass = 'text-white bg-dark border-0'; 5952 break; 5953 5954 default: 5955 elTypeClass = ''; 5956 break; 5957 } 5958 5959 switch( elPosition ){ 5960 5961 case 'top-left': 5962 elPosClass = 'top-0 start-0'; 5963 break; 5964 5965 case 'top-center': 5966 elPosClass = 'top-0 start-50 translate-middle-x'; 5967 break; 5968 5969 case 'middle-left': 5970 elPosClass = 'top-50 start-0 translate-middle-y'; 5971 break; 5972 5973 case 'middle-center': 5974 elPosClass = 'top-50 start-50 translate-middle'; 5975 break; 5976 5977 case 'middle-right': 5978 elPosClass = 'top-50 end-0 translate-middle-y'; 5979 break; 5980 5981 case 'bottom-left': 5982 elPosClass = 'bottom-0 start-0'; 5983 break; 5984 5985 case 'bottom-center': 5986 elPosClass = 'bottom-0 start-50 translate-middle-x'; 5987 break; 5988 5989 case 'bottom-right': 5990 elPosClass = 'bottom-0 end-0'; 5991 break; 5992 5993 default: 5994 elPosClass = 'top-0 end-0'; 5995 break; 5996 } 5997 5998 if( elType == 'info' || elType == 'warning' || !elType ) { 5999 elCloseClass = ''; 6000 } else { 6001 elCloseClass = 'btn-close-white'; 6002 } 6003 6004 if( elClose == 'true' ) { 6005 elCloseHtml = '<button type="button" class="btn-close '+ elCloseClass +' btn-sm me-2 mt-2 ms-auto" data-bs-dismiss="toast" aria-label="Close"></button>'; 6006 } 6007 6008 if( elAutoHide != 'true' ) { 6009 elAutoHide = false;
6010 } else { 6011 elAutoHide = true; 6012 } 6013 6014 let elTemplate = '<div class="position-fixed '+ elPosClass +' p-3" style="z-index: 999999;">'+ 6015 '<div id="'+ elId +'" class="toast p-2 hide '+ elTypeClass +'" role="alert" aria-live="assertive" aria-atomic="true">'+ 6016 '<div class="d-flex">'+ 6017 '<div class="toast-body">'+ 6018 elMsg + 6019 '</div>'+ 6020 elCloseHtml + 6021 '</div>'+ 6022 '</div>'; 6023 '</div>'; 6024 6025 if( elTrigger == 'self' ) { 6026 if( !elTarget ) { 6027 element.attr( 'data-notify-target', '#'+elId ); 6028 jQuery('body').append( elTemplate ); 6029 } 6030 } 6031 6032 var toastElList = [].slice.call(document.querySelectorAll('.toast')); 6033 var toastList = toastElList.map( function(toastEl) { 6034 return new bootstrap.Toast(toastEl); 6035 }); 6036 6037 toastList.forEach( function(toast) { 6038 toast.hide(); 6039 }); 6040 6041 var toastElement = element.attr('data-notify-target'), 6042 toastInstance = jQuery(toastElement), 6043 elMsgOld = toastInstance.find('.toast-body'); 6044 6045 if( jQuery(toastElement).length > 0 ) { 6046 var toast = new bootstrap.Toast( toastInstance.get(0) ,{ 6047 delay: Number(elTimeout), 6048 autohide: elAutoHide, 6049 }); 6050 6051 toast.show(); 6052 6053 if( elTrigger == 'self' ) { 6054 toastInstance.get(0).addEventListener('hidden.bs.toast', function() { 6055 toastInstance.parent().remove(); 6056 element.get(0).removeAttribute( 'data-notify-target' ); 6057 }); 6058 } 6059 } 6060 6061 return false; 6062 6063 }); 6064 } 6065 }; 6066 }(), 6067 // Notifications Functions End 6068 6069 /** 6070 * -------------------------------------------------------------------------- 6071 * TextRotator Functions Start 6072 * -------------------------------------------------------------------------- 6073 */ 6074 TextRotator: function() { 6075 return { 6076 init: function(selector) { 6077 if( __core.getSelector(selector, false, false).length < 1 ){ 6078 return true; 6079 } 6080 6081 __core.isFuncTrue( function() { 6082 return typeof jQuery !== 'undefined' && jQuery().Morphext && typeof Typed !== 'undefined'; 6083 }).then( function(cond) { 6084 if( !cond ) { 6085 return false; 6086 } 6087 6088 __core.initFunction({ class: 'has-plugin-textrotator', event: 'pluginTextRotatorReady' }); 6089 6090 selector = __core.getSelector( selector ); 6091 if( selector.length < 1 ){ 6092 return true; 6093 } 6094 6095 selector.each( function(){ 6096 var element = jQuery(this), 6097 elTyped = element.attr('data-typed') || 'false', 6098 elRotator = element.find('.t-rotate'), 6099 elAnimation = element.attr('data-rotate') || 'fade', 6100 elSpeed = element.attr('data-speed') || 1200, 6101 elSep = element.attr('data-separator') || ','; 6102 6103 if( elTyped == 'true' ) { 6104 var elTexts = elRotator.html().split( elSep ), 6105 elLoop = element.attr('data-loop') || 'true', 6106 elShuffle = element.attr('data-shuffle'), 6107 elCur = element.attr('data-cursor') || 'true', 6108 elSpeed = element.attr('data-speed') || 50, 6109 elBackSpeed = element.attr('data-backspeed') || 30, 6110 elBackDelay = element.attr('data-backdelay'); 6111 6112 if( elLoop == 'true' ) { elLoop = true; } else { elLoop = false; } 6113 if( elShuffle == 'true' ) { elShuffle = true; } else { elShuffle = false; } 6114 if( elCur == 'true' ) { elCur = true; } else { elCur = false; } 6115 6116 elRotator.html( '' ).addClass('plugin-typed-init'); 6117 6118 var typed = new Typed( elRotator[0], { 6119 strings: elTexts, 6120 typeSpeed: Number( elSpeed ), 6121 loop: elLoop, 6122 shuffle: elShuffle, 6123 showCursor: elCur, 6124 backSpeed: Number( elBackSpeed ), 6125 backDelay: Number( elBackDelay ) 6126 }); 6127 } else { 6128 var pluginData = elRotator.Morphext({ 6129 animation: elAnimation, 6130 separator: elSep, 6131 speed: Number(elSpeed) 6132 }); 6133 } 6134 }); 6135 }); 6136 } 6137 }; 6138 }(), 6139 // TextRotator Functions End 6140 6141 /** 6142 * -------------------------------------------------------------------------- 6143 * OnePage Functions Start 6144 * -------------------------------------------------------------------------- 6145 */ 6146 OnePage: function() { 6147 var _init = function(selector) { 6148 _hash(); 6149 6150 if( __core.getVars.elLinkScrolls ) {
6151 __core.getVars.elLinkScrolls.forEach( function(el) { 6152 _getSettings( el, 'scrollTo' ); 6153 6154 el.onclick = function(e) { 6155 e.preventDefault(); 6156 6157 _scroller( el, 'scrollTo', true ); 6158 }; 6159 }); 6160 } 6161 6162 if( __core.getVars.elOnePageMenus ) { 6163 __core.getVars.elOnePageMenus.forEach( function(onePageMenu) { 6164 __core.getVars.elOnePageActiveClass = onePageMenu.getAttribute('data-active-class') || 'current'; 6165 __core.getVars.elOnePageParentSelector = onePageMenu.getAttribute('data-parent') || 'li'; 6166 __core.getVars.elOnePageActiveOnClick = onePageMenu.getAttribute('data-onclick-active') || 'false'; 6167 6168 onePageMenu.querySelectorAll('[data-href]').forEach( function(el) { 6169 _getSettings( el, 'onePage' ); 6170 6171 el.onclick = function(e) { 6172 e.preventDefault(); 6173 6174 _scroller( el, 'onePage', true ); 6175 }; 6176 }); 6177 }); 6178 } 6179 }; 6180 6181 var _hash = function() { 6182 if( __core.getOptions.scrollExternalLinks != true ) { 6183 return false; 6184 } 6185 6186 if( document.querySelector('a[data-href="'+ __core.getVars.hash +'"]') || document.querySelector('a[data-scrollto="'+ __core.getVars.hash +'"]') ) { 6187 window.onbeforeunload = function() { 6188 __core.scrollTo(0, 0, false, 'auto'); 6189 }; 6190 6191 __core.scrollTo(0, 0, false, 'auto'); 6192 6193 var section = document.querySelector(__core.getVars.hash); 6194 6195 if( section ) { 6196 var int = setInterval( function() { 6197 var settings = section.getAttribute('data-onepage-settings') && JSON.parse( section.getAttribute('data-onepage-settings') ); 6198 6199 if( settings ) { 6200 _scroll(section, settings, 0); 6201 clearInterval(int); 6202 } 6203 }, 250); 6204 } 6205 } 6206 }; 6207 6208 var _getSection = function(el, type) { 6209 var anchor; 6210 6211 if( type == 'scrollTo' ) { 6212 anchor = el.getAttribute('data-scrollto'); 6213 } else { 6214 anchor = el.getAttribute('data-href'); 6215 } 6216 6217 var section = document.querySelector( anchor ); 6218 6219 return section; 6220 }; 6221 6222 var _getSettings = function(el, type) { 6223 var section = _getSection(el, type); 6224 6225 if( !section ) { 6226 return false; 6227 } 6228 6229 section.removeAttribute('data-onepage-settings'); 6230 6231 var settings = _settings( section, el ); 6232 6233 setTimeout( function() { 6234 if( !section.hasAttribute('data-onepage-settings') ) { 6235 section.setAttribute( 'data-onepage-settings', JSON.stringify( settings ) ); 6236 } 6237 6238 __core.getVars.pageSectionEls = document.querySelectorAll('[data-onepage-settings]'); 6239 }, 1000); 6240 }; 6241 6242 var _scroller = function(el, type, clicker = false) { 6243 var section = _getSection(el, type), 6244 sectionId = section.getAttribute('id'), 6245 settings; 6246 6247 if( !section ) { 6248 return false; 6249 } 6250 6251 if( clicker == true ) { 6252 settings = _settings(section, el, false); 6253 } else { 6254 settings = JSON.parse(section.getAttribute('data-onepage-settings')); 6255 } 6256 6257 if( type != 'scrollTo' && __core.getVars.elOnePageActiveOnClick == 'true' ) { 6258 parent = el.closest('.one-page-menu'); 6259 6260 parent.querySelectorAll(__core.getVars.elOnePageParentSelector).forEach( function(el) { 6261 el.classList.remove( __core.getVars.elOnePageActiveClass ); 6262 }); 6263 6264 parent.querySelector('a[data-href="#' + sectionId + '"]').closest(__core.getVars.elOnePageParentSelector).classList.add( __core.getVars.elOnePageActiveClass ); 6265 } 6266 6267 if( !__core.getVars.elBody.classList.contains('is-expanded-menu') || __core.getVars.elBody.classList.contains('overlay-menu') ) { 6268 __core.getVars.recalls.menureset(); 6269 } 6270 6271 _scroll(section, settings, 250); 6272 }; 6273 6274 var _scroll = function(section, settings, timeout) { 6275 setTimeout( function() { 6276 var sectionOffset = __core.offset(section).top; 6277 6278 if( !settings ) { 6279 return false; 6280 } 6281 6282 __core.scrollTo((sectionOffset - Number(settings.offset)), settings.speed, settings.easing); 6283 }, Number(timeout)); 6284 }; 6285 6286 var _position = function() { 6287 __core.getVars.elOnePageMenus && __core.getVars.elOnePageMenus.forEach( function(el) { 6288 el.querySelectorAll('[data-href]').forEach( function(item) { 6289 item.closest(__core.getVars.elOnePageParentSelector).classList.remove( __core.getVars.elOnePageActiveClass ); 6290 }); 6291 }); 6292 6293 __core.getVars.elOnePageMenus && __core.getVars.elOnePageMenus.forEac
6293h( function(el) { 6294 el.querySelector('[data-href="#' + _current() + '"]')?.closest(__core.getVars.elOnePageParentSelector).classList.add( __core.getVars.elOnePageActiveClass ); 6295 }); 6296 }; 6297 6298 var _current = function() { 6299 var currentOnePageSection; 6300 6301 if( typeof __core.getVars.pageSectionEls === 'undefined' ) { 6302 return true; 6303 } 6304 6305 __core.getVars.pageSectionEls.forEach( function(el) { 6306 var settings = el.getAttribute('data-onepage-settings') && JSON.parse( el.getAttribute('data-onepage-settings') ); 6307 6308 if( settings ) { 6309 var h = __core.offset(el).top - settings.offset - 5, 6310 y = window.scrollY; 6311 6312 if( ( y >= h ) && ( y < h + el.offsetHeight ) && el.getAttribute('id') != currentOnePageSection && el.getAttribute('id') ) { 6313 currentOnePageSection = el.getAttribute('id'); 6314 } 6315 } 6316 }); 6317 6318 return currentOnePageSection; 6319 }; 6320 6321 var _settings = function(section, element, json=true) { 6322 var body = __core.getVars.elBody.classList; 6323 6324 if( typeof section === 'undefined' || element.length < 1 ) { 6325 return true; 6326 } 6327 6328 if( section.hasAttribute('data-onepage-settings') && json ) { 6329 return true; 6330 } 6331 6332 var defaults = { 6333 offset: __core.getVars.topScrollOffset, 6334 speed: 1250, 6335 easing: false 6336 }; 6337 6338 var settings = {}, 6339 parentSettings = {}, 6340 parent = element.closest( '.one-page-menu' ); 6341 6342 parentSettings.offset = parent?.getAttribute( 'data-offset' ) || defaults.offset; 6343 parentSettings.speed = parent?.getAttribute( 'data-speed' ) || defaults.speed; 6344 parentSettings.easing = parent?.getAttribute( 'data-easing' ) || defaults.easing; 6345 6346 var elementSettings = { 6347 offset: element.getAttribute( 'data-offset' ) || parentSettings.offset, 6348 speed: element.getAttribute( 'data-speed' ) || parentSettings.speed, 6349 easing: element.getAttribute( 'data-easing' ) || parentSettings.easing, 6350 }; 6351 6352 var elOffsetXXL = element.getAttribute( 'data-offset-xxl' ), 6353 elOffsetXL = element.getAttribute( 'data-offset-xl' ), 6354 elOffsetLG = element.getAttribute( 'data-offset-lg' ), 6355 elOffsetMD = element.getAttribute( 'data-offset-md' ), 6356 elOffsetSM = element.getAttribute( 'data-offset-sm' ), 6357 elOffsetXS = element.getAttribute( 'data-offset-xs' ); 6358 6359 if( !elOffsetXS ) { 6360 elOffsetXS = Number(elementSettings.offset); 6361 } 6362 6363 if( !elOffsetSM ) { 6364 elOffsetSM = Number(elOffsetXS); 6365 } 6366 6367 if( !elOffsetMD ) { 6368 elOffsetMD = Number(elOffsetSM); 6369 } 6370 6371 if( !elOffsetLG ) { 6372 elOffsetLG = Number(elOffsetMD); 6373 } 6374 6375 if( !elOffsetXL ) { 6376 elOffsetXL = Number(elOffsetLG); 6377 } 6378 6379 if( !elOffsetXXL ) { 6380 elOffsetXXL = Number(elOffsetXL); 6381 } 6382 6383 if( body.contains('device-xs') ) { 6384 elementSettings.offset = elOffsetXS; 6385 } else if( body.contains('device-sm') ) { 6386 elementSettings.offset = elOffsetSM; 6387 } else if( body.contains('device-md') ) { 6388 elementSettings.offset = elOffsetMD; 6389 } else if( body.contains('device-lg') ) { 6390 elementSettings.offset = elOffsetLG; 6391 } else if( body.contains('device-xl') ) { 6392 elementSettings.offset = elOffsetXL; 6393 } else if( body.contains('device-xxl') ) { 6394 elementSettings.offset = elOffsetXXL; 6395 } 6396 6397 settings.offset = Number(elementSettings.offset); 6398 settings.speed = Number(elementSettings.speed); 6399 settings.easing = elementSettings.easing; 6400 6401 return settings; 6402 }; 6403 6404 return { 6405 init: function(selector) { 6406 if( __core.getSelector(selector, false, false).length < 1 ){ 6407 return true; 6408 } 6409 6410 __core.initFunction({ class: 'has-plugin-onepage', event: 'pluginOnePageReady' }); 6411 6412 selector = __core.getSelector( selector, false ); 6413 if( selector.length < 1 ){ 6414 return true; 6415 } 6416 6417 var scrollToLinks = __core.filtered( selector, '[data-scrollto]' ), 6418 onePageLinks = __core.filtered( selector, '.one-page-menu' ); 6419 6420 if( scrollToLinks.length > 0 ) { 6421 __core.getVars.elLinkScrolls = scrollToLinks; 6422 } 6423 6424 if( onePageLinks.length > 0 ) { 6425 __core.getVars.elOnePageMenus = onePageLinks; 6426 } 6427 6428 _init(selector); 6429 _position(); 6430 6431 window.addEventListener('scroll', function(){ 6432 _position(); 6433 }, {passive:true}); 6434 6435 __core.getVars.resizers.onepage = function() { 6436 _init(selector); 6437 _position(); 6438 }; 6439 } 6440 }; 6441 }(), 6442 // OnePage Functions End 6443 6444 /** 6445 * -------------------------------------------------------------------------- 6446 * AjaxForm Functions Start 6447 * -------------------------------------------------------------------------- 6448 */ 6449 AjaxForm: function() { 6450 return { 6451 init: function(selector) { 6452 if( __core.getSelector(selector, false, false).length < 1 ){ 6453 return true; 6454 } 6455 6456 __core.isFuncTrue( function() {
6457 return typeof jQuery !== 'undefined' && jQuery().validate && jQuery().ajaxSubmit; 6458 }).then( function(cond) { 6459 if( !cond ) { 6460 return false; 6461 } 6462 6463 __core.initFunction({ class: 'has-plugin-form', event: 'pluginFormReady' }); 6464 6465 selector = __core.getSelector( selector ); 6466 if( selector.length < 1 ){ 6467 return true; 6468 } 6469 6470 selector.each( function(){ 6471 var element = jQuery(this), 6472 $body = jQuery('body'), 6473 elForm = element.find('form'), 6474 elFormId = elForm.attr('id'), 6475 elAlert = element.attr('data-alert-type'), 6476 elLoader = element.attr('data-loader'), 6477 elResult = element.find('.form-result'), 6478 elRedirect = element.attr('data-redirect'), 6479 defaultBtn, alertType; 6480 6481 if( !elAlert ) { 6482 elAlert = 'notify'; 6483 } 6484 6485 if( elFormId ) { 6486 $body.addClass( elFormId + '-ready' ); 6487 } 6488 6489 element.find('form').validate({ 6490 errorPlacement: function(error, elementItem) { 6491 if( elementItem.parents('.form-group').length > 0 ) { 6492 error.appendTo( elementItem.parents('.form-group') ); 6493 } else { 6494 error.insertAfter( elementItem ); 6495 } 6496 }, 6497 focusCleanup: true, 6498 submitHandler: function(form) { 6499 if( element.hasClass( 'custom-submit' ) ) { 6500 jQuery(form).submit(); 6501 return true; 6502 } 6503 6504 elResult.hide(); 6505 6506 if( elLoader == 'button' ) { 6507 defaultBtn = jQuery(form).find('button'); 6508 defaultBtnText = defaultBtn.html(); 6509 6510 defaultBtn.html('<i class="bi-arrow-repeat icon-spin m-0"></i>'); 6511 } else { 6512 jQuery(form).find('.form-process').fadeIn(); 6513 } 6514 6515 if( elFormId ) { 6516 $body.removeClass( elFormId + '-ready ' + elFormId + '-complete ' + elFormId + '-success ' + elFormId + '-error' ).addClass( elFormId + '-processing' ); 6517 } 6518 6519 jQuery(form).ajaxSubmit({ 6520 target: elResult, 6521 dataType: 'json', 6522 success: function(data) { 6523 if( elLoader == 'button' ) { 6524 defaultBtn.html( defaultBtnText ); 6525 } else { 6526 jQuery(form).find('.form-process').fadeOut(); 6527 } 6528 6529 if( data.alert != 'error' && elRedirect ){ 6530 window.location.replace( elRedirect ); 6531 return true; 6532 } 6533 6534 if( elAlert == 'inline' ) { 6535 if( data.alert == 'error' ) { 6536 alertType = 'alert-danger'; 6537 } else { 6538 alertType = 'alert-success'; 6539 } 6540 6541 elResult.removeClass( 'alert-danger alert-success' ).addClass( 'alert ' + alertType ).html( data.message ).slideDown( 400 ); 6542 } else if( elAlert == 'notify' ) { 6543 elResult.attr( 'data-notify-type', data.alert ).attr( 'data-notify-msg', data.message ).html(''); 6544 __modules.notifications(elResult); 6545 } 6546 6547 if( data.alert != 'error' ) { 6548 jQuery(form).resetForm(); 6549 jQuery(form).find('.btn-group > .btn').removeClass('active'); 6550 6551 if( (typeof tinyMCE != 'undefined') && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden() ){ 6552 tinymce.activeEditor.setContent(''); 6553 } 6554 6555 var rangeSlider = jQuery(form).find('.input-range-slider'); 6556 if( rangeSlider.length > 0 ) { 6557 rangeSlider.each( function(){ 6558 var range = jQuery(this).data('ionRangeSlider'); 6559 range.reset(); 6560 }); 6561 } 6562 6563 var ratings = jQuery(form).find('.input-rating'); 6564 if( ratings.length > 0 ) { 6565 ratings.each( function(){ 6566 jQuery(this).rating('reset'); 6567 }); 6568 } 6569 6570 var selectPicker = jQuery(form).find('.selectpicker'); 6571 if( selectPicker.length > 0 ) { 6572 selectPicker.each( function(){ 6573 jQuery(this).selectpicker('val', ''); 6574 jQuery(this).selectpicker('deselectAll'); 6575 }); 6576 } 6577 6578 jQuery(form).find('.input-select2,select[data-selectsplitter-firstselect-selector]').change(); 6579 6580 jQuery(form).trigger( 'formSubmitSuccess', data ); 6581 $body.removeClass( elFormId + '-error' ).addClass( elFormId + '-success' ); 6582 } else { 6583 jQuery(form).trigger( 'formSubmitError', data ); 6584 $body.removeClass( elFormId + '-success' ).addClass( elFormId + '-error' ); 6585 } 6586 6587 if( elFormId ) { 6588 $body.removeClass( elFormId + '-processing' ).addClass( elFormId + '-complete' ); 6589 } 6590 6591 if( jQuery(form).find('.g-recaptcha').children('div').length > 0 ) { 6592 grecaptcha.reset(); 6593 } 6594 } 6595 }); 6596 } 6597 }); 6598 6599 }); 6600 }); 6601 } 6602 }; 6603 }(), 6604 // AjaxForm Functions End 6605 6606 /** 6607 * -------------------------------------------------------------------------- 6608 * Subscribe Functions Start 6609 * -------------------------------------------------------------------------- 6610 */ 6611 Subscribe: function() { 6612 return { 6613 init: function(selector) { 6614 if( __core.getSelector(selector, false, false).length < 1 ){ 6615 return true; 6616 } 6617 6618 __core.isFuncTrue( function() {
6619 return typeof jQuery !== 'undefined' && jQuery().validate && jQuery().ajaxSubmit; 6620 }).then( function(cond) { 6621 if( !cond ) { 6622 return false; 6623 } 6624 6625 __core.initFunction({ class: 'has-plugin-form', event: 'pluginFormReady' }); 6626 6627 selector = __core.getSelector( selector ); 6628 if( selector.length < 1 ){ 6629 return true; 6630 } 6631 6632 selector.each( function(){ 6633 var element = jQuery(this), 6634 elAlert = element.attr('data-alert-type'), 6635 elLoader = element.attr('data-loader'), 6636 elResult = element.find('.widget-subscribe-form-result'), 6637 elRedirect = element.attr('data-redirect'), 6638 defButton, defButtonText, alertType; 6639 6640 element.find('form').validate({ 6641 submitHandler: function(form) { 6642 6643 elResult.hide(); 6644 6645 if( elLoader == 'button' ) { 6646 defButton = jQuery(form).find('button'); 6647 defButtonText = defButton.html(); 6648 6649 defButton.html('<i class="bi-arrow-repeat icon-spin nomargin"></i>'); 6650 } else { 6651 jQuery(form).find('.bi-envelope-plus').removeClass('bi-envelope-plus').addClass('bi-arrow-repeat icon-spin'); 6652 } 6653 6654 jQuery(form).ajaxSubmit({ 6655 target: elResult, 6656 dataType: 'json', 6657 resetForm: true, 6658 success: function(data) { 6659 if( elLoader == 'button' ) { 6660 defButton.html( defButtonText ); 6661 } else { 6662 jQuery(form).find('.bi-arrow-repeat').removeClass('bi-arrow-repeat icon-spin').addClass('bi-envelope-plus'); 6663 } 6664 if( data.alert != 'error' && elRedirect ){ 6665 window.location.replace( elRedirect ); 6666 return true; 6667 } 6668 if( elAlert == 'inline' ) { 6669 if( data.alert == 'error' ) { 6670 alertType = 'alert-danger'; 6671 } else { 6672 alertType = 'alert-success'; 6673 } 6674 6675 elResult.addClass( 'alert ' + alertType ).html( data.message ).slideDown( 400 ); 6676 } else { 6677 elResult.attr( 'data-notify-type', data.alert ).attr( 'data-notify-msg', data.message ).html(''); 6678 __modules.notifications(elResult); 6679 } 6680 } 6681 }); 6682 } 6683 }); 6684 6685 }); 6686 }); 6687 } 6688 }; 6689 }(), 6690 // Subscribe Functions End 6691 6692 /** 6693 * -------------------------------------------------------------------------- 6694 * Conditional Functions Start 6695 * -------------------------------------------------------------------------- 6696 */ 6697 Conditional: function() { 6698 var _eval = function(field, value, conditions, check, target) { 6699 if( ! field || ! conditions ) { 6700 return false; 6701 } 6702 6703 var fulfilled = false; 6704 6705 if( check == 'validate' ) { 6706 if( value ) { 6707 if ( target.getAttribute('aria-invalid') == 'false' ) { 6708 fulfilled = true; 6709 } else { 6710 fulfilled = false; 6711 } 6712 } 6713 } else { 6714 switch( conditions.operator ) { 6715 case '==': 6716 if( value == conditions.value ) { 6717 fulfilled = true; 6718 } 6719 break; 6720 6721 case '!=': 6722 if( value != conditions.value ) { 6723 fulfilled = true; 6724 } 6725 break; 6726 6727 case '>': 6728 if( value > conditions.value ) { 6729 fulfilled = true; 6730 } 6731 break; 6732 6733 case '<': 6734 if( value < conditions.value ) { 6735 fulfilled = true; 6736 } 6737 break; 6738 6739 case '<=': 6740 if( value <= conditions.value ) { 6741 fulfilled = true; 6742 } 6743 break; 6744 6745 case '>=': 6746 if( value >= conditions.value ) { 6747 fulfilled = true; 6748 } 6749 break; 6750 6751 case 'in': 6752 if( conditions.value.includes( value ) ) { 6753 fulfilled = true; 6754 } 6755 break; 6756 6757 default: 6758 fulfilled = false; 6759 break; 6760 } 6761 } 6762 6763 if( fulfilled ) { 6764 field.classList.add('condition-fulfilled'); 6765 field.querySelectorAll('input,select,textarea,button').forEach( function(el) { 6766 el.disabled = false; 6767 }); 6768 } else { 6769 field.classList.remove('condition-fulfilled'); 6770 field.querySelectorAll('input,select,textarea,button').forEach( function(el) { 6771 el.disabled = true; 6772 }); 6773 } 6774 }; 6775 6776 return { 6777 init: function(selector) { 6778 if( __core.getSelector(selector, false, false).length < 1 ){ 6779 return true; 6780 } 6781 6782 __core.initFunction({ class: 'has-plugin-conditional', event: 'pluginConditionalReady' }); 6783 6784 selector = __core.getSelector( selector, false ); 6785 if( selector.length < 1 ){ 6786 return true; 6787 } 6788 6789 selector.forEach( function(el) { 6790 var field = el, 6791 condition = field.getAttribute( 'data-condition' ) || '==', 6792 conditionTarget = field.getAttribute( 'data-condition-target' ), 6793 conditionValue = field.getAttribute( 'data-condition-value' ), 6794 conditionCheck = field.getAttribute( 'data-condition-check' ) || 'value', 6795 target = document.querySelector('[id*="'+conditionTarget+'"]'), 6796 value = target.value, 6797 targetType = target.type, 6798 eventType; 6799 6800 var conditions = { 6801 operator: condition, 6802 field: conditionTarget, 6803 value: conditionValue 6804 } 6805 6806 var targetTag = target.tagName.toLowerCase(); 6807 6808 if( targetType == 'checkbox' || targetTag == 'select' || targetType == 'radio' ) { 6809 eventType = 'change'; 6810 } else { 6811 eventType = 'input'; 6812 } 6813 6814 if( targetType == 'checkbox' ) { 6815 value = target.checked ? target.value : 0; 6816 } 6817 6818 if( targetType == 'radio' ) { 6819 value = target.checked ? target.value : ''; 6820 } 6821 6822 _eval(field, value, conditions, conditionCheck, target); 6823 6824 target.addEventListener( eventType, function() { 6825 if( targetType == 'checkbox' ) { 6826 value = target.checked ? target.value : 0; 6827 } else if( targetType == 'radio' ) { 6828 value = target.checked ? target.value : ''; 6829 } else { 6830 value = target.value; 6831 } 6832 6833 _eval(field, value, conditions, conditionCheck, target); 6834 }); 6835 6836 if( conditionCheck == 'validate' ) { 6837 var mutationObserver = new MutationObserver( function(mutations) { 6838 mutations.forEach( function(mutation) { 6839 _eval(field, value, conditions, conditionCheck, target); 6840 }); 6841 }); 6842 6843 mutationObserver.observe( target, { 6844 attributes: true, 6845 characterData: true, 6846 childList: true, 6847 subtree: true, 6848 attributeOldValue: true, 6849 characterDataOldValue: true 6850 }); 6851 } 6852 }); 6853 } 6854 }; 6855 }(), 6856 // Conditional Functions End 6857 6858 /** 6859 * -------------------------------------------------------------------------- 6860 * ShapeDivider Functions Start 6861 * -------------------------------------------------------------------------- 6862 */ 6863 ShapeDivider: function() { 6864 return { 6865 init: function(selector) { 6866 if( __core.getSelector(selector, false, false).length < 1 ){ 6867 return true; 6868 } 6869 6870 __core.initFunction({ class: 'has-plugin-shapedivider', event: 'pluginShapeDividerReady' }); 6871 6872 selector = __core.getSelector( selector, false ); 6873 if( selector.length < 1 ){ 6874 return true; 6875 } 6876 6877 selector.forEach( function(element) { 6878 var elShape = element.getAttribute('data-shape') || 'valley', 6879 elWidth = element.getAttribute('data-width') || 100, 6880 elHeight = element.getAttribute('data-height') || 100, 6881 elFill = element.getAttribute('data-fill'), 6882 elOut = element.getAttribute('data-outside') || 'false', 6883 elPos = element.getAttribute('data-position') || 'top',
6884 elId = 'shape-divider-' + Math.floor( Math.random() * 10000 ), 6885 shape = '', 6886 width, height, fill, 6887 outside = ''; 6888 6889 if( element.classList.contains('shape-divider-complete') ) { 6890 return true; 6891 } 6892 6893 if( elWidth < 100 ) { 6894 elWidth = 100; 6895 } 6896 6897 width = 'width: calc( '+ Number( elWidth ) +'% + 1.5px );'; 6898 height = 'height: '+ Number( elHeight ) +'px;'; 6899 fill = 'fill: '+elFill+';'; 6900 6901 if( elOut == 'true' ) { 6902 if( elPos == 'bottom' ) { 6903 outside = '#'+ elId +'.shape-divider { bottom: -'+( Number( elHeight ) - 1 ) +'px; } '; 6904 } else { 6905 outside = '#'+ elId +'.shape-divider { top: -'+( Number( elHeight ) - 1 ) +'px; } '; 6906 } 6907 } 6908 6909 var css = outside + '#'+ elId +'.shape-divider svg { '+ width + height +' } #'+ elId +'.shape-divider .shape-divider-fill { '+ fill +' }', 6910 style = document.createElement('style'); 6911 6912 __core.getVars.elHead.appendChild(style); 6913 6914 style.appendChild(document.createTextNode(css)); 6915 6916 element.setAttribute( 'id', elId ); 6917 6918 switch(elShape){ 6919 case 'valley': 6920 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 355" preserveAspectRatio="none"><defs><style>.b{opacity:.5}.c{opacity:.3}</style></defs><path fill="none" d="M999.45 0H0v165.72l379.95 132.46L999.45 0z"></path><path class="b shape-divider-fill" d="M379.95 298.18l28.47 9.92L1000 118.75V0h-.55l-619.5 298.18zM492.04 337.25L1000 252.63V118.75L408.42 308.1l83.62 29.15z"></path><path class="b shape-divider-fill" d="M492.04 337.25L1000 252.63V118.75L408.42 308.1l83.62 29.15z"></path><path class="shape-divider-fill" d="M530.01 350.49l20.22 4.51H1000V252.63l-507.96 84.62 37.97 13.24z"></path><path class="b shape-divider-fill" d="M530.01 350.49l20.22 4.51H1000V252.63l-507.96 84.62 37.97 13.24z"></path><path class="b shape-divider-fill" d="M530.01 350.49l20.22 4.51H1000V252.63l-507.96 84.62 37.97 13.24z"></path><path class="shape-divider-fill" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"></path><path class="b shape-divider-fill" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"></path><path class="c shape-divider-fill" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"></path><path class="b shape-divider-fill" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"></path><path class="c shape-divider-fill" d="M379.95 298.18L0 165.72v66.59l353.18 78.75 26.77-12.88z"></path><path class="c shape-divider-fill" d="M353.18 311.06L0 232.31v71.86l288.42 38.06 64.76-31.17z"></path><path class="c shape-divider-fill" d="M353.18 311.06L0 232.31v71.86l288.42 38.06 64.76-31.17z"></path><path class="b shape-divider-fill" d="M380.28 317.11l28.14-9.01-28.47-9.92-26.77 12.88 27.1 6.05z"></path><path class="c shape-divider-fill" d="M380.28 317.11l28.14-9.01-28.47-9.92-26.77 12.88 27.1 6.05z"></path><path class="b shape-divider-fill" d="M479.79 339.29l12.25-2.04-83.62-29.15-28.14 9.01 99.51 22.18z"></path><path class="b shape-divider-fill" d="M479.79 339.29l12.25-2.04-83.62-29.15-28.14 9.01 99.51 22.18z"></path><path class="c shape-divider-fill" d="M479.79 339.29l12.25-2.04-83.62-29.15-28.14 9.01 99.51 22.18z"></path><path class="shape-divider-fill" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2z"></path><path class="b shape-divider-fill" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2z"></path><path class="b shape-divider-fill" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2z"></path><path class="c shape-divider-fill" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2zM288.42 342.23l9.46 1.25 82.4-26.37-27.1-6.05-64.76 31.17z"></path><path class="b shape-divider-fill" d="M288.42 342.23l9.46 1.25 82.4-26.37-27.1-6.05-64.76 31.17z"></path><path class="c shape-divider-fill" d="M288.42 342.23l9.46 1.25 82.4-26.37-27.1-6.05-64.76 31.17z"></path><path class="b shape-divider-fill" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"></path><path class="c shape-divider-fill" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"></path><path class="b shape-divider-fill" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"></path><path class="c shape-divider-fill" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"></path><path class="shape-divider-fill" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"></path><path class="b shape-divider-fill" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"></path><path class="c shape-divider-fill" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"></path><path class="b shape-divider-fill" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"></path><path class="c shape-divider-fill" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"></path><path class="shape-divider-fill" d="M288.42 342.23L0 304.17V355h385.18l-87.3-11.52-9.46-1.25z"></path></svg>'; 6921 break; 6922 6923 case 'valley-2': 6924 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M194,99c186.7,0.7,305-78.3,306-97.2c1,18.9,119.3,97.9,306,97.2c114.3-0.3,194,0.3,194,0.3s0-91.7,0-100c0,0,0,0,0-0 L0,0v99.3C0,99.3,79.7,98.7,194,99z"></path></svg>'; 6925 break; 6926 6927 case 'valley-3': 6928 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M1280 0L640 70 0 0v140l640-70 640 70V0z" opacity="0.5"></path><path class="shape-divider-fill" d="M1280 0H0l640 70 640-70z"></path></svg>'; 6929 break; 6930 6931 case 'mountain': 6932 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M500,98.9L0,6.1V0h1000v6.1L500,98.9z"></path></svg>'; 6933 break; 6934 6935 case 'mountain-2': 6936 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M640 140L1280 0H0z" opacity="0.5"/><path class="shape-divider-fill" d="M640 98l640-98H0z"/></svg>'; 6937 break; 6938 6939 case 'mountain-3': 6940 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 491.58" preserveAspectRatio="none"><g style="isolation:isolate"><path class="shape-divider-fill" d="M1000 479.4v-87.96L500 0 0 391.46v87.96l500-335.94 500 335.92z" opacity="0.12" mix-blend-mode="overlay"/><path class="shape-divider-fill" d="M1000 487.31v-7.91L500 143.48 0 479.42v7.91l500-297.96 500 297.94z" op
6940acity="0.25" mix-blend-mode="overlay"/><path class="shape-divider-fill" d="M1000 487.31L500 189.37 0 487.33v4.25h1000v-4.27z"/></g></svg>'; 6941 break; 6942 6943 case 'mountain-4': 6944 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M738,99l262-93V0H0v5.6L738,99z"></path></svg>'; 6945 break; 6946 6947 case 'mountain-5': 6948 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M978.81 122.25L0 0h1280l-262.1 116.26a73.29 73.29 0 0 1-39.09 5.99z" opacity="0.5"></path><path class="shape-divider-fill" d="M983.19 95.23L0 0h1280l-266 91.52a72.58 72.58 0 0 1-30.81 3.71z"></path></svg>'; 6949 break; 6950 6951 case 'mountains': 6952 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" opacity="0.33" d="M473,67.3c-203.9,88.3-263.1-34-320.3,0C66,119.1,0,59.7,0,59.7V0h1000v59.7 c0,0-62.1,26.1-94.9,29.3c-32.8,3.3-62.8-12.3-75.8-22.1C806,49.6,745.3,8.7,694.9,4.7S492.4,59,473,67.3z"></path><path class="shape-divider-fill" opacity="0.66" d="M734,67.3c-45.5,0-77.2-23.2-129.1-39.1c-28.6-8.7-150.3-10.1-254,39.1 s-91.7-34.4-149.2,0C115.7,118.3,0,39.8,0,39.8V0h1000v36.5c0,0-28.2-18.5-92.1-18.5C810.2,18.1,775.7,67.3,734,67.3z"></path><path class="shape-divider-fill" d="M766.1,28.9c-200-57.5-266,65.5-395.1,19.5C242,1.8,242,5.4,184.8,20.6C128,35.8,132.3,44.9,89.9,52.5C28.6,63.7,0,0,0,0 h1000c0,0-9.9,40.9-83.6,48.1S829.6,47,766.1,28.9z"></path></svg>'; 6953 break; 6954 6955 case 'mountains-2': 6956 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 247" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 200.92v.26l.75-.77-.75.51z"></path><path class="shape-divider-fill" d="M279.29 208.39c0-4.49 74.71-29.88 74.71-29.88l61.71 61.26L550 153.1l134.14 88.17L874.28 50 1000 178.51v-.33L874.28 0 684.14 191.27 550 103.1l-134.29 86.67L354 128.51s-74.71 25.39-74.71 29.88S144.23 52.08 144.23 52.08L.75 200.41l143.48-98.33s135.06 110.8 135.06 106.31z" opacity="0.25" isolation="isolate"></path><path class="shape-divider-fill" d="M1000 178.51L874.28 50 684.14 241.27 550 153.1l-134.29 86.67L354 178.51s-74.71 25.39-74.71 29.88-135.06-106.31-135.06-106.31L.75 200.41l-.75.77V247h1000z"></path><path class="shape-divider-fill" d="M1000 178.51L874.28 50 684.14 241.27 550 153.1l-134.29 86.67L354 178.51s-74.71 25.39-74.71 29.88-135.06-106.31-135.06-106.31L.75 200.41l-.75.77V247h1000z" opacity="0.25" isolation="isolate"></path></svg>'; 6957 break; 6958 6959 case 'mountains-3': 6960 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M761.9,44.1L643.1,27.2L333.8,98L0,3.8V0l1000,0v3.9"></path></svg>'; 6961 break; 6962 6963 case 'mountains-4': 6964 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 90.72l140-28.28 315.52 24.14L796.48 65.8 1140 104.89l140-14.17V0H0v90.72z" opacity="0.5"></path><path class="shape-divider-fill" d="M0 0v47.44L170 0l626.48 94.89L1110 87.11l170-39.67V0H0z"></path></svg>'; 6965 break; 6966 6967 case 'plataeu': 6968 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M1280 0l-131.81 111.68c-16.47 14-35.47 21-54.71 20.17L173 94a76.85 76.85 0 0 1-36.79-11.46L0 0z"></path></svg>'; 6969 break; 6970 6971 case 'plataeu-2': 6972 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M1093.48 131.85L173 94a76.85 76.85 0 0 1-36.79-11.46L0 0h1280l-131.81 111.68c-16.47 13.96-35.47 20.96-54.71 20.17z" opacity="0.5"></path><path class="shape-divider-fill" d="M1094.44 119L172.7 68.72a74.54 74.54 0 0 1-25.19-5.95L0 0h1280l-133.85 102c-15.84 12.09-33.7 17.95-51.71 17z"></path></svg>'; 6973 break; 6974 6975 case 'hills': 6976 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M156.258 127.903l86.363-18.654 78.684
697613.079L411.441 99.4l94.454 10.303L582.82 93.8l82.664 18.728 76.961-11.39L816.109 71.4l97.602 9.849L997.383 50.4l66.285 14.694 70.793-24.494h79.863L1280 0H0v122.138l60.613 9.965z"/></svg>'; 6977 break; 6978 6979 case 'hills-2': 6980 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M1214.323 66.051h-79.863l-70.793 18.224-66.285-10.933-83.672 22.953-97.601-7.328-73.664 22.125-76.961 8.475-82.664-13.934-76.926 11.832-94.453-7.666-90.137 17.059-78.684-9.731-86.363 13.879-95.644 3.125L0 126.717V0h1280l-.001 35.844z" opacity="0.5"></path><path class="shape-divider-fill" d="M0 0h1280v.006l-70.676 36.578-74.863 4.641-70.793 23.334-66.285-11.678-83.672 29.618-97.602-7.07-63.664 21.421-76.961 12.649-91.664-20.798-77.926 17.66-94.453-7.574-90.137 21.595-78.683-9.884-86.363 16.074-95.645 6.211L0 127.905z"></path></svg>'; 6981 break; 6982 6983 case 'hills-3': 6984 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M156 35.51l95.46 34.84 120.04.24 71.5 33.35 90.09-3.91L640 137.65l102.39-37.17 85.55 10.65 88.11-7.19L992 65.28l73.21 5.31 66.79-22.1 77-.42L1280 0H0l64.8 38.69 91.2-3.18z"/>
6984</svg>'; 6985 break; 6986 6987 case 'hills-4': 6988 shape = '<svg viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M156 35.41l95.46 34.73 120.04.25 71.5 33.24 90.09-3.89L640 137.25l102.39-37.06 85.55 10.61 88.11-7.17L992 65.08l73.21 5.31L1132 48.35l77-.42L1280 0H0l64.8 38.57 91.2-3.16z" opacity="0.5"/><path class="shape-divider-fill" d="M156 28.32l95.46 27.79 120.04.2L443 82.9l90.09-3.11L640 109.8l102.39-29.65 85.55 8.49 88.11-5.74L992 52.07l73.21 4.24L1132 38.68l77-.34L1280 0H0l64.8 30.86 91.2-2.54z"/></svg>'; 6989 break; 6990 6991 case 'cloud': 6992 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 27.8" preserveAspectRatio="xMidYMax slice"><path class="shape-divider-fill" d="M0 0v6.7c1.9-.8 4.7-1.4 8.5-1 9.5 1.1 11.1 6 11.1 6s2.1-.7 4.3-.2c2.1.5 2.8 2.6 2.8 2.6s.2-.5 1.4-.7c1.2-.2 1.7.2 1.7.2s0-2.1 1.9-2.8c1.9-.7 3.6.7 3.6.7s.7-2.9 3.1-4.1 4.7 0 4.7 0 1.2-.5 2.4 0 1.7 1.4 1.7 1.4h1.4c.7 0 1.2.7 1.2.7s.8-1.8 4-2.2c3.5-.4 5.3 2.4 6.2 4.4.4-.4 1-.7 1.8-.9 2.8-.7 4 .7 4 .7s1.7-5 11.1-6c9.5-1.1 12.3 3.9 12.3 3.9s1.2-4.8 5.7-5.7c4.5-.9 6.8 1.8 6.8 1.8s.6-.6 1.5-.9c.9-.2 1.9-.2 1.9-.2s5.2-6.4 12.6-3.3c7.3 3.1 4.7 9 4.7 9s1.9-.9 4 0 2.8 2.4 2.8 2.4 1.9-1.2 4.5-1.2 4.3 1.2 4.3 1.2.2-1 1.4-1.7 2.1-.7 2.1-.7-.5-3.1 2.1-5.5 5.7-1.4 5.7-1.4 1.5-2.3 4.2-1.1c2.7 1.2 1.7 5.2 1.7 5.2s.3-.1 1.3.5c.5.4.8.8.9 1.1.5-1.4 2.4-5.8 8.4-4 7.1 2.1 3.5 8.9 3.5 8.9s.8-.4 2 0 1.1 1.1 1.1 1.1 1.1-1.1 2.3-1.1 2.1.5 2.1.5 1.9-3.6 6.2-1.2 1.9 6.4 1.9 6.4 2.6-2.4 7.4 0c3.4 1.7 3.9 4.9 3.9 4.9s3.3-6.9 10.4-7.9 11.5 2.6 11.5 2.6.8 0 1.2.2c.4.2.9.9.9.9s4.4-3.1 8.3.2c1.9 1.7 1.5 5 1.5 5s.3-1.1 1.6-1.4c1.3-.3 2.3.2 2.3.2s-.1-1.2.5-1.9 1.9-.9 1.9-.9-4.7-9.3 4.4-13.4c5.6-2.5 9.2.9 9.2.9s5-6.2 15.9-6.2 16.1 8.1 16.1 8.1.7-.2 1.6-.4V0H0z"></path></svg>'; 6993 break; 6994 6995 case 'cloud-2': 6996 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 86" preserveAspectRatio="xMidYMid slice"><path class="shape-divider-fill" d="M1280 0H0v65.2c6.8 0 13.5.9 20.1 2.6 14-21.8 43.1-28 64.8-14 5.6 3.6 10.3 8.3 14 13.9 7.3-1.2 14.8-.6 21.8 1.6 2.1-37.3 34.1-65.8 71.4-63.7 24.3 1.4 46 15.7 56.8 37.6 19-17.6 48.6-16.5 66.3 2.4C323 54 327.4 65 327.7 76.5c.4.2.8.4 1.2.7 3.3 1.9 6.3 4.2 8.9 6.9 15.9-23.8 46.1-33.4 72.8-23.3 11.6-31.9 46.9-48.3 78.8-36.6 9.1 3.3 17.2 8.7 23.8 15.7 6.7-6.6 16.7-8.4 25.4-4.8 29.3-37.4 83.3-44 120.7-14.8 14 11 24.3 26.1 29.4 43.1 4.7.6 9.3 1.8 13.6 3.8 7.8-24.7 34.2-38.3 58.9-30.5 14.4 4.6 25.6 15.7 30.3 30 14.2 1.2 27.7 6.9 38.5 16.2 11.1-35.7 49-55.7 84.7-44.7 14.1 4.4 26.4 13.3 35 25.3 12-5.7 26.1-5.5 37.9.6 3.9-11.6 15.5-18.9 27.7-17.5.2-.3.3-.6.5-.9 23.3-41.4 75.8-56 117.2-32.6 14.1 7.9 25.6 19.7 33.3 33.8 28.8-23.8 71.5-19.8 95.3 9 2.6 3.1 4.9 6.5 6.9 10 3.8-.5 7.6-.8 11.4-.8L1280 0z"/></svg>'; 6997 break; 6998 6999 case 'cloud-3': 7000 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 86" preserveAspectRatio="xMidYMid slice"><path class="shape-divider-fill" d="M833.9 27.5c-5.8 3.2-11 7.3-15.5 12.2-7.1-6.9-17.5-8.8-26.6-5-30.6-39.2-87.3-46.1-126.5-15.5-1.4 1.1-2.8 2.2-4.1 3.4C674.4 33.4 684 48 688.8 64.3c4.7.6 9.3 1.8 13.6 3.8 7.8-24.7 34.2-38.3 58.9-30.5 14.4 4.6 25.6 15.7 30.3 30 14.2 1.2 27.7 6.9 38.5 16.2C840.6 49.6 876 29.5 910.8 38c-20.4-20.3-51.8-24.6-76.9-10.5zM384 43.9c-9 5-16.7 11.9-22.7 20.3 15.4-7.8 33.3-8.7 49.4-2.6 3.7-10.1 9.9-19.1 18.1-26-15.4-2.3-31.2.6-44.8 8.3zm560.2 13.6c2 2.2 3.9 4.5 5.7 6.9 5.6-2.6 11.6-4 17.8-4.1-7.6-2.4-15.6-3.3-23.5-2.8zM178.7 7c29-4.2 57.3 10.8 70.3 37 8.9-8.3 20.7-12.8 32.9-12.5C256.4 1.8 214.7-8.1 178.7 7zm146.5 56.3c1.5 4.5 2.4 9.2 2.5 14 .4.2.8.4 1.2.7 3.3 1.9 6.3 4.2 8.9 6.9 5.8-8.7 13.7-15.7 22.9-20.5-11.1-5.2-23.9-5.6-35.5-1.1zM33.5 54.9c21.6-14.4 50.7-8.5 65 13 .1.2.2.3.3.5 7.3-1.2 14.8-.6 21.8 1.6.6-10.3 3.5-20.4 8.6-29.4.3-.6.7-1.2 1.1-1.8-32.1-17.2-71.9-10.6-96.8 16.1zm1228.9 2.7c2.3 2.9 4.4 5.9 6.2 9.1 3.8-.5 7.6-.8 11.4-.8V48.3c-6.4 1.8-12.4 5-17.6 9.3zM1127.3 11c1.9.9 3.7 1.8 5.6 2.8 14.2 7.9 25.8 19.7 33.5 34 13.9-11.4 31.7-16.9 49.6-15.3-20.5-27.7-57.8-36.8-88.7-21.5z" opacity="0.5"/><path class="shape-divider-fill" d="M0 0v66c6.8 0 13.5.9 20.1 2.6 3.5-5.4 8.1-10.1 13.4-13.6 24.9-26.8 64.7-33.4 96.8-16 10.5-17.4 28.2-29.1 48.3-32 36.1-15.1 77.7-5.2 103.2 24.5 19.7.4 37.1 13.1 43.4 31.8 11.5-4.5 24.4-4.2 35.6 1.1l.4-.2c15.4-21.4 41.5-32.4 67.6-28.6 25-21 62.1-18.8 84.4 5.1 6.7-6.6 16.7-8.4 25.4-4.8 29.2-37.4 83.3-44.1 120.7-14.8l1.8 1.5c37.3-32.9 94.3-29.3 127.2 8 1.2 1.3 2.3 2.7 3.4 4.1 9.1-3.8 19.5-1.9 26.6 5 24.3-26 65-27.3 91-3.1.5.5 1 .9 1.5 1.4 12.8 3.1 24.4 9.9 33.4 19.5 7.9-.5 15.9.4 23.5 2.8 7-.1 13.9 1.5 20.1 4.7 3.9-11.6 15.5-18.9 27.7-17.5.2-.3.3-.6.5-.9 22.1-39.2 70.7-54.7 111.4-35.6 30.8-15.3 68.2-6.2 88.6 21.5 18.3 1.7 35 10.8 46.5 25.1 5.2-4.3 11.1-7.4 17.6-9.3V0H0z"/></svg>'; 7001 break; 7002 7003 case 'wave': 7004 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M421.9,6.5c22.6-2.5,51.5,0.4,75.5,5.3c23.6,4.9,70.9,23.5,100.5,35.7c75.8,32.2,133.7,44.5,192.6,49.7c23.6,2.1,48.7,3.5,103.4-2.5c54.7-6,106.2-25.6,106.2-25.6V0H0v30.3c0,0,72,32.6,158.4,30.5c39.2-0.7,92.8-6.7,134-22.4c21.2-8.1,52.2-18.2,79.7-24.2C399.3,7.9,411.6,7.5,421.9,6.5z"></path></svg>'; 7005 break; 7006 7007 case 'wave-2': 7008 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 27.8" preserveAspectRatio="none"><path class="shape-divider-fill" d="M283.5,9.7c0,0-7.3,4.3-14,4.6c-6.8,0.3-12.6,0-20.9-1.5c-11.3-2-33.1-10.1-44.7-5.7 s-12.1,4.6-18,7.4c-6.6,3.2-20,9.6-36.6,9.3C131.6,23.5,99.5,7.2,86.3,8c-1.4,0.1-6.6,0.8-10.5,2c-3.8,1.2-9.4,3.8-17,4.7 c-3.2,0.4-8.3,1.1-14.2,0.9c-1.5-0.1-6.3-0.4-12-1.6c-5.7-1.2-11-3.1-15.8-3.7C6.5,9.2,0,10.8,0,10.8V0h283.5V9.7z M260.8,11.3 c-0.7-1-2-0.4-4.3-0.4c-2.3,0-6.1-1.2-5.8-1.1c0.3,0.1,3.1,1.5,6,1.9C259.7,12.2,261.4,12.3,260.8,11.3z M242.4,8.6 c0,0-2.4-0.2-5.6-0.9c-3.2-0.8-10.3-2.8-15.1-3.5c-8.2-1.1-15.8,0-15.1,0.1c0.8,0.1,9.6-0.6,17.6,1.1c3.3,0.7,9.3,2.2,12.4,2.7 C239.9,8.7,242.4,8.6,242.4,8.6z M185.2,8.5c1.7-0.7-13.3,4.7-18.5,6.1c-2.1,0.6-6.2,1.6-10,2c-3.9,0.4-8.9,0.4-8.8,0.5 c0,0.2,5.8,0.8,11.2,0c5.4-0.8,5.2-1.1,7.6-1.6C170.5,14.7,183.5,9.2,185.2,8.5z M199.1,6.9c0.2,0-0.8-0.4-4.8,1.1 c-4,1.5-6.7,3.5-6.9,3.7c-0.2,0.1,3.5-1.8,6.6-3C197,7.5,199,6.9,199.1,6.9z M283,6c-0.1,0.1-1.9,1.1-4.8,2.5s-6.9,2.8-6.7,2.7 c0.2,0,3.5-0.6,7.4-2.5C282.8,6.8,283.1,5.9,283,6z M31.3,11.6c0.1-0.2-1.9-0.2-4.5-1.2s-5.4-1.6-7.8-2C15,7.6,7.3,8.5,7.7,8.6 C8,8.7,15.9,8.3,20.2,9.3c2.2,0.5,2.4,0.5,5.7,1.6S31.2,11.9,31.3,11.6z M73,9.2c0.4-0.1,3.5-1.6,8.4-2.6c4.9-1.1,8.9-0.5,8.9-0.8 c0-0.3-1-0.9-6.2-0.3S72.6,9.3,73,9.2z M71.6,6.7C71.8,6.8,75,5.4,77.3,5c2.3-0.3,1.9-0.5,1.9-0.6c0-0.1-1.1-0.2-2.7,0.2 C74.8,5.1,71.4,6.6,71.6,6.7z M93.6,4.4c0.1,0.2,3.5,0.8,5.6,1.8c2.1,1,1.8,0.6,1.9,0.5c0.1-0.1-0.8-0.8-2.4-1.3 C97.1,4.8,93.5,4.2,93.6,4.4z M65.4,11.1c-0.1,0.3,0.3,0.5,1.9-0.2s2.6-1.3,2.2-1.2s-0.9,0.4-2.5,0.8C65.3,10.9,65.5,10.8,65.4,11.1 z M34.5,12.4c-0.2,0,2.1,0.8,3.3,0.9c1.2,0.1,2,0.1,2-0.2c0-0.3-0.1-0.5-1.6-0.4C36.6,12.8,34.7,12.4,34.5,12.4z M152.2,21.1 c-0.1,0.1-2.4-0.3-7.5-0.3c-5,0-13.6-2.4-17.2-3.5c-3.6-1.1,10,3.9,16.5,4.1C150.5,21.6,152.3,21,152.2,21.1z"></path><path class="shape-divider-fill" d="M269.6,18c-0.1-0.1-4.6,0.3-7.2,0c-7.3-0.7-17-3.2-16.
70086-2.9c0.4,0.3,13.7,3.1,17,3.3 C267.7,18.8,269.7,18,269.6,18z"></path><path class="shape-divider-fill" d="M227.4,9.8c-0.2-0.1-4.5-1-9.5-1.2c-5-0.2-12.7,0.6-12.3,0.5c0.3-0.1,5.9-1.8,13.3-1.2 S227.6,9.9,227.4,9.8z"></path><path class="shape-divider-fill" d="M204.5,13.4c-0.1-0.1,2-1,3.2-1.1c1.2-0.1,2,0,2,0.3c0,0.3-0.1,0.5-1.6,0.4 C206.4,12.9,204.6,13.5,204.5,13.4z"></path><path class="shape-divider-fill" d="M201,10.6c0-0.1-4.4,1.2-6.3,2.2c-1.9,0.9-6.2,3.1-6.1,3.1c0.1,0.1,4.2-1.6,6.3-2.6 S201,10.7,201,10.6z"></path><path class="shape-divider-fill" d="M154.5,26.7c-0.1-0.1-4.6,0.3-7.2,0c-7.3-0.7-17-3.2-16.6-2.9c0.4,0.3,13.7,3.1,17,3.3 C152.6,27.5,154.6,26.8,154.5,26.7z"></path><path class="shape-divider-fill" d="M41.9,19.3c0,0,1.2-0.3,2.9-0.1c1.7,0.2,5.8,0.9,8.2,0.7c4.2-0.4,7.4-2.7,7-2.6 c-0.4,0-4.3,2.2-8.6,1.9c-1.8-0.1-5.1-0.5-6.7-0.4S41.9,19.3,41.9,19.3z"></path><path class="shape-divider-fill" d="M75.5,12.6c0.2,0.1,2-0.8,4.3-1.1c2.3-0.2,2.1-0.3,2.1-0.5c0-0.1-1.8-0.4-3.4,0 C76.9,11.5,75.3,12.5,75.5,12.6z"></path><path class="shape-divider-fill" d="M15.6,13.2c0-0.1,4.3,0,6.7,0.5c2.4,0.5,5,1.9,5,2c0,0.1-2.7-0.8-5.1-1.4 C19.9,13.7,15.7,13.3,15.6,13.2z"></path></svg>'; 7009 break; 7010 7011 case 'wave-3': 7012 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1047.1 3.7" preserveAspectRatio="xMidYMin slice"><path class="shape-divider-fill" d="M1047.1,0C557,0,8.9,0,0,0v1.6c0,0,0.6-1.5,2.7-0.3C3.9,2,6.1,4.1,8.3,3.5c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3C13.8,2,16,4.1,18.2,3.5c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3C23.6,2,25.9,4.1,28,3.5c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3C63,2,65.3,4.1,67.4,3.5 C68.3,3.3,69,1.6,69,1.6s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3 C82.7,2,85,4.1,87.1,3.5c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3C92.6,2,94.8,4.1,97,3.5c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9 c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2 c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3 c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.6-0.4V0z M2.5,1.2C2.5,1.2,2.5,1.2,2.5,1.2C2.5,1.2,2.5,1.2,2.5,1.2z M2.7,1.4c0.1,0,0.1,0.1,0.1,0.1C2.8,1.4,2.8,1.4,2.7,1.4z"></path></svg>'; 7013 break; 7014 7015 case 'wave-4': 7016 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 51.76c36.21-2.25 77.57-3.58 126.42-3.58 320 0 320 57 640 57 271.15 0 312.58-40.91 513.58-53.4V0H0z" opacity="0.3"></path><path class="shape-divider-fill" d="M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V0H0z" opacity="0.5"></path><path class="shape-divider-fill" d="M0 0v3.4C28.2 1.6 59.4.59 94.42.59c320 0 320 84.3 640 84.3 285 0 316.17-66.85 545.58-81.49V0z"></path></svg>'; 7017 break; 7018 7019 case 'wave-5': 7020 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 0v100c20 17.3 40 29.51 80 29.51 51.79 0 74.69-48.57 151.75-48.57 73.72 0 91 54.88 191.56 54.88C543.95 135.8 554 14 665.69 14c109.46 0 98.85 87 188.2 87 70.37 0 69.81-33.73 115.6-33.73 55.85 0 62 39.62 115.6 39.62 58.08 0 57.52-46.59 115-46.59 39.8 0 60 22.48 79.89 39.69V0z"></path></svg>'; 7021 break; 7022 7023 case 'wave-6': 7024 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M504.854,80.066c7.812,0,14.893,0.318,21.41,0.879 c-25.925,22.475-56.093,40.852-102.946,40.852c-20.779,0-37.996-2.349-52.898-6.07C413.517,107.295,434.056,80.066,504.854,80.066z M775.938,51.947c19.145,18.596,39.097,35.051,77.956,35.051c46.907,0,62.299-14.986,80.912-24.98 c-21.357-15.783-46.804-28.348-85.489-28.348C816.829,33.671,794.233,41.411,775.938,51.947z" opacity="0.3"></path><path class="shape-divider-fill" d="M1200.112,46.292c39.804,0,59.986,22.479,79.888,39.69v16.805 c-19.903-10.835-40.084-21.777-79.888-21.777c-72.014,0-78.715,43.559-147.964,43.559c-56.84,0-81.247-35.876-117.342-62.552 c9.309-4.998,19.423-8.749,34.69-8.749c55.846,0,61.99,39.617,115.602,39.617C1143.177,92.887,1142.618,46.292,1200.112,46.292z M80.011,115.488c-40.006,0-60.008-12.206-80.011-29.506v16.806c20.003,10.891,40.005,21.782,80.011,21.782 c80.004,0,78.597-30.407,137.669-30.407c55.971,0,62.526,24.026,126.337,24.026c9.858,0,18.509-0.916,26.404-2.461 c-57.186-14.278-80.177-48.808-138.66-48.808C154.698,66.919,131.801,115.488,80.011,115.488z M526.265,80.945 c56.848,4.902,70.056,28.726,137.193,28.726c54.001,0,73.43-35.237,112.48-57.724C751.06,27.782,727.548,0,665.691,0 C597.381,0,567.086,45.555,526.265,80.945z" opacity="0.5"></path><path class="shape-divider-fill" d="M0,0v85.982c20.003,17.3,40.005,29.506,80.011,29.506c51.791,0,74.688-48.569,151.751-48.569 c58.482,0,81.473,34.531,138.66,48.808c43.096-8.432,63.634-35.662,134.433-35.662c7.812,0,14.893,0.318,21.41,0.879 C567.086,45.555,597.381,0,665.691,0c61.856,0,85.369,27.782,110.246,51.947c18.295-10.536,40.891-18.276,73.378-18.276 c38.685,0,64.132,12.564,85.489,28.348c9.3
702409-4.998,19.423-8.749,34.69-8.749c55.846,0,61.99,39.617,115.602,39.617 c58.08,0,57.521-46.595,115.015-46.595c39.804,0,59.986,22.479,79.888,39.69V0H0z"></path></svg>'; 7025 break; 7026 7027 case 'slant': 7028 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0,6V0h1000v100L0,6z"></path></svg>'; 7029 break; 7030 7031 case 'slant-2': 7032 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2600 131.1" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 0L2600 0 2600 69.1 0 0z"></path><path class="shape-divider-fill" opacity="0.5" d="M0 0L2600 0 2600 69.1 0 69.1z"></path><path class="shape-divider-fill" opacity="0.25" d="M2600 0L0 0 0 130.1 2600 69.1z"></path></svg>'; 7033 break; 7034 7035 case 'slant-3': 7036 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M1280 140V0H0l1280 140z" opacity="0.5"></path><path class="shape-divider-fill" d="M1280 98V0H0l1280 98z"></path></svg>'; 7037 break; 7038 7039 case 'rounded': 7040 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M1000,4.3V0H0v4.3C0.9,23.1,126.7,99.2,500,100S1000,22.7,1000,4.3z"></path></svg>'; 7041 break; 7042 7043 case 'rounded-2': 7044 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0,0c0,0,0,6,0,6.7c0,18,240.2,93.6,615.2,92.6C989.8,98.5,1000,25,1000,6.7c0-0.7,0-6.7,0-6.7H0z"></path></svg>'; 7045 break; 7046 7047 case 'rounded-3': 7048 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 0s573.08 140 1280 140V0z"></path></svg>'; 7049 break; 7050 7051 case 'rounded-4': 7052 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 0v60s573.09 80 1280 80V0z" opacity="0.3"></path><path class="shape-divider-fill" d="M0 0v30s573.09 110 1280 110V0z" opacity="0.5"></path><path class="shape-divider-fill" d="M0 0s573.09 140 1280 140V0z"></path></svg>'; 7053 break; 7054 7055 case 'rounded-5': 7056 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 140" preserveAspectRatio="none"><path class="shape-divider-fill" d="M0 0v.48C18.62 9.38 297.81 140 639.5 140 993.24 140 1280 0 1280 0z" opacity="0.3"></path><path class="shape-divider-fill" d="M0 .6c14 8.28 176.54 99.8 555.45 119.14C952.41 140 1280 0 1280 0H0z" opacity="0.5"></path><path class="shape-divider-fill" d="M726.29 101.2C1126.36 79.92 1281 0 1281 0H1c.05 0 325.25 122.48 725.29 101.2z"></path></svg>'; 7057 break; 7058 7059 case 'triangle': 7060 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 10" preserveAspectRatio="none"><path class="shape-divider-fill" d="M350,10L340,0h20L350,10z"></path></svg>'; 7061 break; 7062 7063 case 'drops': 7064 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 27.8" preserveAspectRatio="xMidYMax slice"><path class="shape-divider-fill" d="M0 0v1.4c.6.7 1.1 1.4 1.4 2 2 3.8 2.2 6.6 1.8 10.8-.3 3.3-2.4 9.4 0 12.3 1.7 2 3.7 1.4 4.6-.9 1.4-3.8-.7-8.2-.6-12 .1-3.7 3.2-5.5 6.9-4.9 4 .6 4.8 4 4.9 7.4.1 1.8-1.1 7 0 8.5.6.8 1.6 1.2 2.4.5 1.4-1.1.1-5.4.1-6.9.1-3.7.3-8.6 4.1-10.5 5-2.5 6.2 1.6 5.4 5.6-.4 1.7-1 9.2 2.9 6.3 1.5-1.1.7-3.5.5-4.9-.4-2.4-.4-4.3 1-6.5.9-1.4 2.4-3.1 4.2-3 2.4.1 2.7 2.2 4 3.7 1.5 1.8 1.8 2.2 3 .1 1.1-1.9 1.2-2.8 3.6-3.3 1.3-.3 4.8-1.4 5.9-.5 1.5 1.1.6 2.8.4 4.3-.2 1.1-.6 4 1.8 3.4 1.7-.4-.3-4.1.6-5.6 1.3-2.2 5.8-1.4 7 .5 1.3 2.1.5 5.8.1 8.1s-1.2 5-.6 7.4c1.3 5.1 4.4.9 4.3-2.4-.1-4.4-2-8.8-.5-13 .9-2.4 4.6-6.6 7.7-4.5 2.7 1.8.5 7.8.2 10.3-.2 1.7-.8 4.6.2 6.2.9 1.4 2 1.5 2.6-.3.5-1.5-.9-4.5-1-6.1-.2-1.7-.4-3.7.2-5.4 1.8-5.6 3.5 2.4 6.3.6 1.4-.9 4.3-9.4 6.1-3.1.6 2.2-1.3 7.8.7 8.9 4.2 2.3 1.5-7.1 2.2-8 3.1-4 4.7 3.8 6.1 4.1 3.1.7 2.8-7.9 8.1-4.5 1.7 1.1 2.9 3.3 3.2 5.2.4 2.2-1 4.5-.6 6.6 1 4.3 4.4 1.5 4.4
7064-1.7 0-2.7-3-8.3 1.4-9.1 4.4-.9 7.3 3.5 7.8 6.9.3 2-1.5 10.9 1.3 11.3 4.1.6-3.2-15.7 4.8-15.8 4.7-.1 2.8 4.1 3.9 6.6 1 2.4 2.1 1 2.3-.8.3-1.9-.9-3.2 1.3-4.3 5.9-2.9 5.9 5.4 5.5 8.5-.3 2-1.7 8.4 2 8.1 6.9-.5-2.8-16.9 4.8-18.7 4.7-1.2 6.1 3.6 6.3 7.1.1 1.7-1.2 8.1.6 9.1 3.5 2 1.9-7 2-8.4.2-4 1.2-9.6 6.4-9.8 4.7-.2 3.2 4.6 2.7 7.5-.4 2.2 1.3 8.6 3.8 4.4 1.1-1.9-.3-4.1-.3-6 0-1.7.4-3.2 1.3-4.6 1-1.6 2.9-3.5 5.1-2.9 2.5.6 2.3 4.1 4.1 4.9 1.9.8 1.6-.9 2.3-2.1 1.2-2.1 2.1-2.1 4.4-2.4 1.4-.2 3.6-1.5 4.9-.5 2.3 1.7-.7 4.4.1 6.5.6 1.5 2.1 1.7 2.8.3.7-1.4-1.1-3.4-.3-4.8 1.4-2.5 6.2-1.2 7.2 1 2.3 4.8-3.3 12-.2 16.3 3 4.1 3.9-2.8 3.8-4.8-.4-4.3-2.1-8.9 0-13.1 1.3-2.5 5.9-5.7 7.9-2.4 2 3.2-1.3 9.8-.8 13.4.5 4.4 3.5 3.3 2.7-.8-.4-1.9-2.4-10 .6-11.1 3.7-1.4 2.8 7.2 6.5.4 2.2-4.1 4.9-3.1 5.2 1.2.1 1.5-.6 3.1-.4 4.6.2 1.9 1.8 3.7 3.3 1.3 1-1.6-2.6-10.4 2.9-7.3 2.6 1.5 1.6 6.5 4.8 2.7 1.3-1.5 1.7-3.6 4-3.7 2.2-.1 4 2.3 4.8 4.1 1.3 2.9-1.5 8.4.9 10.3 4.2 3.3 3-5.5 2.7-6.9-.6-3.9 1-7.2 5.5-5 4.1 2.1 4.3 7.7 4.1 11.6 0 .8-.6 9.5 2.5 5.2 1.2-1.7-.1-7.7.1-9.6.3-2.9 1.2-5.5 4.3-6.2 4.5-1 7.7 1.5 7.4 5.8-.2 3.5-1.8 7.7-.5 11.1 1 2.7 3.6 2.8 5 .2 1.6-3.1 0-8.3-.4-11.6-.4-4.2-.2-7 1.8-10.8 0 0-.1.1-.1.2-.2.4-.3.7-.4.8v.1c-.1.2-.1.2 0 0v-.1l.4-.8c0-.1.1-.1.1-.2.2-.4.5-.8.8-1.2V0H0zM282.7 3.4z"></path></svg>'; 7065 break; 7066 7067 case 'cliff': 7068 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 279.24" preserveAspectRatio="none"><path class="shape-divider-fill" d="M1000 0S331.54-4.18 0 279.24h1000z" opacity="0.25"></path><path class="shape-divider-fill" d="M1000 279.24s-339.56-44.3-522.95-109.6S132.86 23.76 0 25.15v254.09z"></path></svg>'; 7069 break; 7070 7071 case 'zigzag': 7072 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 5.8" preserveAspectRatio="none"><path class="shape-divider-fill" d="M5.4.4l5.4 5.3L16.5.4l5.4 5.3L27.5.4 33 5.7 38.6.4l5.5 5.4h.1L49.9.4l5.4 5.3L60.9.4l5.5 5.3L72 .4l5.5 5.3L83.1.4l5.4 5.3L94.1.4l5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3L161 .4l5.4 5.3L172 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3L261 .4l5.4 5.3L272 .4l5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3L361 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.6-5.4 5.5 5.3L461 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1L550 .4l5.4 5.3L561 .4l5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2L650 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2L750 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2L850 .4l5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.4V0H-.2v5.8z"></path></svg>'; 7073 break; 7074 7075 case 'illusion': 7076 shape = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 19.6" preserveAspectRatio="none"><path class="shape-divider-fill" opacity="0.33" d="M0 0L0 18.8 141.8 4.1 283.5 18.8 283.5 0z"></path><path class="shape-divider-fill" opacity="0.33" d="M0 0L0 12.6 141.8 4 283.5 12.6 283.5 0z"></path><path class="shape-divider-fill" opacity="0.33" d="M0 0L0 6.4 141.8 4 283.5 6.4 283.5 0z"></path><path class="shape-divider-fill" d="M0 0L0 1.2 141.8 4 283.5 1.2 283.5 0z"></path></svg>'; 7077 break; 7078 7079 default: 7080 shape = ''; 7081 break; 7082 } 7083 7084 element.innerHTML = shape; 7085 element.querySelector('svg').classList.add( 'op-ts' ); 7086 7087 setTimeout( function() { 7088 element.querySelector('svg').classList.add( 'op-1' ); 7089 }, 500); 7090 7091 element.classList.add('shape-divider-complete'); 7092 }); 7093 } 7094 }; 7095 }(), 7096 // ShapeDivider Functions End 7097 7098 /** 7099 * -------------------------------------------------------------------------- 7100 * StickySidebar Functions Start 7101 * -------------------------------------------------------------------------- 7102 */ 7103 StickySidebar: function() { 7104 return { 7105 init: function(selector) { 7106 if( __core.getSelector(selector, false, false).length < 1 ){ 7107 return true; 7108 } 7109 7110 __core.isFuncTrue( function() { 7111 return typeof jQuery !== 'undefined' && jQuery().scwStickySidebar; 7112 }).then( function(cond) { 7113 if( !cond ) { 7114 return false;
7115 } 7116 7117 __core.initFunction({ class: 'has-plugin-stickysidebar', event: 'pluginStickySidebarReady' }); 7118 7119 selector = __core.getSelector( selector ); 7120 if( selector.length < 1 ){ 7121 return false; 7122 } 7123 7124 selector.each( function(){ 7125 var element = jQuery(this), 7126 elTop = element.attr('data-offset-top') || 110, 7127 elBottom = element.attr('data-offset-bottom') || 50; 7128 7129 element.scwStickySidebar({ 7130 additionalMarginTop: Number(elTop), 7131 additionalMarginBottom: Number(elBottom) 7132 }); 7133 }); 7134 }); 7135 } 7136 }; 7137 }(), 7138 // StickySidebar Functions End 7139 7140 /** 7141 * -------------------------------------------------------------------------- 7142 * Cookies Functions Start 7143 * -------------------------------------------------------------------------- 7144 */ 7145 Cookies: function() { 7146 var _resetPage = function(btn) { 7147 if( !btn.closest('#gdpr-preferences') ) { 7148 return false; 7149 } 7150 7151 setTimeout( function() { 7152 window.location.reload(); 7153 }, 500); 7154 }; 7155 7156 return { 7157 init: function(selector) { 7158 if( __core.getSelector(selector, false, false).length < 1 ){ 7159 return true; 7160 } 7161 7162 __core.initFunction({ class: 'has-plugin-cookie', event: 'pluginCookieReady' }); 7163 7164 selector = __core.getSelector( selector, false ); 7165 if( selector.length < 1 ){ 7166 return true; 7167 } 7168 7169 var cookieBar = document.querySelector('.gdpr-settings'), 7170 elSpeed = cookieBar?.getAttribute('data-speed') || 300, 7171 elExpire = cookieBar?.getAttribute('data-expire') || 30, 7172 elDelay = cookieBar?.getAttribute('data-delay') || 1500, 7173 elPersist = cookieBar?.getAttribute('data-persistent'), 7174 elDirection = 'bottom', 7175 elHeight = cookieBar?.offsetHeight + 100, 7176 elWidth = cookieBar?.offsetWidth + 100, 7177 elSize, 7178 elSettings = document.querySelector('.gdpr-cookie-settings'), 7179 elSwitches = elSettings?.querySelectorAll('[data-cookie-name]'); 7180 7181 if( !cookieBar && !elSettings ) { 7182 return true; 7183 } 7184 7185 if( elPersist == 'true' ) { 7186 __core.cookie.set('__cnvs_cookies_accept', ''); 7187 __core.cookie.remove('__cnvs_cookies_decline'); 7188 } 7189 7190 if( cookieBar ) { 7191 if( cookieBar?.classList.contains('gdpr-settings-sm') && cookieBar?.classList.contains('gdpr-settings-right') ) { 7192 elDirection = 'right'; 7193 } else if( cookieBar?.classList.contains('gdpr-settings-sm') ) { 7194 elDirection = 'left'; 7195 } 7196 7197 if( elDirection == 'left' ) { 7198 elSize = -elWidth; 7199 cookieBar.style.right = 'auto'; 7200 cookieBar.style.marginLeft = '1rem'; 7201 } else if( elDirection == 'right' ) { 7202 elSize = -elWidth; 7203 cookieBar.style.left = 'auto'; 7204 cookieBar.style.marginRight = '1rem'; 7205 } else { 7206 elSize = -elHeight; 7207 } 7208 7209 cookieBar.style[elDirection] = elSize + 'px'; 7210 7211 if( __core.cookie.get('__cnvs_cookies_accept') != '1' ) { 7212 setTimeout( function() { 7213 cookieBar.style.display = 'block'; 7214 cookieBar.style.pointerEvents = 'auto'; 7215 cookieBar.style[elDirection] = 0; 7216 cookieBar.style.opacity = 1; 7217 }, Number( elDelay ) ); 7218 } 7219 } 7220 7221 var gdprAcceptBtn = document.querySelectorAll('.gdpr-accept'), 7222 gdprDeclineBtn = document.querySelectorAll('.gdpr-decline'), 7223 gdprSaveCookies = document.querySelectorAll('.gdpr-save-cookies'); 7224 7225 if( gdprAcceptBtn.length > 0 ) {
7226 gdprAcceptBtn.forEach( function(btn){ 7227 btn.onclick = function(e) { 7228 e.preventDefault(); 7229 7230 if( cookieBar ) { 7231 cookieBar.style[elDirection] = elSize + 'px'; 7232 cookieBar.style.opacity = 0; 7233 cookieBar.ontransitionend = function() { 7234 cookieBar.style.display = 'none'; 7235 cookieBar.style.pointerEvents = 'none'; 7236 }; 7237 } 7238 7239 __core.cookie.set('__cnvs_cookies_accept', '1', elExpire); 7240 __core.cookie.set('__cnvs_cookies_decline', '0', elExpire); 7241 7242 _resetPage(btn); 7243 }; 7244 }); 7245 } 7246 7247 if( gdprDeclineBtn.length > 0 ) { 7248 gdprDeclineBtn.forEach( function(btn){ 7249 btn.onclick = function(e) { 7250 e.preventDefault(); 7251 7252 if( cookieBar ) { 7253 cookieBar.style[elDirection] = elSize + 'px'; 7254 cookieBar.style.opacity = 0; 7255 cookieBar.ontransitionend = function() { 7256 cookieBar.style.display = 'none'; 7257 cookieBar.style.pointerEvents = 'none'; 7258 }; 7259 } 7260 7261 __core.cookie.set('__cnvs_cookies_accept', '0', elExpire); 7262 __core.cookie.set('__cnvs_cookies_decline', '1', elExpire); 7263 7264 _resetPage(btn); 7265 }; 7266 }); 7267 } 7268 7269 var acceptCookies = __core.cookie.get('__cnvs_cookies_accept'), 7270 declineCookies = __core.cookie.get('__cnvs_cookies_decline'), 7271 cookiesAllowed = (acceptCookies || acceptCookies != '0') && (!declineCookies || declineCookies != '1'); 7272 7273 elSwitches?.forEach( function(el) { 7274 var elCookie = '__cnvs_gdpr_' + el.getAttribute('data-cookie-name'), 7275 getCookie = __core.cookie.get(elCookie); 7276 7277 if( typeof getCookie !== 'undefined' && getCookie == '1' && cookiesAllowed ) { 7278 el.checked = true; 7279 } else { 7280 el.checked = false; 7281 } 7282 }); 7283 7284 if( gdprSaveCookies.length > 0 ) { 7285 gdprSaveCookies.forEach( function(btn){ 7286 btn.onclick = function(e) { 7287 e.preventDefault(); 7288 7289 __core.cookie.set('__cnvs_cookies_accept', '1', elExpire); 7290 __core.cookie.set('__cnvs_cookies_decline', '0', elExpire); 7291 7292 elSwitches.forEach( function(el) { 7293 var elCookie = '__cnvs_gdpr_' + el.getAttribute( 'data-cookie-name' ); 7294 7295 if( el.checked == true ) { 7296 __core.cookie.set(elCookie, '1', elExpire); 7297 } else { 7298 __core.cookie.remove(elCookie, ''); 7299 } 7300 }); 7301 7302 if( elSettings.closest( '.mfp-content' ).length > 0 ) { 7303 jQuery$.magnificPopup.close(); 7304 } 7305 7306 _resetPage(btn); 7307 }; 7308 }); 7309 } 7310 7311 document.querySelectorAll('.gdpr-container')?.forEach( function(element) { 7312 var elCookie = '__cnvs_gdpr_' + element.getAttribute('data-cookie-name'), 7313 elContent = element.getAttribute('data-cookie-content'), 7314 elContentAjax = element.getAttribute('data-cookie-content-ajax'), 7315 getCookie = __core.cookie.get(elCookie); 7316 7317 if( typeof getCookie !== 'undefined' && getCookie == '1' && cookiesAllowed ) { 7318 element.classList.add('gdpr-content-active'); 7319 if( elContentAjax ) { 7320 fetch( elContentAjax ).then( function(response) { 7321 return response.text(); 7322 }).then( function(html) { 7323 var domParser = new DOMParser(); 7324 var parsedHTML = domParser.parseFromString(html, 'text/html'); 7325 7326 element?.insertAdjacentHTML('beforeend', parsedHTML.body.innerHTML); 7327 }).catch( function(err) { 7328 console.log(err); 7329 }); 7330 } else { 7331 if( elContent ) { 7332 element.innerHTML += elContent; 7333 } 7334 } 7335 __core.runContainerModules(element); 7336 } else { 7337 element.classList.add('gdpr-content-blocked'); 7338 } 7339 }); 7340 } 7341 }; 7342 }(), 7343 // Cookies Functions End 7344 7345 /** 7346 * -------------------------------------------------------------------------- 7347 * Quantity Functions Start 7348 * -------------------------------------------------------------------------- 7349 */ 7350 Quantity: function() { 7351 return { 7352 init: function(selector) { 7353 if( __core.getSelector(selector, false, false).length < 1 ){ 7354 return true; 7355 } 7356 7357 __core.initFunction({ class: 'has-plugin-quantity', event: 'pluginQuantityReady' }); 7358 7359 selector = __core.getSelector( selector, false ); 7360 if( selector.length < 1 ){ 7361 return true; 7362 } 7363 7364 selector.forEach( function(element) { 7365 var plus = element.querySelector('.plus'), 7366 minus = element.querySelector('.minus'), 7367 input = element.querySelector('.qty'); 7368 7369 var eventChange = new Event("change"); 7370 7371 plus.onclick = function(e) { 7372 e.preventDefault(); 7373 7374 var value = input.value, 7375 step = input.getAttribute('step') || 1, 7376 max = input.getAttribute('max'), 7377 intRegex = /^\d+$/; 7378 7379 if( max && ( Number(value) >= Number( max ) ) ) { 7380 return false;
7381 } 7382 7383 if( intRegex.test( value ) ) { 7384 var valuePlus = Number(value) + Number(step); 7385 input.value = valuePlus; 7386 } else { 7387 input.value = Number(step); 7388 } 7389 7390 input.dispatchEvent(eventChange); 7391 }; 7392 7393 minus.onclick = function(e) { 7394 e.preventDefault(); 7395 7396 var value = input.value, 7397 step = input.getAttribute('step') || 1, 7398 min = input.getAttribute('min'), 7399 intRegex = /^\d+$/; 7400 7401 if( !min || min < 0 ) { 7402 min = 1; 7403 } 7404 7405 if( intRegex.test( value ) ) { 7406 if( Number(value) > Number(min) ) { 7407 var valueMinus = Number(value) - Number(step); 7408 input.value = valueMinus; 7409 } 7410 } else { 7411 input.value = Number(step); 7412 } 7413 7414 input.dispatchEvent(eventChange); 7415 }; 7416 }); 7417 } 7418 }; 7419 }(), 7420 // Quantity Functions End 7421 7422 /** 7423 * -------------------------------------------------------------------------- 7424 * ReadMore Functions Start 7425 * -------------------------------------------------------------------------- 7426 */ 7427 ReadMore: function() { 7428 var _HEXtoRGBA = function(hex, op) { 7429 var c; 7430 7431 if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){ 7432 c= hex.substring(1).split(''); 7433 if(c.length==3){ 7434 c= [c[0], c[0], c[1], c[1], c[2], c[2]]; 7435 } 7436 c= '0x'+c.join(''); 7437 return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+','+op+')'; 7438 } 7439 7440 console.log('Bad Hex'); 7441 }; 7442 7443 return { 7444 init: function(selector) { 7445 if( __core.getSelector(selector, false, false).length < 1 ){ 7446 return true; 7447 } 7448 7449 __core.initFunction({ class: 'has-plugin-readmore', event: 'pluginReadMoreReady' }); 7450 7451 selector = __core.getSelector( selector, false ); 7452 if( selector.length < 1 ){ 7453 return true; 7454 } 7455 7456 selector.forEach( function(el) { 7457 var element = el, 7458 elSize = element.getAttribute('data-readmore-size') || '10rem', 7459 elSpeed = element.getAttribute('data-readmore-speed') || 500, 7460 elScrollUp = element.getAttribute('data-readmore-scrollup') || 'false', 7461 elTrigger = element.getAttribute('data-readmore-trigger') || '.read-more-trigger', 7462 elTriggerO = element.getAttribute('data-readmore-trigger-open') || 'Read More', 7463 elTriggerC = element.getAttribute('data-readmore-trigger-close') || 'Read Less', 7464 elMask; 7465 7466 element.style.height = ''; 7467 element.classList.remove('read-more-wrap-open'); 7468 7469 var elHeight = element.offsetHeight; 7470 7471 var elTriggerElement = element.querySelector( elTrigger ); 7472 elTriggerElement.classList.remove('d-none'); 7473 var elHeightN = elHeight + elTriggerElement.offsetHeight; 7474 7475 elTriggerElement.innerHTML = elTriggerO; 7476 elSpeed = Number( elSpeed ); 7477 7478 element.classList.add('read-more-wrap'); 7479 element.style.height = elSize; 7480 element.style.transitionDuration = elSpeed + 'ms'; 7481 7482 if( !element.querySelector('.read-more-mask') ) { 7483 element.innerHTML += '<div class="read-more-mask"></div>'; 7484 } 7485 7486 elMask = element.querySelector('.read-more-mask'); 7487 7488 var elMaskD = element.getAttribute('data-readmore-mask') || 'true', 7489 elMaskColor = element.getAttribute('data-readmore-maskcolor') || '#FFF', 7490 elMaskSize = element.getAttribute('data-readmore-masksize') || '100%'; 7491 7492 if( elMaskD == 'true' ) { 7493 elMask.style.height = elMaskSize; 7494 elMask.style.backgroundImage = 'linear-gradient( '+ _HEXtoRGBA( elMaskColor, 0 ) +', '+ _HEXtoRGBA( elMaskColor, 1 ) +' )'; 7495 elMask.classList.add('op-ts', 'op-1'); 7496 } else { 7497 elMask.classList.add('d-none'); 7498 } 7499 7500 var elTriggerEl = element.querySelector(elTrigger); 7501 7502 elTriggerEl.onclick = function(e) { 7503 e.preventDefault(); 7504 7505 if( element.classList.contains('read-more-wrap-open') ) { 7506 element.style.height = elSize; 7507 element.classList.remove('read-more-wrap-open'); 7508 elTriggerEl.innerHTML = elTriggerO; 7509 setTimeout( function() { 7510 if( elScrollUp == 'true' ) { 7511 __core.scrollTo((element.offsetTop - __core.getVars.topScrollOffset), false, false); 7512 } 7513 }, elSpeed ); 7514 if( elMaskD == 'true' ) { 7515 elMask.classList.add('op-ts', 'op-1'); 7516 } 7517 } else { 7518 if( elTriggerC == 'false' ) { 7519 elTriggerEl.classList.add('d-none'); 7520 } 7521 element.style.height = elHeightN + 'px'; 7522 element.style.overflow = ''; 7523 element.classList.add('read-more-wrap-open'); 7524 if( elTriggerEl ) { 7525 elTriggerEl.innerHTML = elTriggerC; 7526 } 7527 if( elMaskD == 'true' ) { 7528 elMask.classList.remove('op-1'); 7529 elMask.classList.add('op-0'); 7530 } 7531 } 7532 7533 elTriggerEl = element.querySelector(elTrigger); 7534 }; 7535 }); 7536 7537 __core.getVars.resizers.readmore = function() { 7538 __modules.readmore(); 7539 }; 7540 } 7541 }; 7542 }(), 7543 // ReadMore Functions End 7544 7545 /** 7546 * -------------------------------------------------------------------------- 7547 * PricingSwitcher Functions Start 7548 * -------------------------------------------------------------------------- 7549 */ 7550 PricingSwitcher: function() { 7551 var _staticValue; 7552 7553 var _switcher = function(check, switcher, pricing, defClass, actClass) { 7554 var value; 7555 7556 if( check.type == 'checkbox' ) { 7557 _staticValue = check.checked; 7558 } else if( check.type == 'radio' ) { 7559 if( check.checked ) { 7560 _staticValue = check.value; 7561 } 7562 } else { 7563 _staticValue = check.value; 7564 } 7565 7566 value = _staticValue; 7567 7568 switcher.querySelectorAll('.pts-switch')?.forEach( function(elem) { 7569 actClass.split(" ").forEach( function(_class) { 7570 elem.classList.remove(_class); 7571 }); 7572 7573 defClass.split(" ").forEach( function(_class) { 7574 elem.classList.add(_class); 7575 }); 7576 }); 7577 7578 pricing.querySelectorAll('.pts-content')?.forEach( function(elem) { 7579 elem.classList.add('d-none'); 7580 }); 7581 7582 if( check.type == 'checkbox' ) { 7583 value = value ? 'true' : 'false'; 7584 } 7585 7586 defClass.split(" ").forEach( function(_class) { 7587 switcher.querySelector('.pts-' + value)?.classList.remove(_class); 7588 }); 7589 7590 actClass.split(" ").forEach( function(_class) { 7591 switcher.querySelector('.pts-' + value)?.classList.add(_class); 7592 }); 7593 7594 pricing.querySelectorAll('.pts-content-' + value).forEach( function(el) { 7595 el.classList.remove('d-none'); 7596 }); 7597 }; 7598 7599 return { 7600 init: function(selector) { 7601 if( __core.getSelector(selector, false, false).length < 1 ){ 7602 return true; 7603 } 7604 7605 __core.initFunction({ class: 'has-plugin-pricing-switcher', event: 'pluginPricingSwitcherReady' }); 7606 7607 selector = __core.getSelector( selector, false ); 7608 if( selector.length < 1 ){ 7609 return true; 7610 } 7611 7612 selector.forEach( function(element) { 7613 var elCheck = element.querySelectorAll('[type="checkbox"], [type="radio"], select'), 7614 elDefClass = element.getAttribute('data-default-class') || 'text-muted op-05', 7615 elActClass = element.getAttribute('data-active-class') || 'fw-bold', 7616 elPricing = document.querySelector( element.getAttribute('data-container') ); 7617 7618 elCheck.forEach( function(el) { 7619 _switcher(el, element, elPricing, elDefClass, elActClass); 7620 7621 el.addEventListener( 'change', function() { 7622 _switcher(el, element, elPricing, elDefClass, elActClass); 7623 }); 7624 }); 7625 }); 7626 } 7627 }; 7628 }(), 7629 // PricingSwitcher Functions End 7630 7631 /** 7632 * -------------------------------------------------------------------------- 7633 * AjaxTrigger Functions Start 7634 * -------------------------------------------------------------------------- 7635 */ 7636 AjaxTrigger: function() { 7637 var _load = function(params) { 7638 fetch(params.loader).then( function(response) { 7639 return response.text(); 7640 }).then( function(html) { 7641 _scripts(params.loadCSS, params.loadJS); 7642 7643 var domParser = new DOMParser(); 7644 var parsedHTML = domParser.parseFromString(html, 'text/html'); 7645 7646 if( params.placement == 'append' ) { 7647 params.container?.insertAdjacentHTML('beforeend', parsedHTML.body.innerHTML); 7648 } else { 7649 params.container?.insertAdjacentHTML('afterbegin', parsedHTML.body.innerHTML); 7650 } 7651 7652 if( params.triggerHide == 'true' ) { 7653 params.trigger.classList.add('d-none'); 7654 } 7655 7656 __core.runContainerModules(params.container); 7657 __core.viewport(); 7658 7659 if( params.triggerDisable == 'true' ) { 7660 setTimeout( function() {
7661 params.trigger.onclick = function(e) { 7662 e.stopPropagation(); 7663 e.preventDefault(); 7664 7665 return false; 7666 }; 7667 }, 1000); 7668 } 7669 }).catch( function(err) { 7670 var errorDIV = document.createElement("div"); 7671 errorDIV.classList.add( 'd-inline-block', 'text-danger', 'me-3' ); 7672 errorDIV.innerText = 'Content Cannot be Loaded!'; 7673 params.container?.prepend( errorDIV, ': ' + err ); 7674 }); 7675 }; 7676 7677 var _scripts = function(loadCSS=false, loadJS=false) { 7678 if( loadCSS ) { 7679 loadCSS = JSON.parse(loadCSS); 7680 if( loadCSS.length > 0 ) { 7681 loadCSS.forEach( function(css) { 7682 __core.loadCSS(css); 7683 }); 7684 } 7685 } 7686 7687 if( loadJS ) { 7688 loadJS = JSON.parse(loadJS); 7689 if( loadJS.length > 0 ) { 7690 loadJS.forEach( function(js) { 7691 __core.loadJS(js); 7692 }); 7693 } 7694 } 7695 }; 7696 7697 return { 7698 init: function(selector) { 7699 if( __core.getSelector(selector, false, false).length < 1 ){ 7700 return true; 7701 } 7702 7703 __core.initFunction({ class: 'has-plugin-ajaxtrigger', event: 'pluginAjaxTriggerReady' }); 7704 7705 selector = __core.getSelector( selector, false ); 7706 if( selector.length < 1 ){ 7707 return true; 7708 } 7709 7710 selector.forEach( function(el) { 7711 var params = { 7712 trigger: el, 7713 loader: el.getAttribute('data-ajax-loader'), 7714 triggerType: el.getAttribute('data-ajax-trigger-type') || 'click', 7715 loadDelay: el.getAttribute('data-ajax-load-delay') || 2222, 7716 container: document.querySelector( el.getAttribute('data-ajax-container') ), 7717 contentPlacement: el.getAttribute('data-ajax-insertion') || 'append', 7718 triggerHide: el.getAttribute('data-ajax-trigger-hide') || 'true', 7719 triggerDisable: el.getAttribute('data-ajax-trigger-disable') || 'true', 7720 loadCSS: el.getAttribute('data-ajax-loadcss') || false, 7721 loadJS: el.getAttribute('data-ajax-loadjs') || false, 7722 } 7723 7724 if( params.triggerType == 'load' ) { 7725 setTimeout( function() { 7726 _load(params); 7727 }, Number(params.loadDelay)); 7728 } else { 7729 params.trigger.onclick = function(e) { 7730 e.preventDefault(); 7731 _load(params); 7732 }; 7733 } 7734 }); 7735 } 7736 }; 7737 }(), 7738 // AjaxTrigger Functions End 7739 7740 /** 7741 * -------------------------------------------------------------------------- 7742 * VideoFacade Functions Start 7743 * -------------------------------------------------------------------------- 7744 */ 7745 VideoFacade: function() { 7746 return { 7747 init: function(selector) { 7748 if( __core.getSelector(selector, false, false).length < 1 ){ 7749 return true; 7750 } 7751 7752 __core.initFunction({ class: 'has-plugin-videofacade', event: 'pluginVideoFacadeReady' }); 7753 7754 selector = __core.getSelector( selector, false ); 7755 7756 selector.forEach( function(element) { 7757 element.onclick = function(e) { 7758 e.preventDefault(); 7759 7760 var videoContent = element.getAttribute('data-video-html'), 7761 videoRatio = element.getAttribute('data-video-ratio') || 'ratio ratio-16x9', 7762 videoPreviewEl = element.querySelector('.video-facade-preview'), 7763 videoContentEl = element.querySelector('.video-facade-content'); 7764 7765 videoPreviewEl.classList.add('d-none'); 7766 videoContentEl.innerHTML += videoContent; 7767 7768 videoRatio.split(" ").forEach( function(ratioClass) { 7769 videoContentEl.classList.add(ratioClass); 7770 }); 7771 }; 7772 }); 7773 } 7774 }; 7775 }(), 7776 // VideoFacade Functions End 7777 7778 /** 7779 * -------------------------------------------------------------------------- 7780 * SchemeToggler Functions Start 7781 * -------------------------------------------------------------------------- 7782 */ 7783 SchemeToggle: function() { 7784 var _toggle = function(element, sibling=false, action=false) { 7785 var bodyClassToggle = element.getAttribute('data-bodyclass-toggle') || 'dark'; 7786 var classAdd = element.getAttribute('data-add-class') || 'scheme-toggler-active'; 7787 var classRemove = element.getAttribute('data-remove-class') || 'scheme-toggler-active'; 7788 var htmlAdd = element.getAttribute('data-add-html'); 7789 var htmlRemove = element.getAttribute('data-remove-html'); 7790 var toggleType = element.getAttribute('data-type') || 'trigger'; 7791 var remember = element.getAttribute('data-remember') || 'false'; 7792 7793 if( __core.contains( bodyClassToggle, __core.getVars.elBody ) ) { 7794 __core.classesFn('add', classAdd, element); 7795 __core.classesFn('remove', classRemove, element); 7796 element.classList.add('body-state-toggled'); 7797 7798 // Set Storage 7799 if( remember == "true" && action ) { 7800 localStorage.setItem('cnvsBodyColorScheme', 'dark'); 7801 } 7802 7803 if( 'checkbox' == toggleType && sibling ) { 7804 element.querySelector('input[type=checkbox]').checked = true; 7805 } else { 7806 if( htmlAdd ) { 7807 element.innerHTML = htmlAdd; 7808 } 7809 } 7810 } else { 7811 __core.classesFn('add', classRemove, element); 7812 __core.classesFn('remove', classAdd, element); 7813 element.classList.remove('body-state-toggled'); 7814 7815 // Remove Storage 7816 if( remember == "true" && action ) {
7817 localStorage.removeItem('cnvsBodyColorScheme'); 7818 } 7819 7820 if( 'checkbox' == toggleType && sibling ) { 7821 element.querySelector('input[type=checkbox]').checked = false; 7822 } else { 7823 if( htmlRemove ) { 7824 element.innerHTML = htmlRemove; 7825 } 7826 } 7827 } 7828 7829 __base.setBSTheme(); 7830 __modules.dataClasses(); 7831 }; 7832 7833 return { 7834 init: function(selector) { 7835 if( __core.getSelector(selector, false, false).length < 1 ){ 7836 return true; 7837 } 7838 7839 __core.initFunction({ class: 'has-plugin-schemetoggler', event: 'pluginSchemeTogglerReady' }); 7840 7841 selector = __core.getSelector( selector, false ); 7842 if( selector.length < 1 ) { 7843 return false; 7844 } 7845 7846 selector.forEach( function(element) { 7847 var bodyClassToggle = element.getAttribute('data-bodyclass-toggle') || 'dark'; 7848 var toggleType = element.getAttribute('data-type') || 'trigger'; 7849 7850 _toggle(element); 7851 7852 if( 'checkbox' == toggleType ) { 7853 var elementCheck = element.querySelector('input[type=checkbox]'); 7854 7855 elementCheck.addEventListener( 'change', function() { 7856 __core.classesFn('toggle', bodyClassToggle, __core.getVars.elBody); 7857 _toggle(element, false, true); 7858 7859 __core.siblings(element, selector).forEach( function(el) { 7860 _toggle(el, true); 7861 }); 7862 }); 7863 } else { 7864 element.onclick = function(e) { 7865 e.preventDefault(); 7866 7867 __core.classesFn('toggle', bodyClassToggle, __core.getVars.elBody); 7868 _toggle(element, false, true); 7869 7870 __core.siblings(element, selector).forEach( function(el) { 7871 _toggle(el, true); 7872 }); 7873 }; 7874 } 7875 }); 7876 } 7877 }; 7878 }(), 7879 // SchemeToggler Functions End 7880 7881 /** 7882 * -------------------------------------------------------------------------- 7883 * Clipboard Functions Start 7884 * -------------------------------------------------------------------------- 7885 */ 7886 Clipboard: function() { 7887 return { 7888 init: function(selector) { 7889 if( __core.getSelector(selector, false, false).length < 1 ){ 7890 return true; 7891 } 7892 7893 __core.isFuncTrue( function() { 7894 return typeof ClipboardJS !== 'undefined'; 7895 }).then( function(cond) { 7896 if( !cond ) { 7897 return false; 7898 } 7899 7900 __core.initFunction({ class: 'has-plugin-clipboard', event: 'pluginClipboardReady' }); 7901 7902 selector = __core.getSelector( selector, false ); 7903 if( selector.length < 1 ){ 7904 return true; 7905 } 7906 7907 var clipboards = [], 7908 count = 0; 7909 7910 selector.forEach( function(el) { 7911 var trigger = el.querySelector('button'), 7912 triggerText = trigger.innerHTML, 7913 copiedtext = trigger.getAttribute('data-copied') || 'Copied', 7914 copiedTimeout = trigger.getAttribute('data-copied-timeout') || 5000; 7915 7916 clipboards[count] = new ClipboardJS( trigger, { 7917 target: function(content) { 7918 return content.closest('.clipboard-copy').querySelector('code'); 7919 } 7920 }); 7921 7922 clipboards[count].on('success', function(e) { 7923 trigger.innerHTML = copiedtext; 7924 trigger.disabled = true; 7925 7926 setTimeout( function() { 7927 trigger.innerHTML = triggerText; 7928 trigger.disabled = false; 7929 }, Number(copiedTimeout)); 7930 }); 7931 7932 count++; 7933 }); 7934 }); 7935 } 7936 }; 7937 }(), 7938 // Clipboard Functions End 7939 7940 /** 7941 * -------------------------------------------------------------------------- 7942 * CodeHighlight Functions Start 7943 * -------------------------------------------------------------------------- 7944 */ 7945 CodeHighlight: function() { 7946 return { 7947 init: function(selector) { 7948 if( __core.getSelector(selector, false, false).length < 1 ){ 7949 return true; 7950 } 7951 7952 __core.loadCSS({ file: 'components/prism.css', id: 'canvas-prism-css', cssFolder: true }); 7953 __core.isFuncTrue( function() { 7954 return typeof Prism !== 'undefined'; 7955 }).then( function(cond) { 7956 if( !cond ) { 7957 return false; 7958 } 7959 7960 __core.initFunction({ class: 'has-plugin-codehighlight', event: 'pluginCodeHighlightReady' }); 7961 7962 selector = __core.getSelector( selector, false ); 7963 if( selector.length < 1 ){ 7964 return true; 7965 } 7966 7967 selector.forEach( function(el) { 7968 Prism.highlightElement( el.querySelector('code') ); 7969 }); 7970 }); 7971 } 7972 }; 7973 }(), 7974 // CodeHighlight Functions End 7975 7976 /** 7977 * -------------------------------------------------------------------------- 7978 * Tips Functions Start 7979 * -------------------------------------------------------------------------- 7980 */ 7981 Tips: function() { 7982 return { 7983 init: function(selector) { 7984 __core.isFuncTrue( function() { 7985 return typeof bootstrap !== 'undefined'; 7986 }).then( function(cond) { 7987 if( !cond ) { 7988 return false;
7989 } 7990 7991 if( typeof cnvsTips === "undefined" || cnvsTips.length < 1 ) { 7992 return false; 7993 } 7994 7995 __core.initFunction({ class: 'has-plugin-tips', event: 'pluginTipsReady' }); 7996 7997 var body = __core.getVars.elBody.classList; 7998 7999 if( body.contains('init-plugin-tips') ) { 8000 return false; 8001 } 8002 8003 var randomIndex = Math.floor(Math.random() * cnvsTips.length); 8004 var randomTip = cnvsTips[randomIndex]; 8005 8006 var tipsEl = document.getElementById('cnvs-tips-element'); 8007 8008 if( !tipsEl ) { 8009 var tipsHTML = '<div class="position-fixed bottom-0 end-0 p-3 text-start" style="z-index: 699;"><div id="cnvs-tips-element" data-notify-trigger="custom" data-notify-target="#cnvs-tips-element" data-notify-timeout="7777" class="toast hide p-3" role="alert" aria-live="assertive" aria-atomic="true" style="--bs-toast-max-width:400px;--bs-toast-bg: rgba(var(--bs-body-bg-rgb),.925);"><div class="toast-header bg-transparent border-0 mb-0 align-items-center pb-1"><h5 id="cnvs-tips-element-title" class="me-auto fs-6 fw-semibold mb-0"></h5><button type="button" class="btn-close me-1" data-bs-dismiss="toast" aria-label="Close"></button></div><div id="cnvs-tips-element-content" class="toast-body small pt-1"></div><a href="#" id="cnvs-tips-element-disable" class="text-muted text-decoration-underline op-06 h-op-08 px-2 pb-2 ms-1 mt-1 d-inline-block" data-cookies="true" style="font-size:.75rem;text-underline-offset:3px;">Disable Random Tips</a></div></div>'; 8010 8011 __core.getVars.elWrapper.insertAdjacentHTML('beforeend', tipsHTML); 8012 tipsEl = document.getElementById('cnvs-tips-element'); 8013 } 8014 8015 var tipsTitle = document.getElementById('cnvs-tips-element-title'); 8016 var tipsContent = document.getElementById('cnvs-tips-element-content'); 8017 var tipsDisable = document.getElementById('cnvs-tips-element-disable'); 8018 var tipsEnable = document.getElementById('cnvs-tips-element-enable'); 8019 8020 tipsTitle.innerHTML = randomTip.title; 8021 tipsContent.innerHTML = randomTip.content; 8022 8023 if( tipsDisable ) { 8024 tipsDisable.onclick = function(e) { 8025 e.preventDefault(); 8026 8027 var tipsToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('cnvs-tips-element')); 8028 tipsToast.hide(); 8029 8030 __core.cookie.set('__cnvs_tips_cookies', 'hide', 1); 8031 }; 8032 } 8033 8034 if( tipsEnable ) { 8035 tipsEnable.onclick = function(e) { 8036 e.preventDefault(); 8037 8038 __core.cookie.remove('__cnvs_tips_cookies'); 8039 window.location.reload(); 8040 }; 8041 } 8042 8043 (function(){ 8044 var enabled = true; 8045 8046 if( __core.cookie.get('__cnvs_tips_cookies' ) == 'hide' ) { 8047 enabled = false; 8048 } 8049 8050 if( enabled ) { 8051 body.add('init-plugin-tips'); 8052 setTimeout(function(){ 8053 __modules.notifications(tipsEl); 8054 }, Math.floor(Math.random() * 5000)); 8055 } 8056 })(); 8057 }); 8058 } 8059 }; 8060 }(), 8061 // Tips Functions End 8062 8063 /** 8064 * -------------------------------------------------------------------------- 8065 * TextSplitter Functions Start 8066 * -------------------------------------------------------------------------- 8067 */ 8068 TextSplitter: function() { 8069 var _getText = function(element) { 8070 return element.textContent || element.innerText; 8071 }; 8072 8073 var _joiner = function(arr, joiner='span', glue=' ') { 8074 return arr.map( function(chunk) { 8075 return '<'+ joiner +'>' + chunk + '</'+ joiner +'>'; 8076 }).join(glue); 8077 }; 8078 8079 var _words = function(element, joiner='span') { 8080 return _joiner(_getText(element).split(' '), joiner, ' '); 8081 }; 8082 8083 var _letters = function(element, joiner='span') { 8084 return _joiner(_getText(element).split(''), joiner, ''); 8085 }; 8086 8087 var _splitter = function(el, type = 'word') { 8088 el.innerHTML = type == 'letter' ? _letters(el) : _words(el); 8089 8090 el.querySelectorAll('span')?.forEach( function(elem, index) { 8091 elem.style.setProperty('--cnvs-split-index', index + 1); 8092 }); 8093 }; 8094 8095 return { 8096 init: function(selector) { 8097 if( __core.getSelector(selector, false, false).length < 1 ){ 8098 return true; 8099 } 8100 8101 selector = __core.getSelector( selector, false ); 8102 if( selector.length < 1 ){ 8103 return true; 8104 } 8105 8106 selector.forEach( function(el) { 8107 var type = el.getAttribute('data-split-type') || 'word'; 8108 8109 _splitter(el, type); 8110 }); 8111 } 8112 }; 8113 }(), 8114 // TextSplitter Functions End 8115 8116 /** 8117 * -------------------------------------------------------------------------- 8118 * MediaActions Functions Start 8119 * -------------------------------------------------------------------------- 8120 */ 8121 MediaActions: function() { 8122 var _pauseEv = ['ended', 'error', 'pause', 'seeking', 'waiting']; 8123 var _playEv = ['play', 'playing', 'timeupdate']; 8124 8125 var _volume = function(mediaEl) { 8126 var mediaWrap = mediaEl.closest('.media-wrap'); 8127 8128 if( mediaEl.volume < 0.1 || mediaEl.muted == true ) { 8129 mediaWrap.classList.add('media-is-muted'); 8130 } else { 8131 mediaWrap.classList.remove('media-is-muted'); 8132 } 8133 }; 8134 8135 var _time = function(duration) { 8136 var minutes = (duration / 60).toFixed(0); 8137 var seconds = (duration % 60).toFixed(0); 8138 8139 return minutes + ':' + (seconds < 10 ? '0' + seconds : seconds); 8140 }; 8141 8142 return { 8143 init: function(selector) { 8144 if( __core.getSelector(selector, false, false).length < 1 ){ 8145 return true; 8146 } 8147 8148 __core.initFunction({ class: 'has-plugin-mediaactions', event: 'pluginMediaActionsReady' }); 8149 8150 selector = __core.getSelector( selector, false ); 8151 if( selector.length < 1 ){ 8152 return true; 8153 } 8154 8155 selector.forEach( function(mediaWrap) { 8156 var mediaEl = mediaWrap.querySelector('video,audio'); 8157 var mediaTrigger = mediaWrap.querySelector('.media-trigger-playback'); 8158 var volumeTrigger = mediaWrap.querySelector('.media-trigger-volume'); 8159 var mediaDuration = mediaWrap.querySelector('.media-duration'); 8160 8161 if( !mediaEl ) { 8162 return true; 8163 } 8164 8165 _pauseEv.forEach( function(_event) { 8166 mediaEl.addEventListener(_event, function(){ 8167 mediaWrap.classList.remove('media-is-playing'); 8168 _volume(mediaEl); 8169 }); 8170 }); 8171 8172 _playEv.forEach( function(_event) { 8173 mediaEl.addEventListener(_event, function(){ 8174 mediaWrap.classList.add('media-is-playing'); 8175 _volume(mediaEl); 8176 8177 if( mediaDuration ) { 8178 mediaDuration.innerHTML = _time(mediaEl.currentTime); 8179 } 8180 }); 8181 }); 8182 8183 mediaEl.addEventListener('volumechange', function(){ 8184 _volume(mediaEl); 8185 }); 8186 8187 var ifLoaded = setInterval( function(){ 8188 if( mediaEl.readyState === 4 ) { 8189 if( mediaDuration ) { 8190 mediaDuration.innerHTML = _time(mediaEl.duration); 8191 } 8192 8193 clearInterval(ifLoaded); 8194 } 8195 }, 1000); 8196 8197 if( mediaTrigger ) {
8198 mediaTrigger.onclick = function(e) { 8199 e.preventDefault(); 8200 8201 if (mediaEl.paused) { 8202 mediaEl.play(); 8203 } else { 8204 mediaEl.pause(); 8205 } 8206 }; 8207 } 8208 8209 if( volumeTrigger ) { 8210 volumeTrigger.onclick = function(e) { 8211 e.preventDefault(); 8212 8213 if (mediaEl.muted) { 8214 mediaEl.muted = false; 8215 } else { 8216 mediaEl.muted = true; 8217 } 8218 }; 8219 } 8220 }); 8221 } 8222 }; 8223 }(), 8224 // MediaActions Functions End 8225 8226 /** 8227 * -------------------------------------------------------------------------- 8228 * ViewportDetect Functions Start 8229 * -------------------------------------------------------------------------- 8230 */ 8231 ViewportDetect: function() { 8232 var _setBSTheme = function(target) { 8233 if( target.classList.contains('dark') ) { 8234 target.setAttribute('data-bs-theme', 'dark'); 8235 } else { 8236 target.removeAttribute('data-bs-theme'); 8237 } 8238 }; 8239 8240 return { 8241 init: function(selector) { 8242 if( __core.getSelector(selector, false, false).length < 1 ){ 8243 return true; 8244 } 8245 8246 __core.initFunction({ class: 'has-plugin-viewportdetect', event: 'pluginViewportDetectReady' }); 8247 8248 selector = __core.getSelector( selector, false ); 8249 if( selector.length < 1 ){ 8250 return true; 8251 } 8252 8253 selector.forEach( function(el) { 8254 var elDelay = el.getAttribute('data-delay') || 0; 8255 var elClass = el.getAttribute('data-viewport-class') || ""; 8256 var elClassOut = el.getAttribute('data-viewport-class-out') || ""; 8257 var elClassTarget = el.getAttribute('data-viewport-class-target'); 8258 var elThreshold = el.getAttribute('data-viewport-threshold') || "0"; 8259 var elRootMargin = el.getAttribute('data-viewport-rootmargin') || "0px"; 8260 8261 elClass = elClass.split(" "); 8262 elClassOut = elClassOut.split(" "); 8263 8264 var hasDark = false; 8265 8266 if( elClass.includes('dark') || elClassOut.includes('dark') ) { 8267 hasDark = true; 8268 } 8269 8270 elClassTarget = elClassTarget ? document.querySelector(elClassTarget) : false; 8271 8272 var observer = new IntersectionObserver( function(el) { 8273 el.forEach( function(entry) { 8274 var elTarget = entry.target; 8275 8276 if( !elClassTarget ) { 8277 elClassTarget = elTarget; 8278 } 8279 8280 if( entry.isIntersecting ) { 8281 setTimeout( function() { 8282 elTarget.classList.add('is-in-viewport'); 8283 8284 elClass.forEach( function(_class) { 8285 _class && elClassTarget.classList.add(_class); 8286 }); 8287 8288 elClassOut.forEach( function(_class) { 8289 _class && elClassTarget.classList.remove(_class); 8290 }); 8291 8292 hasDark && _setBSTheme(elClassTarget); 8293 }, Number(elDelay)); 8294 } else { 8295 elTarget.classList.remove('is-in-viewport'); 8296 8297 elClass.forEach( function(_class) { 8298 _class && elClassTarget.classList.remove(_class); 8299 }); 8300 8301 elClassOut.forEach( function(_class) { 8302 _class && elClassTarget.classList.add(_class); 8303 }); 8304 8305 hasDark && _setBSTheme(elClassTarget); 8306 } 8307 }); 8308 }, { 8309 threshold: parseFloat(elThreshold), 8310 rootMargin: elRootMargin, 8311 }); 8312 8313 observer.observe(el); 8314 }); 8315 } 8316 }; 8317 }(), 8318 // ViewportDetect Functions End 8319 8320 /** 8321 * -------------------------------------------------------------------------- 8322 * ScrollDetect Functions Start 8323 * -------------------------------------------------------------------------- 8324 */ 8325 ScrollDetect: function() { 8326 var _detects = []; 8327 8328 var _percent = function(params) { 8329 var percent = 0, 8330 ratio = 0, 8331 start = 0, 8332 end = 0; 8333 8334 var onScroll = function(params) { 8335 fastdom.measure( function(){ 8336 var position = window.scrollY; 8337 8338 if( position >= params.start && position <= params.end ) { 8339 var startViewScroll = position - params.start; 8340 var offsetScroll = position - params.offset; 8341 percent = (startViewScroll / params.range.full) * 100; 8342 start = (startViewScroll / params.range.start); 8343 8344 if( position > (params.start + params.height) && position < (params.offset) ) { 8345 start = 1; 8346 end = 0; 8347 } else if( position >= (params.offset) ) { 8348 start = 1; 8349 end = (offsetScroll / params.range.end); 8350 } else { 8351 end = 0; 8352 } 8353 8354 ratio = start - end; 8355 } else if( position > params.end ) { 8356 percent = 100; 8357 ratio = 0; 8358 start = end = 1; 8359 } else { 8360 percent = ratio = start = end = 0; 8361 } 8362 8363 if( ratio > 0 ) { 8364 params.elem.classList.add('scroll-detect-inview'); 8365 } else { 8366 params.elem.classList.remove('scroll-detect-inview'); 8367 } 8368 8369 if( start > 0 && start < 1 ) { 8370 params.elem.classList.add('scroll-detect-inview-start'); 8371 } else { 8372 params.elem.classList.remove('scroll-detect-inview-start'); 8373 } 8374 8375 if( end > 0 && end < 1 ) { 8376 params.elem.classList.add('scroll-detect-inview-end'); 8377 } else { 8378 params.elem.classList.remove('scroll-detect-inview-end'); 8379 } 8380 8381 params.elem.style.setProperty('--cnvs-scroll-percent', percent); 8382 params.elem.style.setProperty('--cnvs-scroll-ratio', ratio); 8383 params.elem.style.setProperty('--cnvs-scroll-start', start); 8384 params.elem.style.setProperty('--cnvs-scroll-end', end); 8385 }); 8386 }; 8387 8388 onScroll(params); 8389 }; 8390 8391 var _handle = function() {
8392 _detects.forEach( function(settings) { 8393 _percent(settings); 8394 }); 8395 } 8396 8397 return { 8398 init: function(selector) { 8399 if( __core.getSelector(selector, false, false).length < 1 ){ 8400 return true; 8401 } 8402 8403 __core.isFuncTrue( function() { 8404 return typeof fastdom !== 'undefined'; 8405 }).then( function(cond) { 8406 if( !cond ) { 8407 return false; 8408 } 8409 8410 __core.initFunction({ class: 'has-plugin-scrolldetect', event: 'pluginScrollDetectReady' }); 8411 8412 selector = __core.getSelector( selector, false ); 8413 if( selector.length < 1 ){ 8414 return true; 8415 } 8416 8417 var resizeObserver = new ResizeObserver( function(entries) { 8418 entries.forEach( function(entry) { 8419 if( !doing ) { 8420 var doing = setTimeout( function() { 8421 initParams(selector); 8422 doing = false; 8423 }, 333); 8424 } 8425 }); 8426 }); 8427 8428 var initParams = function(selector) { 8429 _detects = []; 8430 8431 selector.forEach( function(elem) { 8432 var elemWidth = elem.offsetWidth, 8433 elemHeight = elem.offsetHeight, 8434 elemOffset = __core.offset(elem).top, 8435 viewportHeight = __core.getVars.viewport.height, 8436 includeWidth = elem.getAttribute('data-include-width'), 8437 includeHeight = elem.getAttribute('data-include-height'), 8438 includeOffset = elem.getAttribute('data-include-offset'), 8439 scrollOffset = elem.getAttribute('data-scroll-offset'), 8440 parallaxRatio = elem.getAttribute('data-parallax-ratio'), 8441 params = {}; 8442 8443 if( scrollOffset ) { 8444 scrollOffset = scrollOffset.split('%'); 8445 8446 if( scrollOffset.length > 1 ) { 8447 elemOffset = elemOffset + (viewportHeight * Number(scrollOffset[0]) * 0.01); 8448 } else if( scrollOffset.length == 1 && scrollOffset[0] ) { 8449 elemOffset = elemOffset + Number(scrollOffset[0]); 8450 } 8451 } 8452 8453 var scrollStart = elemOffset - viewportHeight, 8454 scrollEnd = elemOffset + elemHeight, 8455 scrollRange = scrollEnd - scrollStart; 8456 8457 params.elem = elem; 8458 params.start = scrollStart; 8459 params.end = scrollEnd; 8460 params.range = { 8461 start: elemHeight, 8462 end: elemHeight, 8463 full: scrollRange, 8464 }; 8465 params.width = elemWidth; 8466 params.height = elemHeight; 8467 params.offset = elemOffset; 8468 8469 if( includeWidth == 'true' || (elem.classList.contains('parallax') && elem.getAttribute('data-parallax-direction') == 'horizontal') ) { 8470 elem.style.setProperty('--cnvs-scroll-width', params.width); 8471 } 8472 8473 if( includeHeight == 'true' || (elem.classList.contains('parallax') && elem.getAttribute('data-parallax-direction') != 'horizontal') ) { 8474 elem.style.setProperty('--cnvs-scroll-height', params.height); 8475 } 8476 8477 if( includeOffset == 'true' ) { 8478 elem.style.setProperty('--cnvs-scroll-offset', params.offset); 8479 } 8480 8481 if( !isNaN(parallaxRatio) ) { 8482 elem.style.setProperty('--cnvs-parallax-ratio', parallaxRatio); 8483 } 8484 8485 _percent(params); 8486 _detects.push(params); 8487 8488 resizeObserver.observe(elem); 8489 }); 8490 }; 8491 8492 initParams(selector); 8493 _handle(); 8494 8495 // var ticking = false; 8496 window.addEventListener("scroll", function(){ 8497 fastdom.mutate( function(){ 8498 _handle(); 8499 }); 8500 // if (!ticking) { 8501 // window.requestAnimationFrame( function(){ 8502 // _handle(); 8503 // ticking = false; 8504 // }); 8505 // ticking = true; 8506 // } 8507 }, {passive: true}); 8508 8509 resizeObserver.observe(document.documentElement); 8510 }); 8511 } 8512 }; 8513 }(), 8514 // ScrollDetect Functions End 8515 8516 /** 8517 * -------------------------------------------------------------------------- 8518 * FontSizer Functions Start 8519 * -------------------------------------------------------------------------- 8520 */ 8521 FontSizer: function() { 8522 return { 8523 init: function(selector) { 8524 if( __core.getSelector(selector, false, false).length < 1 ){ 8525 return true; 8526 } 8527 8528 __core.initFunction({ class: 'has-plugin-fontsizer', event: 'pluginFontSizerReady' }); 8529 8530 selector = __core.getSelector( selector, false ); 8531 if( selector.length < 1 ){ 8532 return true; 8533 } 8534 8535 selector.forEach( function(elem) { 8536 var target = elem.getAttribute('data-target'); 8537 var targetEl = document.querySelector(target); 8538 var step = elem.getAttribute('data-step') || 10; 8539 var min = elem.getAttribute('data-min') || 12; 8540 var max = elem.getAttribute('data-max') || 24; 8541 var defaultSize = Number(document.defaultView.getComputedStyle(targetEl).getPropertyValue('font-size').split('px')[0]); 8542 var percent = defaultSize * Number(step) * .01; 8543 8544 var defaultBtn = elem.querySelector('.font-size-default'); 8545 var minusBtn = elem.querySelector('.font-size-minus'); 8546 var plusBtn = elem.querySelector('.font-size-plus'); 8547 8548 if( defaultBtn ) { 8549 defaultBtn.onclick = function(e) { 8550 e.preventDefault(); 8551 targetEl.style.fontSize = defaultSize + 'px'; 8552 }; 8553 } 8554
8555 if( minusBtn ) { 8556 elem.querySelector('.font-size-minus').onclick = function(e) { 8557 e.preventDefault(); 8558 8559 var current = Number(document.defaultView.getComputedStyle(targetEl).getPropertyValue('font-size').split('px')[0]); 8560 var newSize = current - percent; 8561 if( newSize >= min ) { 8562 targetEl.style.fontSize = newSize + 'px'; 8563 } 8564 }; 8565 } 8566 8567 if( plusBtn ) { 8568 elem.querySelector('.font-size-plus').onclick = function(e) { 8569 e.preventDefault(); 8570 8571 var current = Number(document.defaultView.getComputedStyle(targetEl).getPropertyValue('font-size').split('px')[0]); 8572 var newSize = current + percent; 8573 if( newSize <= max ) { 8574 targetEl.style.fontSize = newSize + 'px'; 8575 } 8576 }; 8577 } 8578 }); 8579 } 8580 }; 8581 }(), 8582 // FontSizer Functions End 8583 8584 /** 8585 * -------------------------------------------------------------------------- 8586 * Hover3D Functions Start 8587 * -------------------------------------------------------------------------- 8588 */ 8589 Hover3D: function() { 8590 return { 8591 init: function(selector) { 8592 if( __core.getSelector(selector, false, false).length < 1 ){ 8593 return true; 8594 } 8595 8596 __core.initFunction({ class: 'has-plugin-hover3d', event: 'pluginHover3DReady' }); 8597 8598 selector = __core.getSelector( selector, false ); 8599 if( selector.length < 1 ){ 8600 return true; 8601 } 8602 8603 selector.forEach( function(el) { 8604 var height = el.clientHeight; 8605 var width = el.clientWidth; 8606 8607 el.addEventListener( 'mousemove', function(e) { 8608 var xVal = e.layerX; 8609 var yVal = e.layerY; 8610 8611 var yRotation = 20 * ((xVal - width / 2) / width); 8612 var xRotation = -20 * ((yVal - height / 2) / height); 8613 8614 var transform = 'perspective(500px) scale(1.1) rotateX(' + xRotation + 'deg) rotateY(' + yRotation + 'deg) rotateZ(0)'; 8615 8616 el.style.transform = transform; 8617 }); 8618 8619 el.addEventListener( 'mouseout', function() { 8620 el.style.transform = 'perspective(500px) scale(1) rotateX(0) rotateY(0) rotateZ(0)'; 8621 }); 8622 8623 el.addEventListener( 'mousedown', function() { 8624 el.style.transform = 'perspective(500px) scale(0.9) rotateX(0) rotateY(0) rotateZ(0)'; 8625 }); 8626 8627 el.addEventListener( 'mouseup', function() { 8628 el.style.transform = 'perspective(500px) scale(1.1) rotateX(0) rotateY(0) rotateZ(0)'; 8629 }); 8630 }); 8631 } 8632 }; 8633 }(), 8634 // Hover3D Functions End 8635 8636 /** 8637 * -------------------------------------------------------------------------- 8638 * Buttons Functions Start 8639 * -------------------------------------------------------------------------- 8640 */ 8641 Buttons: function() { 8642 return { 8643 init: function(selector) { 8644 if( __core.getSelector(selector, false, false).length < 1 ){ 8645 return true; 8646 } 8647 8648 __core.initFunction({ class: 'has-plugin-buttons', event: 'pluginButtonsReady' }); 8649 8650 selector = __core.getSelector( selector, false ); 8651 if( selector.length < 1 ){ 8652 return true; 8653 } 8654 8655 selector.forEach( function(el){ 8656 var text = el.innerHTML; 8657 el.innerHTML = ''; 8658 8659 var inner = document.createElement('div'); 8660 inner.classList.add('button-inner'); 8661 8662 var span = document.createElement('span'); 8663 8664 span.innerHTML = text; 8665 8666 inner.append(span); 8667 8668 var span2 = span.cloneNode(true); 8669 span.after(span2); 8670 8671 el.append(inner); 8672 }); 8673 } 8674 }; 8675 }(), 8676 // Buttons Functions End 8677 8678 /** 8679 * -------------------------------------------------------------------------- 8680 * BSComponents Functions Start 8681 * -------------------------------------------------------------------------- 8682 */ 8683 BSComponents: function() { 8684 return { 8685 init: function(selector) { 8686 if( __core.getSelector(selector, false, false).length < 1 ){ 8687 return true; 8688 } 8689 8690 __core.isFuncTrue( function() { 8691 return typeof bootstrap !== 'undefined'; 8692 }).then( function(cond) { 8693 if( !cond ) { 8694 return false; 8695 } 8696 8697 __core.initFunction({ class: 'has-plugin-bscomponents', event: 'pluginBsComponentsReady' }); 8698 8699 selector = __core.getSelector( selector, false ); 8700 if( selector.length < 1 ){ 8701 return true; 8702 } 8703 8704 var tooltips = [].slice.call(__core.getVars.baseEl.querySelectorAll('[data-bs-toggle="tooltip"]')); 8705 var tooltipList = tooltips.map( function(tooltipEl) { 8706 return new bootstrap.Tooltip(tooltipEl, {container: 'body'}); 8707 }); 8708 8709 var popovers = [].slice.call(__core.getVars.baseEl.querySelectorAll('[data-bs-toggle="popover"]'));
8710 var popoverList = popovers.map( function(popoverEl) { 8711 return new bootstrap.Popover(popoverEl, {container: 'body'}); 8712 }); 8713 8714 var tabs = document.querySelectorAll('[data-bs-toggle="tab"],[data-bs-toggle="pill"]'); 8715 8716 var tabTargetShow = function(target) { 8717 var tabTrigger = new bootstrap.Tab(target); 8718 tabTrigger.show(); 8719 if( __core.getVars.hash && document.querySelector('[data-bs-target="'+__core.getVars.hash+'"]') ) { 8720 setTimeout( function(){ 8721 __core.scrollTo((__core.offset(target).top - __core.getVars.topScrollOffset - 20), 0, false, 'smooth'); 8722 }, 1000); 8723 } 8724 }; 8725 8726 document.querySelectorAll('.canvas-tabs').forEach( function(el) { 8727 var activeTab = el.getAttribute('data-active'); 8728 8729 if( activeTab ) { 8730 activeTab = Number(activeTab) - 1; 8731 tabTargetShow(el.querySelectorAll('[data-bs-target]')[activeTab]); 8732 } 8733 }); 8734 8735 document.querySelectorAll('.tab-hover').forEach( function(el) { 8736 el.querySelectorAll('[data-bs-target]').forEach( function(tab) { 8737 tab.addEventListener( 'mouseenter', function() { 8738 tabTargetShow(tab); 8739 }); 8740 }); 8741 }); 8742 8743 if( __core.getVars.hash && document.querySelector('[data-bs-target="'+__core.getVars.hash+'"]') ) { 8744 tabTargetShow(document.querySelector('[data-bs-target="'+__core.getVars.hash+'"]')); 8745 } 8746
8747 tabs.forEach( function(el) { 8748 el.addEventListener('shown.bs.tab', function(e) { 8749 if( !el.classList.contains('container-modules-loaded') ) { 8750 var tabContent = el.getAttribute('data-bs-target') ? el.getAttribute('data-bs-target') : el.getAttribute('href'); 8751 __core.runContainerModules(document.querySelector(tabContent)); 8752 8753 document.querySelector(tabContent).querySelectorAll('.flexslider').forEach( function(flex) { 8754 setTimeout( function() { 8755 jQuery(flex).find('.slide').resize(); 8756 }, 500); 8757 }); 8758 8759 el.classList.add('container-modules-loaded'); 8760 } 8761 }); 8762 }); 8763 8764 document.querySelectorAll('.style-msg .btn-close').forEach( function(el) { 8765 el.onclick = function(e) { 8766 e.preventDefault(); 8767 8768 el.closest( '.style-msg' ).classList.add('d-none'); 8769 }; 8770 }); 8771 }); 8772 } 8773 }; 8774 }(), 8775 // BSComponents Functions End 8776 }; 8777})));
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.