1/* 2Name: Theme Base 3Written by: Okler Themes - (http://www.okler.net) 4Theme Version: 7.3.0 5*/ 6 7// Theme 8window.theme = {}; 9 10// Theme Common Functions 11window.theme.fn = { 12 13 getOptions: function(opts) { 14 15 if (typeof(opts) == 'object') { 16 17 return opts; 18 19 } else if (typeof(opts) == 'string') { 20 21 try { 22 return JSON.parse(opts.replace(/'/g,'"').replace(';','')); 23 } catch(e) { 24 return {}; 25 } 26 27 } else { 28 29 return {}; 30 31 } 32 33 } 34 35}; 36 37// Animate 38(function(theme, $) { 39 40 theme = theme || {}; 41 42 var instanceName = '__animate'; 43 44 var PluginAnimate = function($el, opts) { 45 return this.initialize($el, opts); 46 }; 47 48 PluginAnimate.defaults = { 49 accX: 0, 50 accY: -80, 51 delay: 100, 52 duration: '750ms' 53 }; 54 55 PluginAnimate.prototype = { 56 initialize: function($el, opts) { 57 if ($el.data(instanceName)) { 58 return this; 59 } 60 61 this.$el = $el; 62 63 this 64 .setData() 65 .setOptions(opts) 66 .build(); 67 68 return this; 69 }, 70 71 setData: function() { 72 this.$el.data(instanceName, this); 73 74 return this; 75 }, 76 77 setOptions: function(opts) { 78 this.options = $.extend(true, {}, PluginAnimate.defaults, opts, { 79 wrapper: this.$el 80 }); 81 82 return this; 83 }, 84 85 build: function() { 86 var self = this; 87 88 if($('body').hasClass('loading-overlay-showing')) { 89 $(window).on('loading.overlay.ready', function(){ 90 self.animate(); 91 }); 92 } else { 93 self.animate(); 94 } 95 96 return this; 97 }, 98 99 animate: function() { 100 var self = this, 101 $el = this.options.wrapper, 102 delay = 0, 103 duration = this.options.duration, 104 elTopDistance = $el.offset().top, 105 windowTopDistance = $(window).scrollTop(); 106 107 $el.addClass('appear-animation animated'); 108 109 if (!$('html').hasClass('no-csstransitions') && $(window).width() > 767 && elTopDistance >= windowTopDistance) { 110 111 $el.appear(function() { 112 113 $el.one('animation:show', function(ev) { 114 delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay); 115 duration = ($el.attr('data-appear-animation-duration') ? $el.attr('data-appear-animation-duration') : self.options.duration); 116 117 if (duration != '750ms') { 118 $el.css('animation-duration', duration); 119 } 120 121 $el.css('animation-delay', delay + 'ms'); 122 123 $el.addClass($el.attr('data-appear-animation') + ' appear-animation-visible'); 124 }); 125 126 $el.trigger('animation:show'); 127 128 }, { 129 accX: self.options.accX, 130 accY: self.options.accY 131 }); 132 133 } else { 134 135 $el.addClass('appear-animation-visible'); 136 137 } 138 139 return this; 140 } 141 }; 142 143 // expose to scope 144 $.extend(theme, { 145 PluginAnimate: PluginAnimate 146 }); 147 148 // jquery plugin 149 $.fn.themePluginAnimate = function(opts) { 150 return this.map(function() { 151 var $this = $(this); 152 153 if ($this.data(instanceName)) { 154 return $this.data(instanceName); 155 } else { 156 return new PluginAnimate($this, opts); 157 } 158 159 }); 160 }; 161 162}).apply(this, [window.theme, jQuery]); 163 164// Before / After 165(function(theme, $) { 166 167 theme = theme || {}; 168 169 var instanceName = '__beforeafter'; 170 171 var PluginBeforeAfter = function($el, opts) { 172 return this.initialize($el, opts); 173 }; 174 175 PluginBeforeAfter.defaults = { 176 177 }; 178 179 PluginBeforeAfter.prototype = { 180 initialize: function($el, opts) { 181 this.$el = $el; 182 183 this 184 .setData() 185 .setOptions(opts) 186 .build(); 187 188 return this; 189 }, 190 191 setData: function() { 192 this.$el.data(instanceName, this); 193 194 return this; 195 }, 196 197 setOptions: function(opts) { 198 this.options = $.extend(true, {}, PluginBeforeAfter.defaults, opts, { 199 wrapper: this.$el 200 }); 201 202 return this; 203 }, 204 205 build: function() { 206 207 if (!($.isFunction($.fn.twentytwenty))) { 208 return this; 209 } 210 211 var self = this; 212 213 self.options.wrapper 214 .twentytwenty(self.options); 215 216 return this; 217 218 } 219 }; 220 221 // expose to scope 222 $.extend(theme, { 223 PluginBeforeAfter: PluginBeforeAfter 224 }); 225 226 // jquery plugin 227 $.fn.themePluginBeforeAfter = function(opts) { 228 return this.map(function() { 229 var $this = $(this); 230 231 if ($this.data(instanceName)) { 232 return $this.data(instanceName); 233 } else { 234 return new PluginBeforeAfter($this, opts); 235 } 236 237 }); 238 } 239 240}).apply(this, [window.theme, jQuery]); 241 242// Carousel
243(function(theme, $) { 244 245 theme = theme || {}; 246 247 var instanceName = '__carousel'; 248 249 var PluginCarousel = function($el, opts) { 250 return this.initialize($el, opts); 251 }; 252 253 PluginCarousel.defaults = { 254 loop: true, 255 responsive: { 256 0: { 257 items: 1 258 }, 259 479: { 260 items: 1 261 }, 262 768: { 263 items: 2 264 }, 265 979: { 266 items: 3 267 }, 268 1199: { 269 items: 4 270 } 271 }, 272 navText: [] 273 }; 274 275 PluginCarousel.prototype = { 276 initialize: function($el, opts) { 277 if ($el.data(instanceName)) { 278 return this; 279 } 280 281 this.$el = $el; 282 283 this 284 .setData() 285 .setOptions(opts) 286 .build(); 287 288 return this; 289 }, 290 291 setData: function() { 292 this.$el.data(instanceName, this); 293 294 return this; 295 }, 296 297 setOptions: function(opts) { 298 this.options = $.extend(true, {}, PluginCarousel.defaults, opts, { 299 wrapper: this.$el 300 }); 301 302 return this; 303 }, 304 305 build: function() { 306 if (!($.isFunction($.fn.owlCarousel))) { 307 return this; 308 } 309 310 var self = this, 311 $el = this.options.wrapper; 312 313 // Add Theme Class 314 $el.addClass('owl-theme'); 315 316 // Add Loading 317 $el.addClass('owl-loading'); 318 319 // Force RTL according to HTML dir attribute 320 if ($('html').attr('dir') == 'rtl') { 321 this.options = $.extend(true, {}, this.options, { 322 rtl: true 323 }); 324 } 325 326 if (this.options.items == 1) { 327 this.options.responsive = {} 328 } 329 330 if (this.options.items > 4) { 331 this.options = $.extend(true, {}, this.options, { 332 responsive: { 333 1199: { 334 items: this.options.items 335 } 336 } 337 }); 338 } 339 340 // Auto Height Fixes 341 if (this.options.autoHeight) { 342 var itemsHeight = []; 343 344 $el.find('.owl-item').each(function(){ 345 if( $(this).hasClass('active') ) { 346 itemsHeight.push( $(this).height() ); 347 } 348 }); 349 350 $(window).afterResize(function() { 351 $el.find('.owl-stage-outer').height( Math.max.apply(null, itemsHeight) ); 352 }); 353 354 $(window).on('load', function() { 355 $el.find('.owl-stage-outer').height( Math.max.apply(null, itemsHeight) ); 356 }); 357 } 358 359 // Initialize OwlCarousel 360 $el.owlCarousel(this.options).addClass('owl-carousel-init'); 361 362 // Sync 363 if ($el.attr('data-sync')) { 364 $el.on('change.owl.carousel', function(event) { 365 if (event.namespace && event.property.name === 'position') { 366 var target = event.relatedTarget.relative(event.property.value, true); 367 $( $el.data('sync') ).owlCarousel('to', target, 300, true); 368 } 369 }); 370 } 371 372 // Carousel Center Active Item 373 if( $el.hasClass('carousel-center-active-item') ) { 374 var itemsActive = $el.find('.owl-item.active'), 375 indexCenter = Math.floor( ($el.find('.owl-item.active').length - 1) / 2 ),
376 itemCenter = itemsActive.eq(indexCenter); 377 378 itemCenter.addClass('current'); 379 380 $el.on('change.owl.carousel', function(event) { 381 $el.find('.owl-item').removeClass('current'); 382 383 setTimeout(function(){ 384 var itemsActive = $el.find('.owl-item.active'), 385 indexCenter = Math.floor( ($el.find('.owl-item.active').length - 1) / 2 ), 386 itemCenter = itemsActive.eq(indexCenter); 387 388 itemCenter.addClass('current'); 389 }, 100); 390 }); 391 392 // Refresh 393 $el.trigger('refresh.owl.carousel'); 394 395 } 396 397 // Remove Loading 398 $el.removeClass('owl-loading'); 399 400 // Remove Height 401 $el.css('height', 'auto'); 402 403 return this; 404 } 405 }; 406 407 // expose to scope 408 $.extend(theme, { 409 PluginCarousel: PluginCarousel 410 }); 411 412 // jquery plugin 413 $.fn.themePluginCarousel = function(opts) { 414 return this.map(function() { 415 var $this = $(this); 416 417 if ($this.data(instanceName)) { 418 return $this.data(instanceName); 419 } else { 420 return new PluginCarousel($this, opts); 421 } 422 423 }); 424 } 425 426}).apply(this, [window.theme, jQuery]); 427 428// Chart Circular 429(function(theme, $) { 430 431 theme = theme || {}; 432 433 var instanceName = '__chartCircular'; 434 435 var PluginChartCircular = function($el, opts) { 436 return this.initialize($el, opts); 437 }; 438 439 PluginChartCircular.defaults = { 440 accX: 0, 441 accY: -150, 442 delay: 1, 443 barColor: '#0088CC', 444 trackColor: '#f2f2f2', 445 scaleColor: false, 446 scaleLength: 5, 447 lineCap: 'round', 448 lineWidth: 13, 449 size: 175, 450 rotate: 0, 451 animate: ({ 452 duration: 2500, 453 enabled: true 454 }) 455 }; 456 457 PluginChartCircular.prototype = { 458 initialize: function($el, opts) { 459 if ($el.data(instanceName)) { 460 return this; 461 } 462 463 this.$el = $el; 464 465 this 466 .setData() 467 .setOptions(opts) 468 .build(); 469 470 return this; 471 }, 472 473 setData: function() { 474 this.$el.data(instanceName, this); 475 476 return this; 477 }, 478 479 setOptions: function(opts) { 480 this.options = $.extend(true, {}, PluginChartCircular.defaults, opts, { 481 wrapper: this.$el 482 }); 483 484 return this; 485 }, 486 487 build: function() { 488 if (!($.isFunction($.fn.appear)) || !($.isFunction($.fn.easyPieChart))) { 489 return this; 490 } 491 492 var self = this, 493 $el = this.options.wrapper, 494 value = ($el.attr('data-percent') ? $el.attr('data-percent') : 0), 495 percentEl = $el.find('.percent'); 496 497 $.extend(true, self.options, { 498 onStep: function(from, to, currentValue) { 499 percentEl.html(parseInt(currentValue)); 500 } 501 }); 502 503 $el.attr('data-percent', 0); 504 505 $el.appear(function() { 506 507 $el.easyPieChart(self.options); 508 509 setTimeout(function() { 510 511 $el.data('easyPieChart').update(value); 512 $el.attr('data-percent', value); 513 514 }, self.options.delay); 515 516 }, { 517 accX: self.options.accX, 518 accY: self.options.accY 519 }); 520 521 return this; 522 } 523 }; 524 525 // expose to scope 526 $.extend(theme, { 527 PluginChartCircular: PluginChartCircular 528 }); 529 530 // jquery plugin 531 $.fn.themePluginChartCircular = function(opts) { 532 return this.map(function() { 533 var $this = $(this); 534 535 if ($this.data(instanceName)) { 536 return $this.data(instanceName); 537 } else { 538 return new PluginChartCircular($this, opts); 539 } 540 541 }); 542 } 543 544}).apply(this, [window.theme, jQuery]); 545 546// Countdown 547(function(theme, $) { 548 549 theme = theme || {}; 550 551 var instanceName = '__countdown'; 552 553 var PluginCountdown = function($el, opts) { 554 return this.initialize($el, opts); 555 }; 556 557 PluginCountdown.defaults = { 558 date: '2030/06/10 12:00:00', 559 textDay: 'DAY', 560 textHour: 'HRS', 561 textMin: 'MIN', 562 textSec: 'SEC', 563 uppercase: true, 564 numberClass: '', 565 wrapperClass: '', 566 insertHTMLbefore: '', 567 insertHTMLafter: '' 568 }; 569 570 PluginCountdown.prototype = { 571 initialize: function($el, opts) { 572 if ($el.data(instanceName)) { 573 return this; 574 } 575 576 this.$el = $el; 577 578 this 579 .setData() 580 .setOptions(opts) 581 .build(); 582 583 return this; 584 }, 585 586 setData: function() { 587 this.$el.data(instanceName, this); 588 589 return this; 590 }, 591 592 setOptions: function(opts) { 593 this.options = $.extend(true, {}, PluginCountdown.defaults, opts, { 594 wrapper: this.$el 595 }); 596 597 return this; 598 }, 599 600 build: function() { 601 if (!($.isFunction($.fn.countTo))) { 602 return this; 603 } 604 605 var self = this, 606 $el = this.options.wrapper, 607 numberClass = ( self.options.numberClass ) ? ' ' + self.options.numberClass : '', 608 wrapperClass = ( self.options.wrapperClass ) ? ' ' + self.options.wrapperClass : ''; 609 610 if( self.options.uppercase ) { 611 $el.countdown(self.options.date).on('update.countdown', function(event) { 612 var $this = $(this).html(event.strftime(self.options.insertHTMLbefore 613 + '<span class="days'+ wrapperClass +'"><span class="'+ numberClass +'">%D</span> '+ self.options.textDay +'<div class="d-inline text-uppercase">%!d</div></span> ' 614 + '<span class="hours'+ wrapperClass +'"><span class="'+ numberClass +'">%H</span> '+ self.options.textHour +'</span> ' 615 + '<span class="minutes'+ wrapperClass +'"><span class="'+ numberClass +'">%M</span> '+ self.options.textMin +'</span> ' 616 + '<span class="seconds'+ wrapperClass +'"><span class="'+ numberClass +'">%S</span> '+ self.options.textSec +'</span> ' 617 + self.options.insertHTMLafter 618 )); 619 }); 620 } else { 621 $el.countdown(self.options.date).on('update.countdown', function(event) { 622 var $this = $(this).html(event.strftime(self.options.insertHTMLbefore 623 + '<span class="days'+ wrapperClass +'"><span class="'+ numberClass +'">%D</span> '+ self.options.textDay +'%!d</span> ' 624 + '<span class="hours'+ wrapperClass +'"><span class="'+ numberClass +'">%H</span> '+ self.options.textHour +'</span> ' 625 + '<span class="minutes'+ wrapperClass +'"><span class="'+ numberClass +'">%M</span> '+ self.options.textMin +'</span> ' 626 + '<span class="seconds'+ wrapperClass +'"><span class="'+ numberClass +'">%S</span> '+ self.options.textSec +'</span> ' 627 + self.options.insertHTMLafter 628 )); 629 }); 630 } 631 632 return this; 633 } 634 }; 635 636 // expose to scope 637 $.extend(theme, { 638 PluginCountdown: PluginCountdown 639 }); 640 641 // jquery plugin 642 $.fn.themePluginCountdown = function(opts) { 643 return this.map(function() { 644 var $this = $(this); 645 646 if ($this.data(instanceName)) { 647 return $this.data(instanceName); 648 } else { 649 return new PluginCountdown($this, opts); 650 } 651 652 }); 653 } 654 655}).apply(this, [window.theme, jQuery]); 656 657// Counter 658(function(theme, $) { 659 660 theme = theme || {}; 661 662 var instanceName = '__counter'; 663 664 var PluginCounter = function($el, opts) { 665 return this.initialize($el, opts); 666 }; 667 668 PluginCounter.defaults = { 669 accX: 0, 670 accY: 0, 671 speed: 3000, 672 refreshInterval: 100, 673 decimals: 0, 674 onUpdate: null, 675 onComplete: null 676 }; 677 678 PluginCounter.prototype = { 679 initialize: function($el, opts) { 680 if ($el.data(instanceName)) { 681 return this; 682 } 683 684 this.$el = $el; 685 686 this 687 .setData() 688 .setOptions(opts) 689 .build(); 690 691 return this; 692 }, 693 694 setData: function() { 695 this.$el.data(instanceName, this); 696 697 return this; 698 }, 699 700 setOptions: function(opts) { 701 this.options = $.extend(true, {}, PluginCounter.defaults, opts, { 702 wrapper: this.$el 703 }); 704 705 return this; 706 }, 707 708 build: function() { 709 if (!($.isFunction($.fn.countTo))) { 710 return this; 711 } 712 713 var self = this, 714 $el = this.options.wrapper; 715 716 $.extend(self.options, { 717 onComplete: function() { 718 if ($el.data('append')) { 719 $el.html($el.html() + $el.data('append')); 720 } 721 722 if ($el.data('prepend')) { 723 $el.html($el.data('prepend') + $el.html()); 724 } 725 } 726 }); 727
728 $el.appear(function() { 729 730 $el.countTo(self.options); 731 732 }, { 733 accX: self.options.accX, 734 accY: self.options.accY 735 }); 736 737 return this; 738 } 739 }; 740 741 // expose to scope 742 $.extend(theme, { 743 PluginCounter: PluginCounter 744 }); 745 746 // jquery plugin 747 $.fn.themePluginCounter = function(opts) { 748 return this.map(function() { 749 var $this = $(this); 750 751 if ($this.data(instanceName)) { 752 return $this.data(instanceName); 753 } else { 754 return new PluginCounter($this, opts); 755 } 756 757 }); 758 } 759 760}).apply(this, [window.theme, jQuery]); 761 762// Icon 763(function(theme, $) { 764 765 'use strict'; 766 767 theme = theme || {}; 768 769 var instanceName = '__icon'; 770 771 var PluginIcon = function($el, opts) { 772 return this.initialize($el, opts); 773 }; 774 775 PluginIcon.defaults = { 776 color: '#2388ED', 777 animated: false, 778 delay: 300 779 }; 780 781 PluginIcon.prototype = { 782 initialize: function($el, opts) { 783 if ($el.data(instanceName)) { 784 return this; 785 } 786 787 this.$el = $el; 788 789 this 790 .setData() 791 .setOptions(opts) 792 .build(); 793 794 return this; 795 }, 796 797 setData: function() { 798 this.$el.data(instanceName, this); 799 800 return this; 801 }, 802 803 setOptions: function(opts) { 804 this.options = $.extend(true, {}, PluginIcon.defaults, opts, { 805 wrapper: this.$el 806 }); 807 808 return this; 809 }, 810 811 build: function() { 812 var self = this, 813 $el = this.options.wrapper, 814 color = self.options.color, 815 elTopDistance = $el.offset().top, 816 windowTopDistance = $(window).scrollTop(), 817 duration = ( self.options.animated && !self.options.strokeBased ) ? 200 : 100; 818 819 // Check origin 820 if( window.location.origin === 'file://' ) { 821 $el.css('opacity', 1); 822 return; 823 } 824 825 // Duration 826 if( self.options.duration ) { 827 duration = self.options.duration; 828 } 829 830 // SVG Content 831 var SVGContent = $.get({ 832 url: $el.attr('src'), 833 success: function(data, status, xhr){ 834 var iconWrapper = $('<div class="animated-icon">'+ xhr.responseText +'</div>'), 835 uniqid = 'icon_' + Math.floor(Math.random() * 26) + Date.now(); 836 837 iconWrapper.find('svg').attr('id', uniqid); 838 839 if( $el.attr('width') ) { 840 iconWrapper.find('svg') 841 .attr('width', $el.attr('width')) 842 .attr('height', $el.attr('width')); 843 } 844 845 $el.replaceWith(iconWrapper); 846 847 $el = iconWrapper; 848 849 var icon = new Vivus(uniqid, {start: 'manual', type: 'sync', selfDestroy: true, duration: duration, onReady: function(obj){ 850 var styleElement = document.createElementNS("http://www.w3.org/2000/svg", "style"), 851 animateStyle = ''; 852 853 // SVG Fill Based 854 if( self.options.animated && !self.options.strokeBased || !self.options.animated && color && !self.options.strokeBased ) { 855 animateStyle = 'stroke-width: 0.1px; fill-opacity: 0; transition: ease fill-opacity 300ms;'; 856 857 // Set Style on SVG inside object 858 styleElement.textContent = '#' + uniqid + ' path, #' + uniqid + ' line, #' + uniqid + ' rect, #' + uniqid + ' circle, #' + uniqid + ' polyline { fill: '+ color +'; stroke: '+ color +'; '+ animateStyle + (self.options.svgStyle ? self.options.svgStyle : "") + ' } .finished path { fill-opacity: 1; }'; 859 obj.el.appendChild(styleElement); 860 } 861 862 // SVG Stroke Based 863 if( self.options.animated && self.options.strokeBased || !self.options.animated && color && self.options.strokeBased ) { 864 865 // Set Style on SVG inside object 866 styleElement.textContent = '#' + uniqid + ' path, #' + uniqid + ' line, #' + uniqid + ' rect, #' + uniqid + ' circle, #' + uniqid + ' polyline { stroke: '+ color +'; ' + (self.options.svgStyle ? self.options.svgStyle : "") + '}'; 867 obj.el.appendChild(styleElement); 868 } 869 870 $.event.trigger('theme.plugin.icon.svg.ready'); 871 }}); 872 873 // Isn't animated 874 if( !self.options.animated ) { 875 setTimeout(function(){ 876 icon.finish(); 877 }, 10); 878 $el.css({ opacity: 1 }); 879 } 880 881 // Animated 882 if( self.options.animated && $(window).width() > 767 ) { 883 // First Load 884 if( $el.visible( true ) ) { 885 self.startIconAnimation( icon, $el ); 886 } else if( elTopDistance < windowTopDistance ) { 887 self.startIconAnimation( icon, $el ); 888 } 889 890 // On Scroll 891 $(window).on('scroll', function(){ 892 if( $el.visible( true ) ) { 893 self.startIconAnimation( icon, $el ); 894 } 895 }); 896 897 } else { 898 899 $el.css({ opacity: 1 }); 900 icon.finish(); 901 902 $(window).on('theme.plugin.icon.svg.ready', function(){ 903 setTimeout(function(){ 904 icon.el.setAttribute('class', 'finished'); 905 icon.finish(); 906 }, 300); 907 }); 908 909 } 910 911 } 912 }); 913 914 return this; 915 }, 916 startIconAnimation: function(icon, $el) { 917 var self = this; 918 919 // Animate for better performance 920 $({to:0}).animate({to:1}, ((self.options.strokeBased) ? self.options.delay : self.options.delay + 300 ), function() { 921 $el.css({ opacity: 1 }); 922 }); 923 924 $({to:0}).animate({to:1}, self.options.delay, function() { 925 icon.play(1); 926 927 setTimeout(function(){ 928 icon.el.setAttribute('class', 'finished'); 929 }, icon.duration * 5 ); 930 }); 931 } 932 }; 933 934 // expose to scope 935 $.extend(theme, { 936 PluginIcon: PluginIcon 937 }); 938 939 // jquery plugin 940 $.fn.themePluginIcon = function(opts) { 941 return this.map(function() { 942 var $this = $(this); 943 944 if ($this.data(instanceName)) { 945 return $this.data(instanceName); 946 } else { 947 return new PluginIcon($this, opts); 948 } 949 950 }); 951 }; 952 953}).apply(this, [window.theme, jQuery]); 954 955// Lazy Load 956(function(theme, $) { 957 958 theme = theme || {}; 959 960 var instanceName = '__lazyload'; 961 962 var PluginLazyLoad = function($el, opts) { 963 return this.initialize($el, opts); 964 }; 965 966 PluginLazyLoad.defaults = { 967 effect: 'show', 968 appearEffect: '', 969 appear: function(elements_left, settings) { 970 971 }, 972 load: function(elements_left, settings) { 973 $(this).addClass($.trim('lazy-load-loaded ' + settings.appearEffect)); 974 } 975 }; 976 977 PluginLazyLoad.prototype = { 978 initialize: function($el, opts) { 979 if ($el.data(instanceName)) { 980 return this; 981 } 982 983 this.$el = $el; 984 985 this 986 .setData() 987 .setOptions(opts) 988 .build(); 989 990 return this; 991 }, 992 993 setData: function() { 994 this.$el.data(instanceName, this); 995 996 return this; 997 }, 998 999 setOptions: function(opts) { 1000 this.options = $.extend(true, {}, PluginLazyLoad.defaults, opts, { 1001 wrapper: this.$el 1002 }); 1003 1004 return this; 1005 }, 1006 1007 build: function() { 1008 if (!($.isFunction($.fn.lazyload))) { 1009 return this; 1010 } 1011 1012 var self = this; 1013 1014 self.options.wrapper.lazyload(this.options); 1015 1016 return this; 1017 } 1018 }; 1019 1020 // expose to scope 1021 $.extend(theme, { 1022 PluginLazyLoad: PluginLazyLoad 1023 }); 1024 1025 // jquery plugin 1026 $.fn.themePluginLazyLoad = function(opts) { 1027 return this.map(function() { 1028 var $this = $(this); 1029 1030 if ($this.data(instanceName)) { 1031 return $this.data(instanceName); 1032 } else { 1033 return new PluginLazyLoad($this, opts); 1034 } 1035 1036 }); 1037 } 1038 1039}).apply(this, [window.theme, jQuery]); 1040 1041// Lightbox 1042(function(theme, $) { 1043 1044 theme = theme || {}; 1045 1046 var instanceName = '__lightbox'; 1047 1048 var PluginLightbox = function($el, opts) { 1049 return this.initialize($el, opts); 1050 }; 1051 1052 PluginLightbox.defaults = { 1053 tClose: 'Close (Esc)', // Alt text on close button 1054 tLoading: 'Loading...', // Text that is displayed during loading. Can contain %curr% and %total% keys 1055 gallery: { 1056 tPrev: 'Previous (Left arrow key)', // Alt text on left arrow 1057 tNext: 'Next (Right arrow key)', // Alt text on right arrow 1058 tCounter: '%curr% of %total%' // Markup for "1 of 7" counter 1059 }, 1060 image: { 1061 tError: '<a href="%url%">The image</a> could not be loaded.' // Error message when image could not be loaded 1062 }, 1063 ajax: { 1064 tError: '<a href="%url%">The content</a> could not be loaded.' // Error message when ajax request failed 1065 }, 1066 callbacks: { 1067 open: function() { 1068 $('html').addClass('lightbox-opened'); 1069 }, 1070 close: function() { 1071 $('html').removeClass('lightbox-opened'); 1072 } 1073 } 1074 }; 1075 1076 PluginLightbox.prototype = { 1077 initialize: function($el, opts) { 1078 if ($el.data(instanceName)) { 1079 return this; 1080 } 1081 1082 this.$el = $el; 1083 1084 this 1085 .setData() 1086 .setOptions(opts) 1087 .build(); 1088 1089 return this; 1090 }, 1091 1092 setData: function() { 1093 this.$el.data(instanceName, this); 1094 1095 return this; 1096 }, 1097 1098 setOptions: function(opts) { 1099 this.options = $.extend(true, {}, PluginLightbox.defaults, opts, { 1100 wrapper: this.$el 1101 }); 1102 1103 return this; 1104 }, 1105 1106 build: function() { 1107 if (!($.isFunction($.fn.magnificPopup))) { 1108 return this; 1109 } 1110 1111 this.options.wrapper.magnificPopup(this.options); 1112 1113 return this; 1114 } 1115 }; 1116 1117 // expose to scope 1118 $.extend(theme, { 1119 PluginLightbox: PluginLightbox 1120 }); 1121 1122 // jquery plugin 1123 $.fn.themePluginLightbox = function(opts) { 1124 return this.map(function() { 1125 var $this = $(this); 1126 1127 if ($this.data(instanceName)) { 1128 return $this.data(instanceName); 1129 } else { 1130 return new PluginLightbox($this, opts); 1131 } 1132 1133 }); 1134 } 1135 1136}).apply(this, [window.theme, jQuery]); 1137 1138// Loading Overlay 1139(function(theme, $) { 1140 1141 'use strict'; 1142 1143 theme = theme || {}; 1144 1145 var loadingOverlayTemplate = [ 1146 '<div class="loading-overlay">', 1147 '<div class="bounce-loader"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>', 1148 '</div>' 1149 ].join(''); 1150 1151 var LoadingOverlay = function( $wrapper, options ) { 1152 return this.initialize( $wrapper, options ); 1153 }; 1154 1155 LoadingOverlay.prototype = { 1156 1157 options: { 1158 css: {}, 1159 hideDelay: 500 1160 }, 1161 1162 initialize: function( $wrapper, options ) { 1163 this.$wrapper = $wrapper; 1164 1165 this 1166 .setVars() 1167 .setOptions( options ) 1168 .build() 1169 .events(); 1170 1171 this.$wrapper.data( 'loadingOverlay', this ); 1172 }, 1173 1174 setVars: function() {
1175 this.$overlay = this.$wrapper.find('.loading-overlay'); 1176 1177 return this; 1178 }, 1179 1180 setOptions: function( options ) { 1181 if ( !this.$overlay.get(0) ) { 1182 this.matchProperties(); 1183 } 1184 this.options = $.extend( true, {}, this.options, options, theme.fn.getOptions(this.$wrapper.data('plugin-options')) ); 1185 1186 this.loaderClass = this.getLoaderClass( this.options.css.backgroundColor ); 1187 1188 return this; 1189 }, 1190 1191 build: function() { 1192 if ( !this.$overlay.closest(document.documentElement).get(0) ) { 1193 if ( !this.$cachedOverlay ) { 1194 this.$overlay = $( loadingOverlayTemplate ).clone(); 1195 1196 if ( this.options.css ) { 1197 this.$overlay.css( this.options.css ); 1198 this.$overlay.find( '.loader' ).addClass( this.loaderClass ); 1199 } 1200 } else { 1201 this.$overlay = this.$cachedOverlay.clone(); 1202 } 1203 1204 this.$wrapper.append( this.$overlay ); 1205 } 1206 1207 if ( !this.$cachedOverlay ) { 1208 this.$cachedOverlay = this.$overlay.clone(); 1209 } 1210 1211 return this; 1212 }, 1213 1214 events: function() { 1215 var _self = this; 1216 1217 if ( this.options.startShowing ) { 1218 _self.show(); 1219 } 1220 1221 if ( this.$wrapper.is('body') || this.options.hideOnWindowLoad ) { 1222 $( window ).on( 'load error', function() { 1223 _self.hide(); 1224 }); 1225 } 1226 1227 if ( this.options.listenOn ) { 1228 $( this.options.listenOn ) 1229 .on( 'loading-overlay:show beforeSend.ic', function( e ) { 1230 e.stopPropagation(); 1231 _self.show(); 1232 }) 1233 .on( 'loading-overlay:hide complete.ic', function( e ) { 1234 e.stopPropagation(); 1235 _self.hide(); 1236 }); 1237 } 1238 1239 this.$wrapper 1240 .on( 'loading-overlay:show beforeSend.ic', function( e ) { 1241 if ( e.target === _self.$wrapper.get(0) ) { 1242 e.stopPropagation(); 1243 _self.show(); 1244 return true; 1245 } 1246 return false; 1247 }) 1248 .on( 'loading-overlay:hide complete.ic', function( e ) { 1249 if ( e.target === _self.$wrapper.get(0) ) { 1250 e.stopPropagation(); 1251 _self.hide(); 1252 return true; 1253 } 1254 return false; 1255 }); 1256 1257 return this; 1258 }, 1259 1260 show: function() { 1261 this.build(); 1262 1263 this.position = this.$wrapper.css( 'position' ).toLowerCase(); 1264 if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) { 1265 this.$wrapper.css({ 1266 position: 'relative' 1267 }); 1268 } 1269 this.$wrapper.addClass( 'loading-overlay-showing' ); 1270 }, 1271 1272 hide: function() { 1273 var _self = this; 1274 1275 setTimeout(function() { 1276 _self.$wrapper.removeClass( 'loading-overlay-showing' ); 1277 1278 if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) { 1279 _self.$wrapper.css({ position: '' }); 1280 } 1281 1282 $(window).trigger('loading.overlay.ready'); 1283 }, _self.options.hideDelay); 1284 }, 1285 1286 matchProperties: function() { 1287 var i, 1288 l, 1289 properties; 1290 1291 properties = [ 1292 'backgroundColor', 1293 'borderRadius' 1294 ]; 1295 1296 l = properties.length; 1297 1298 for( i = 0; i < l; i++ ) { 1299 var obj = {}; 1300 obj[ properties[ i ] ] = this.$wrapper.css( properties[ i ] ); 1301 1302 $.extend( this.options.css, obj ); 1303 } 1304 }, 1305 1306 getLoaderClass: function( backgroundColor ) { 1307 if ( !backgroundColor || backgroundColor === 'transparent' || backgroundColor === 'inherit' ) { 1308 return 'black'; 1309 } 1310 1311 var hexColor, 1312 r, 1313 g, 1314 b, 1315 yiq; 1316 1317 var colorToHex = function( color ){ 1318 var hex, 1319 rgb; 1320 1321 if( color.indexOf('#') >- 1 ){ 1322 hex = color.replace('#', ''); 1323 } else { 1324 rgb = color.match(/\d+/g); 1325 hex = ('0' + parseInt(rgb[0], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[1], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[2], 10).toString(16)).slice(-2); 1326 } 1327 1328 if ( hex.length === 3 ) { 1329 hex = hex + hex; 1330 } 1331 1332 return hex; 1333 }; 1334 1335 hexColor = colorToHex( backgroundColor ); 1336 1337 r = parseInt( hexColor.substr( 0, 2), 16 ); 1338 g = parseInt( hexColor.substr( 2, 2), 16 ); 1339 b = parseInt( hexColor.substr( 4, 2), 16 ); 1340 yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 1341 1342 return ( yiq >= 128 ) ? 'black' : 'white'; 1343 } 1344 1345 }; 1346 1347 // expose to scope 1348 $.extend(theme, { 1349 LoadingOverlay: LoadingOverlay 1350 }); 1351 1352 // expose as a jquery plugin 1353 $.fn.loadingOverlay = function( opts ) { 1354 return this.each(function() { 1355 var $this = $( this ); 1356 1357 var loadingOverlay = $this.data( 'loadingOverlay' ); 1358 if ( loadingOverlay ) { 1359 return loadingOverlay; 1360 } else { 1361 var options = opts || $this.data( 'loading-overlay-options' ) || {}; 1362 return new LoadingOverlay( $this, options ); 1363 } 1364 }); 1365 } 1366 1367 // auto init 1368 $('[data-loading-overlay]').loadingOverlay(); 1369 1370}).apply(this, [window.theme, jQuery]); 1371 1372// Masonry 1373(function(theme, $) { 1374 1375 theme = theme || {}; 1376 1377 var instanceName = '__masonry'; 1378 1379 var PluginMasonry = function($el, opts) { 1380 return this.initialize($el, opts); 1381 }; 1382 1383 PluginMasonry.defaults = { 1384 1385 }; 1386 1387 PluginMasonry.prototype = { 1388 initialize: function($el, opts) { 1389 if ($el.data(instanceName)) { 1390 return this; 1391 } 1392 1393 this.$el = $el; 1394 1395 this 1396 .setData() 1397 .setOptions(opts) 1398 .build(); 1399 1400 return this; 1401 }, 1402 1403 setData: function() { 1404 this.$el.data(instanceName, this); 1405 1406 return this; 1407 }, 1408 1409 setOptions: function(opts) { 1410 this.options = $.extend(true, {}, PluginMasonry.defaults, opts, { 1411 wrapper: this.$el 1412 }); 1413 1414 return this; 1415 }, 1416 1417 build: function() { 1418 if (!($.isFunction($.fn.isotope))) { 1419 return this; 1420 } 1421 1422 var self = this, 1423 $window = $(window); 1424 1425 self.$loader = false;
1426 1427 if (self.options.wrapper.parents('.masonry-loader').get(0)) { 1428 self.$loader = self.options.wrapper.parents('.masonry-loader'); 1429 self.createLoader(); 1430 } 1431 1432 self.options.wrapper.one('layoutComplete', function(event, laidOutItems) { 1433 self.removeLoader(); 1434 }); 1435 1436 self.options.wrapper.waitForImages(function() { 1437 self.options.wrapper.isotope(self.options); 1438 }); 1439 1440 // IE10/11 fix 1441 if( $('html').hasClass('ie10') || $('html').hasClass('ie11') ) { 1442 var padding = parseInt( self.options.wrapper.children().css('padding-left') ) + parseInt( self.options.wrapper.children().css('padding-right') ); 1443 } 1444 1445 $(window).on('resize', function() { 1446 setTimeout(function() { 1447 self.options.wrapper.isotope('layout'); 1448 }, 300); 1449 }); 1450 1451 setTimeout(function() { 1452 self.removeLoader(); 1453 }, 3000); 1454 1455 return this; 1456 }, 1457 1458 createLoader: function() { 1459 var self = this; 1460 1461 var loaderTemplate = [ 1462 '<div class="bounce-loader">', 1463 '<div class="bounce1"></div>', 1464 '<div class="bounce2"></div>', 1465 '<div class="bounce3"></div>', 1466 '</div>' 1467 ].join(''); 1468 1469 self.$loader.append(loaderTemplate); 1470 1471 return this; 1472 }, 1473 1474 removeLoader: function() { 1475 1476 var self = this; 1477 1478 if (self.$loader) { 1479 1480 self.$loader.removeClass('masonry-loader-showing'); 1481 1482 setTimeout(function() { 1483 self.$loader.addClass('masonry-loader-loaded'); 1484 }, 300); 1485 1486 } 1487 1488 } 1489 }; 1490 1491 // expose to scope 1492 $.extend(theme, { 1493 PluginMasonry: PluginMasonry 1494 }); 1495 1496 // jquery plugin 1497 $.fn.themePluginMasonry = function(opts) { 1498 return this.map(function() { 1499 var $this = $(this); 1500 1501 if ($this.data(instanceName)) { 1502 return $this.data(instanceName); 1503 } else { 1504 return new PluginMasonry($this, opts); 1505 } 1506 1507 }); 1508 } 1509 1510}).apply(this, [window.theme, jQuery]); 1511 1512// Match Height 1513(function(theme, $) { 1514 1515 theme = theme || {}; 1516 1517 var instanceName = '__matchHeight'; 1518 1519 var PluginMatchHeight = function($el, opts) { 1520 return this.initialize($el, opts); 1521 }; 1522 1523 PluginMatchHeight.defaults = { 1524 byRow: true, 1525 property: 'height', 1526 target: null, 1527 remove: false 1528 }; 1529 1530 PluginMatchHeight.prototype = { 1531 initialize: function($el, opts) { 1532 if ($el.data(instanceName)) { 1533 return this; 1534 } 1535 1536 this.$el = $el; 1537 1538 this 1539 .setData() 1540 .setOptions(opts) 1541 .build(); 1542 1543 return this; 1544 }, 1545 1546 setData: function() { 1547 this.$el.data(instanceName, this); 1548 1549 return this; 1550 }, 1551 1552 setOptions: function(opts) { 1553 this.options = $.extend(true, {}, PluginMatchHeight.defaults, opts, { 1554 wrapper: this.$el 1555 }); 1556 1557 return this; 1558 }, 1559 1560 build: function() { 1561 if (!($.isFunction($.fn.matchHeight))) { 1562 return this; 1563 } 1564 1565 var self = this; 1566 1567 self.options.wrapper.matchHeight(self.options); 1568 1569 return this; 1570 } 1571 1572 }; 1573 1574 // expose to scope 1575 $.extend(theme, { 1576 PluginMatchHeight: PluginMatchHeight 1577 }); 1578 1579 // jquery plugin 1580 $.fn.themePluginMatchHeight = function(opts) { 1581 return this.map(function() { 1582 var $this = $(this); 1583 1584 if ($this.data(instanceName)) { 1585 return $this.data(instanceName); 1586 } else { 1587 return new PluginMatchHeight($this, opts); 1588 } 1589 1590 }); 1591 } 1592 1593}).apply(this, [window.theme, jQuery]); 1594 1595// Parallax 1596(function(theme, $) { 1597 1598 theme = theme || {}; 1599 1600 var instanceName = '__parallax'; 1601 1602 var PluginParallax = function($el, opts) { 1603 return this.initialize($el, opts); 1604 }; 1605 1606 PluginParallax.defaults = { 1607 speed: 1.5, 1608 horizontalPosition: '50%', 1609 offset: 0, 1610 parallaxHeight: '180%' 1611 }; 1612 1613 PluginParallax.prototype = { 1614 initialize: function($el, opts) { 1615 if ($el.data(instanceName)) { 1616 return this; 1617 } 1618 1619 this.$el = $el; 1620 1621 this 1622 .setData() 1623 .setOptions(opts) 1624 .build(); 1625 1626 return this; 1627 }, 1628 1629 setData: function() { 1630 this.$el.data(instanceName, this); 1631 1632 return this; 1633 }, 1634 1635 setOptions: function(opts) { 1636 this.options = $.extend(true, {}, PluginParallax.defaults, opts, { 1637 wrapper: this.$el 1638 }); 1639 1640 return this; 1641 }, 1642 1643 build: function() { 1644 var self = this, 1645 $window = $(window), 1646 offset, 1647 yPos, 1648 bgpos, 1649 background; 1650 1651 // Create Parallax Element 1652 background = $('<div class="parallax-background"></div>'); 1653 1654 // Set Style for Parallax Element 1655 background.css({ 1656 'background-image' : 'url(' + self.options.wrapper.data('image-src') + ')', 1657 'background-size' : 'cover', 1658 'position' : 'absolute', 1659 'top' : 0, 1660 'left' : 0, 1661 'width' : '100%', 1662 'height' : self.options.parallaxHeight 1663 }); 1664 1665 // Add Parallax Element on DOM 1666 self.options.wrapper.prepend(background); 1667 1668 // Set Overlfow Hidden and Position Relative to Parallax Wrapper 1669 self.options.wrapper.css({ 1670 'position' : 'relative', 1671 'overflow' : 'hidden' 1672 }); 1673 1674 // Parallax Effect on Scroll & Resize 1675 var parallaxEffectOnScrolResize = function() { 1676 $window.on('scroll resize', function() { 1677 offset = self.options.wrapper.offset(); 1678 yPos = -($window.scrollTop() - (offset.top - 100)) / ((self.options.speed + 2 )); 1679 plxPos = (yPos < 0) ? Math.abs(yPos) : -Math.abs(yPos); 1680 background.css({ 1681 'transform' : 'translate3d(0, '+ ( (plxPos - 50) + (self.options.offset) ) +'px, 0)', 1682 'background-position-x' : self.options.horizontalPosition 1683 }); 1684 }); 1685 1686 $window.trigger('scroll'); 1687 } 1688 1689 if (!$.browser.mobile) { 1690 parallaxEffectOnScrolResize(); 1691 } else { 1692 if( self.options.enableOnMobile == true ) { 1693 parallaxEffectOnScrolResize(); 1694 } else { 1695 self.options.wrapper.addClass('parallax-disabled'); 1696 } 1697 } 1698 1699 return this; 1700 } 1701 }; 1702 1703 // expose to scope 1704 $.extend(theme, { 1705 PluginParallax: PluginParallax 1706 }); 1707 1708 // jquery plugin 1709 $.fn.themePluginParallax = function(opts) { 1710 return this.map(function() { 1711 var $this = $(this); 1712 1713 if ($this.data(instanceName)) { 1714 return $this.data(instanceName); 1715 } else { 1716 return new PluginParallax($this, opts); 1717 } 1718 1719 }); 1720 } 1721 1722}).apply(this, [window.theme, jQuery]); 1723 1724// Progress Bar 1725(function(theme, $) { 1726 1727 theme = theme || {}; 1728 1729 var instanceName = '__progressBar'; 1730 1731 var PluginProgressBar = function($el, opts) { 1732 return this.initialize($el, opts); 1733 }; 1734 1735 PluginProgressBar.defaults = { 1736 accX: 0, 1737 accY: -50, 1738 delay: 1 1739 }; 1740 1741 PluginProgressBar.prototype = { 1742 initialize: function($el, opts) { 1743 if ($el.data(instanceName)) { 1744 return this; 1745 } 1746 1747 this.$el = $el; 1748 1749 this 1750 .setData() 1751 .setOptions(opts) 1752 .build(); 1753 1754 return this; 1755 }, 1756 1757 setData: function() { 1758 this.$el.data(instanceName, this); 1759 1760 return this; 1761 }, 1762 1763 setOptions: function(opts) { 1764 this.options = $.extend(true, {}, PluginProgressBar.defaults, opts, { 1765 wrapper: this.$el 1766 }); 1767 1768 return this; 1769 }, 1770 1771 build: function() { 1772 if (!($.isFunction($.fn.appear))) { 1773 return this; 1774 } 1775 1776 var self = this, 1777 $el = this.options.wrapper,
1778 delay = 1; 1779 1780 $el.appear(function() { 1781 1782 delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay); 1783 1784 $el.addClass($el.attr('data-appear-animation')); 1785 1786 setTimeout(function() { 1787 1788 $el.animate({ 1789 width: $el.attr('data-appear-progress-animation') 1790 }, 1500, 'easeOutQuad', function() { 1791 $el.find('.progress-bar-tooltip').animate({ 1792 opacity: 1 1793 }, 500, 'easeOutQuad'); 1794 }); 1795 1796 }, delay); 1797 1798 }, { 1799 accX: self.options.accX, 1800 accY: self.options.accY 1801 }); 1802 1803 return this; 1804 } 1805 }; 1806 1807 // expose to scope 1808 $.extend(theme, { 1809 PluginProgressBar: PluginProgressBar 1810 }); 1811 1812 // jquery plugin 1813 $.fn.themePluginProgressBar = function(opts) { 1814 return this.map(function() { 1815 var $this = $(this); 1816 1817 if ($this.data(instanceName)) { 1818 return $this.data(instanceName); 1819 } else { 1820 return new PluginProgressBar($this, opts); 1821 } 1822 1823 }); 1824 } 1825 1826}).apply(this, [window.theme, jQuery]); 1827 1828// Revolution Slider 1829(function(theme, $) { 1830 1831 theme = theme || {}; 1832 1833 var instanceName = '__revolution'; 1834 1835 var PluginRevolutionSlider = function($el, opts) { 1836 return this.initialize($el, opts); 1837 }; 1838 1839 PluginRevolutionSlider.defaults = { 1840 sliderType: 'standard', 1841 sliderLayout: 'fullwidth', 1842 delay: 9000, 1843 gridwidth: 1170, 1844 gridheight: 500, 1845 spinner: 'spinner3', 1846 disableProgressBar: 'on', 1847 parallax: { 1848 type: 'off', 1849 bgparallax: 'off' 1850 }, 1851 navigation: { 1852 keyboardNavigation: 'off', 1853 keyboard_direction: 'horizontal', 1854 mouseScrollNavigation: 'off', 1855 onHoverStop: 'off', 1856 touch: { 1857 touchenabled: 'on', 1858 swipe_threshold: 75, 1859 swipe_min_touches: 1, 1860 swipe_direction: 'horizontal', 1861 drag_block_vertical: false 1862 }, 1863 arrows: { 1864 enable: true, 1865 hide_onmobile: false, 1866 hide_under: 0, 1867 hide_onleave: true, 1868 hide_delay: 200, 1869 hide_delay_mobile: 1200, 1870 left: { 1871 h_align: 'left', 1872 v_align: 'center', 1873 h_offset: 30, 1874 v_offset: 0 1875 }, 1876 right: { 1877 h_align: 'right', 1878 v_align: 'center', 1879 h_offset: 30, 1880 v_offset: 0 1881 } 1882 } 1883 }, 1884 1885 /* ADDONS */ 1886 addOnTypewriter: { 1887 enable: false 1888 }, 1889 addOnWhiteboard: { 1890 enable: false, 1891 1892 }, 1893 whiteboard: { 1894 movehand: { 1895 src: '../vendor/rs-plugin/revolution-addons/whiteboard/assets/images/hand_point_right.png', 1896 width: 400, 1897 height: 1000, 1898 handtype: 'right', 1899 transform: { 1900 transformX: 50, 1901 transformY: 50 1902 }, 1903 jittering: { 1904 distance: '80', 1905 distance_horizontal: '100', 1906 repeat: '5', 1907 offset: '10', 1908 offset_horizontal: '0' 1909 }, 1910 rotation: { 1911 angle: '10', 1912 repeat: '3' 1913 } 1914 }, 1915 writehand: { 1916 src: '../vendor/rs-plugin/revolution-addons/whiteboard/assets/images/write_right_angle.png', 1917 width: 572, 1918 height: 691, 1919 handtype: 'right', 1920 transform: { 1921 transformX: 50, 1922 transformY: 50 1923 }, 1924 jittering: { 1925 distance: '80', 1926 distance_horizontal: '100', 1927 repeat: '5', 1928 offset: '10', 1929 offset_horizontal: '0' 1930 }, 1931 rotation:{ 1932 angle: '10', 1933 repeat: '3' 1934 } 1935 } 1936 }, 1937 addOnParticles: { 1938 enable: false 1939 }, 1940 particles: { 1941 startSlide: "first", 1942 endSlide: "last", 1943 zIndex: "1", 1944 particles: { 1945 number: {value: 80}, color: {value: "#ffffff"}, 1946 shape: { 1947 type: "circle", stroke: {width: 0, color: "#ffffff", opacity: 1}, 1948 image: {src: ""} 1949 }, 1950 opacity: {value: 0.5, random: true, min: 0.25, anim: {enable: false, speed: 3, opacity_min: 0, sync: false}}, 1951 size: {value: 2, random: false, min: 30, anim: {enable: false, speed: 40, size_min: 1, sync: false}}, 1952 line_linked: {enable: true, distance: 150, color: "#ffffff", opacity: 0.4, width: 1},
1953 move: {enable: true, speed: 6, direction: "none", random: true, min_speed: 6, straight: false, out_mode: "out"} 1954 }, 1955 interactivity: { 1956 events: {onhover: {enable: false, mode: "repulse"}, onclick: {enable: false, mode: "repulse"}}, 1957 modes: {grab: {distance: 400, line_linked: {opacity: 0.5}}, bubble: {distance: 400, size: 40, opacity: 0.4}, repulse: {distance: 200}} 1958 } 1959 }, 1960 addOnCountdown: { 1961 enable: false, 1962 targetdate: new Date().getTime() + 864000000, // http://www.freeformatter.com/epoch-timestamp-to-date-converter.html 1963 slidechanges: [{days: 0, hours: 0, minutes: 0, seconds: 0, slide: 2}] 1964 }, 1965 addOnSlicey: { 1966 enable: false 1967 }, 1968 addOnFilmstrip: { 1969 enable: false 1970 }, 1971 addOnBeforeAfter : { 1972 enable: false, 1973 options: { 1974 cursor: "move", 1975 carousel: false, 1976 arrowStyles: { 1977 leftIcon: "fa-icon-caret-left", 1978 rightIcon: "fa-icon-caret-right", 1979 topIcon: "fa-icon-caret-up", 1980 bottomIcon: "fa-icon-caret-down", 1981 size: "35", 1982 color: "#ffffff", 1983 spacing: "10", 1984 bgColor: "transparent", 1985 padding: "0", 1986 borderRadius: "0" 1987 }, 1988 dividerStyles: { 1989 width: "1", 1990 color: "rgba(255, 255, 255, 0.5)" 1991 } 1992 } 1993 }, 1994 addOnPanorama: { 1995 enable: false 1996 }, 1997 addOnRevealer: { 1998 enable: false, 1999 }, 2000 revealer: { 2001 direction: "open_horizontal", 2002 color: "#ffffff", 2003 duration: "1500", 2004 delay: "0", 2005 easing: "Power2.easeInOut", 2006 overlay_enabled: true, 2007 overlay_color: "#000000", 2008 overlay_duration: "1500", 2009 overlay_delay: "0", 2010 overlay_easing: "Power2.easeInOut", 2011 spinner: "1", 2012 spinnerColor: "#006dd2", 2013 spinnerHtml: "<div class='rsaddon-revealer-spinner rsaddon-revealer-spinner-1'><div class='rsaddon-revealer-1'><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><span style='background: {{color}}'><\/span><\/div><\/div \/>" 2014 }, 2015 addOnDuotone: { 2016 enable: false 2017 }, 2018 addOnBubblemorph: { 2019 enable: false 2020 }, 2021 addOnDistortion: { 2022 enable: false 2023 } 2024 2025 }; 2026 2027 PluginRevolutionSlider.prototype = { 2028 initialize: function($el, opts) { 2029 if ($el.data(instanceName)) { 2030 return this; 2031 } 2032 2033 this.$el = $el; 2034 2035 this 2036 .setData() 2037 .setOptions(opts) 2038 .build() 2039 .events(); 2040 2041 return this; 2042 }, 2043 2044 setData: function() { 2045 this.$el.data(instanceName, this); 2046 2047 return this; 2048 }, 2049 2050 setOptions: function(opts) { 2051 this.options = $.extend(true, {}, PluginRevolutionSlider.defaults, opts, { 2052 wrapper: this.$el 2053 }); 2054 2055 return this; 2056 }, 2057 2058 build: function() { 2059 if (!($.isFunction($.fn.revolution))) { 2060 return this; 2061 } 2062 2063 // Single Slider Class 2064 if(this.options.wrapper.find('> ul > li').length == 1) { 2065 this.options.wrapper.addClass('slider-single-slide'); 2066 2067 // Remove Bullets 2068 // this.options.navigation.bullets.enable = false; 2069 $.extend(this.options.navigation, { 2070 bullets: { 2071 enable: false 2072 } 2073 }); 2074 2075 } 2076 2077 // Full Screen Class 2078 if(this.options.sliderLayout == 'fullscreen') { 2079 this.options.wrapper.closest('.slider-container').addClass('fullscreen-slider'); 2080 } 2081 2082 // Initialize Revolution Slider 2083 this.options.wrapper.revolution(this.options); 2084 2085 // Addon Init - Typewriter 2086 if(this.options.addOnTypewriter.enable) { 2087 RsTypewriterAddOn($, this.options.wrapper); 2088 } 2089 2090 // Addon Init - Whiteboard 2091 if(this.options.addOnWhiteboard.enable) { 2092 this.options.wrapper.rsWhiteBoard(); 2093 } 2094 2095 // Addon Init - Particles 2096 if(this.options.addOnParticles.enable) { 2097 RsParticlesAddOn(this.options.wrapper); 2098 } 2099 2100 // Addon Init - Countdown 2101 if(this.options.addOnCountdown.enable) { 2102 tp_countdown(this.options.wrapper, this.options.addOnCountdown.targetdate, this.options.addOnCountdown.slidechanges); 2103 } 2104 2105 // Addon Init - Slicey 2106 if(this.options.addOnSlicey.enable) { 2107 this.options.wrapper.revSliderSlicey(); 2108 } 2109 2110 // Addon Init - Filmstrip 2111 if(this.options.addOnFilmstrip.enable) { 2112 RsFilmstripAddOn($, this.options.wrapper, '../vendor/rs-plugin/revolution-addons/filmstrip/', false); 2113 } 2114 2115 // Addon Init - Before After
2116 if(this.options.addOnBeforeAfter.enable) { 2117 RevSliderBeforeAfter($, this.options.wrapper, this.options.addOnBeforeAfter.options); 2118 } 2119 2120 // Addon Init - Panorama 2121 if(this.options.addOnPanorama.enable) { 2122 RsAddonPanorama($, this.options.wrapper); 2123 } 2124 2125 // Addon Init - Revealer 2126 if(this.options.addOnRevealer.enable) { 2127 RsRevealerAddOn($, this.options.wrapper, this.options.revealer.spinnerHtml); 2128 } 2129 2130 // Addon Init - Duotone 2131 if(this.options.addOnDuotone.enable) { 2132 RsAddonDuotone($, this.options.wrapper, true, "cubic-bezier(0.645, 0.045, 0.355, 1.000)", "1000"); 2133 } 2134 2135 // Addon Init - Bubblemorph 2136 if(this.options.addOnBubblemorph.enable) { 2137 BubbleMorphAddOn($, this.options.wrapper, false); 2138 } 2139 2140 // Addon Init - Distortion 2141 if(this.options.addOnDistortion.enable) { 2142 RsLiquideffectAddOn($, this.options.wrapper); 2143 } 2144 2145 return this; 2146 }, 2147 2148 events: function() { 2149 2150 return this; 2151 } 2152 }; 2153 2154 // expose to scope 2155 $.extend(theme, { 2156 PluginRevolutionSlider: PluginRevolutionSlider 2157 }); 2158 2159 // jquery plugin 2160 $.fn.themePluginRevolutionSlider = function(opts) { 2161 return this.map(function() { 2162 var $this = $(this); 2163 2164 if ($this.data(instanceName)) { 2165 return $this.data(instanceName); 2166 } else { 2167 return new PluginRevolutionSlider($this, opts); 2168 } 2169 2170 }); 2171 } 2172 2173}).apply(this, [window.theme, jQuery]); 2174 2175// Scroll to Top 2176(function(theme, $) { 2177 2178 theme = theme || {}; 2179 2180 $.extend(theme, { 2181 2182 PluginScrollToTop: { 2183 2184 defaults: { 2185 wrapper: $('body'), 2186 offset: 150, 2187 buttonClass: 'scroll-to-top', 2188 iconClass: 'fas fa-chevron-up', 2189 delay: 1000, 2190 visibleMobile: false, 2191 label: false, 2192 easing: 'easeOutBack' 2193 }, 2194 2195 initialize: function(opts) { 2196 initialized = true; 2197 2198 // Don't initialize if the page has Section Scroll 2199 if( $('body[data-plugin-section-scroll]').get(0) ) { 2200 return; 2201 } 2202 2203 this 2204 .setOptions(opts) 2205 .build() 2206 .events(); 2207 2208 return this; 2209 }, 2210 2211 setOptions: function(opts) { 2212 this.options = $.extend(true, {}, this.defaults, opts); 2213 2214 return this; 2215 }, 2216 2217 build: function() { 2218 var self = this, 2219 $el; 2220 2221 // Base HTML Markup 2222 $el = $('<a />') 2223 .addClass(self.options.buttonClass) 2224 .attr({ 2225 'href': '#', 2226 }) 2227 .append( 2228 $('<i />') 2229 .addClass(self.options.iconClass) 2230 ); 2231 2232 // Visible Mobile 2233 if (!self.options.visibleMobile) { 2234 $el.addClass('hidden-mobile'); 2235 } 2236 2237 // Label 2238 if (self.options.label) { 2239 $el.append( 2240 $('<span />').html(self.options.label) 2241 ); 2242 } 2243 2244 this.options.wrapper.append($el); 2245 2246 this.$el = $el; 2247 2248 return this; 2249 }, 2250 2251 events: function() { 2252 var self = this, 2253 _isScrolling = false; 2254 2255 // Click Element Action 2256 self.$el.on('click', function(e) { 2257 e.preventDefault(); 2258 $('body, html').animate({ 2259 scrollTop: 0 2260 }, self.options.delay, self.options.easing); 2261 return false; 2262 }); 2263 2264 // Show/Hide Button on Window Scroll event. 2265 $(window).scroll(function() { 2266 2267 if (!_isScrolling) { 2268 2269 _isScrolling = true; 2270 2271 if ($(window).scrollTop() > self.options.offset) { 2272 2273 self.$el.stop(true, true).addClass('visible'); 2274 _isScrolling = false; 2275 2276 } else { 2277 2278 self.$el.stop(true, true).removeClass('visible'); 2279 _isScrolling = false; 2280 2281 } 2282 2283 } 2284 2285 }); 2286 2287 return this; 2288 } 2289 2290 } 2291 2292 }); 2293 2294}).apply(this, [window.theme, jQuery]); 2295 2296// Scrollable 2297(function(theme, $) { 2298 2299 theme = theme || {}; 2300 2301 var instanceName = '__scrollable'; 2302 2303 var PluginScrollable = function($el, opts) { 2304 return this.initialize($el, opts); 2305 }; 2306 2307 PluginScrollable.updateModals = function() { 2308 PluginScrollable.updateBootstrapModal(); 2309 }; 2310 2311 PluginScrollable.updateBootstrapModal = function() { 2312 var updateBoostrapModal; 2313 2314 updateBoostrapModal = typeof $.fn.modal !== 'undefined'; 2315 updateBoostrapModal = updateBoostrapModal && typeof $.fn.modal.Constructor !== 'undefined'; 2316 updateBoostrapModal = updateBoostrapModal && typeof $.fn.modal.Constructor.prototype !== 'undefined'; 2317 updateBoostrapModal = updateBoostrapModal && typeof $.fn.modal.Constructor.prototype.enforceFocus !== 'undefined'; 2318 2319 if ( !updateBoostrapModal ) { 2320 return false;
2321 } 2322 2323 var originalFocus = $.fn.modal.Constructor.prototype.enforceFocus; 2324 $.fn.modal.Constructor.prototype.enforceFocus = function() { 2325 originalFocus.apply( this ); 2326 2327 var $scrollable = this.$element.find('.scrollable'); 2328 if ( $scrollable ) { 2329 if ( $.isFunction($.fn['themePluginScrollable']) ) { 2330 $scrollable.themePluginScrollable(); 2331 } 2332 2333 if ( $.isFunction($.fn['nanoScroller']) ) { 2334 $scrollable.nanoScroller(); 2335 } 2336 } 2337 }; 2338 }; 2339 2340 PluginScrollable.defaults = { 2341 contentClass: 'scrollable-content', 2342 paneClass: 'scrollable-pane', 2343 sliderClass: 'scrollable-slider', 2344 alwaysVisible: true, 2345 preventPageScrolling: true 2346 }; 2347 2348 PluginScrollable.prototype = { 2349 initialize: function($el, opts) { 2350 if ( $el.data( instanceName ) ) { 2351 return this; 2352 } 2353 2354 this.$el = $el; 2355 2356 this 2357 .setData() 2358 .setOptions(opts) 2359 .build(); 2360 2361 return this; 2362 }, 2363 2364 setData: function() { 2365 this.$el.data(instanceName, this); 2366 2367 return this; 2368 }, 2369 2370 setOptions: function(opts) { 2371 this.options = $.extend(true, {}, PluginScrollable.defaults, opts, { 2372 wrapper: this.$el 2373 }); 2374 2375 return this; 2376 }, 2377 2378 build: function() { 2379 this.options.wrapper.nanoScroller(this.options); 2380 2381 return this; 2382 } 2383 }; 2384 2385 // expose to scope 2386 $.extend(theme, { 2387 PluginScrollable: PluginScrollable 2388 }); 2389 2390 // jquery plugin 2391 $.fn.themePluginScrollable = function(opts) { 2392 return this.each(function() { 2393 var $this = $(this); 2394 2395 if ($this.data(instanceName)) { 2396 return $this.data(instanceName); 2397 } else { 2398 return new PluginScrollable($this, opts); 2399 } 2400 2401 }); 2402 }; 2403 2404 $(function() { 2405 PluginScrollable.updateModals(); 2406 }); 2407 2408}).apply(this, [window.theme, jQuery]); 2409 2410// Section Scroll 2411(function(theme, $) { 2412 2413 theme = theme || {}; 2414 2415 var instanceName = '__sectionScroll'; 2416 2417 var PluginSectionScroll = function($el, opts) { 2418 return this.initialize($el, opts); 2419 }; 2420 2421 PluginSectionScroll.defaults = { 2422 targetClass: '.section', 2423 dotsNav: true, 2424 changeHeaderLogo: true, 2425 headerLogoDark: 'img/logo-default-slim.png', 2426 headerLogoLight: 'img/logo-default-slim-dark.png' 2427 }; 2428 2429 PluginSectionScroll.prototype = { 2430 initialize: function($el, opts) { 2431 if ($el.data(instanceName)) { 2432 return this; 2433 } 2434 2435 this.$el = $el; 2436 2437 this 2438 .setData() 2439 .setOptions(opts) 2440 .build() 2441 .events(); 2442 2443 return this; 2444 }, 2445 2446 setData: function() { 2447 this.$el.data(instanceName, this); 2448 2449 return this; 2450 }, 2451 2452 setOptions: function(opts) { 2453 this.options = $.extend(true, {}, PluginSectionScroll.defaults, opts, { 2454 wrapper: this.$el 2455 }); 2456 2457 return this; 2458 }, 2459 2460 build: function() { 2461 var self = this, 2462 $el = this.options.wrapper; 2463 2464 // Check type of header and change the target for header (by change header color purpose) 2465 if( $('html').hasClass('side-header-overlay-full-screen') ) { 2466 self.$header = $('.sticky-wrapper'); 2467 } else { 2468 self.$header = $('#header'); 2469 } 2470 2471 // Turn the section full height or not depeding on the content size 2472 self.updateSectionsHeight(); 2473 2474 // Wrap all sections in a section wrapper 2475 $( this.options.targetClass ).wrap('<div class="section-wrapper"></div>'); 2476 2477 // Set the section wrapper height 2478 $('.section-wrapper').each(function(){ 2479 $(this).height( $(this).find('.section-scroll').outerHeight() ); 2480 }); 2481 2482 // Add active class to the first section on page load 2483 $('.section-wrapper').first().addClass('active'); 2484 2485 var flag = false, 2486 scrollableFlag = false, 2487 touchDirection = '', 2488 touchstartY = 0, 2489 touchendY = 0; 2490 2491 $(window).on('touchstart', function(event) { 2492 touchstartY = event.changedTouches[0].screenY; 2493 }); 2494 2495 var wheelEvent = 'onwheel' in document ? 'wheel' : document.onmousewheel !== undefined ? 'mousewheel' : 'DOMMouseScroll'; 2496 if( $(window).width() < 992 ) { 2497 wheelEvent = 'onwheel' in document ? 'wheel touchend' : document.onmousewheel !== undefined ? 'mousewheel touchend' : 'DOMMouseScroll touchend'; 2498 } 2499 2500 $(window).on(wheelEvent, function(e){ 2501 if( $(window).width() < 992 ) { 2502 if( $(e.target).closest('.section-scroll-dots-navigation').get(0) || $(e.target).closest('.header-body').get(0) || $(e.target).closest('.owl-carousel').get(0) ) { 2503 return; 2504 } 2505 } 2506 2507 // Side Header Overlay Full Screen 2508 if( $('html.side-header-overlay-full-screen.side-header-hide').get(0) ) { 2509 return; 2510 } 2511 2512 var wheelDirection = e.originalEvent.wheelDelta == undefined ? e.originalEvent.deltaY > 0 : e.originalEvent.wheelDelta < 0; 2513 if( $(window).width() < 992 ) { 2514 touchendY = event.changedTouches[0].screenY; 2515 2516 if( touchendY <= touchstartY ) { 2517 touchDirection = 'up'; 2518 } 2519 2520 if( touchendY >= touchstartY ) { 2521 touchDirection = 'down'; 2522 } 2523 2524 if( touchendY == touchstartY ) { 2525 return; 2526 } 2527 } 2528 2529 var $currentSection = $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll'), 2530 $nextSection = self.getNextSection(wheelDirection, touchDirection); 2531 2532 if( $(window).width() < 992 ) { 2533 setTimeout(function(){ 2534 if( $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll').hasClass('section-scroll-scrollable') ) { 2535 $('html').removeClass('overflow-hidden'); 2536 } else { 2537 $('html').addClass('overflow-hidden'); 2538 } 2539 }, 1200); 2540 } 2541 2542 // For non full height sections 2543 if( $currentSection.hasClass('section-scroll-scrollable') ) { 2544 2545 if( !flag && !scrollableFlag ) { 2546 2547 // Scroll Direction 2548 if(wheelDirection || touchDirection == 'up') { 2549 if( ( $(window).scrollTop() + $(window).height() ) >= $nextSection.offset().top ) { 2550 flag = true; 2551 setTimeout(function(){ 2552 $(window).trigger('section.scroll.change.header.color'); 2553 2554 setTimeout(function(){ 2555 flag = false;
2556 }, 500); 2557 }, 1000); 2558 2559 if( self.getCurrentIndex() == ( $('.section-wrapper').length - 1 ) ) { 2560 return false; 2561 } 2562 2563 // Move to the next section 2564 self.moveTo( $currentSection.offset().top + $currentSection.outerHeight() ); 2565 2566 // Change Section Active Class 2567 self.changeSectionActiveState( $nextSection ); 2568 2569 self.$header.css({ 2570 opacity: 0, 2571 transition: 'ease opacity 500ms' 2572 }); 2573 } 2574 2575 if( $(window).width() > 991 ) { 2576 for( var i = 1; i < 100; i++ ) { 2577 $('body, html').scrollTop( $(window).scrollTop() + 1 ); 2578 2579 if( ( $(window).scrollTop() + $(window).height() ) >= $nextSection.offset().top ) { 2580 scrollableFlag = true; 2581 setTimeout(function(){ 2582 $(window).trigger('section.scroll.change.header.color'); 2583 scrollableFlag = false; 2584 }, 500); 2585 break; 2586 } 2587 } 2588 } 2589 } else { 2590 if( $(window).scrollTop() <= $currentSection.offset().top ) { 2591 flag = true; 2592 setTimeout(function(){ 2593 $(window).trigger('section.scroll.change.header.color'); 2594 2595 setTimeout(function(){ 2596 flag = false; 2597 }, 500); 2598 }, 1000); 2599 2600 if( self.getCurrentIndex() == 0 ) { 2601 return false; 2602 } 2603 2604 // Move to the next section 2605 self.moveTo( $currentSection.offset().top - $(window).height() ); 2606 2607 // Change Section Active Class 2608 self.changeSectionActiveState( $nextSection ); 2609 2610 self.$header.css({ 2611 opacity: 0, 2612 transition: 'ease opacity 500ms' 2613 }); 2614 } 2615 2616 if( $(window).width() > 991 ) { 2617 for( var i = 1; i < 100; i++ ) { 2618 $('body, html').scrollTop( $(window).scrollTop() - 1 ); 2619 2620 if( $(window).scrollTop() <= $currentSection.offset().top ) { 2621 scrollableFlag = true; 2622 setTimeout(function(){ 2623 $(window).trigger('section.scroll.change.header.color'); 2624 scrollableFlag = false; 2625 }, 500); 2626 break; 2627 } 2628 } 2629 } 2630 } 2631 2632 // Change Dots Active Class 2633 self.changeDotsActiveState(); 2634 2635 return; 2636 2637 } 2638 } 2639 2640 // For full height sections 2641 if( !flag && !scrollableFlag ) { 2642 2643 if(wheelDirection || touchDirection == 'up') { 2644 if( self.getCurrentIndex() == ( $('.section-wrapper').length - 1 ) ) { 2645 return false; 2646 } 2647 2648 // Change Section Active Class 2649 self.changeSectionActiveState( $nextSection ); 2650 2651 setTimeout(function(){ 2652 // Move to the next section 2653 self.moveTo( $nextSection.offset().top ); 2654 2655 }, 150); 2656 } else { 2657 if( self.getCurrentIndex() == 0 ) { 2658 return false; 2659 } 2660 2661 // Change Section Active Class 2662 self.changeSectionActiveState( $nextSection ); 2663 2664 if( $nextSection.height() > $(window).height() ) { 2665 // Move to the next section 2666 self.moveTo( $currentSection.offset().top - $(window).height() ); 2667 } else { 2668 setTimeout(function(){ 2669 // Move to the next section 2670 self.moveTo( $nextSection.offset().top ); 2671 2672 }, 150); 2673 } 2674 } 2675 2676 // Change Dots Active Class 2677 self.changeDotsActiveState(); 2678 2679 self.$header.css({ 2680 opacity: 0, 2681 transition: 'ease opacity 500ms' 2682 }); 2683 2684 // Style next section 2685 $nextSection.css({ 2686 position: 'relative', 2687 opacity: 1, 2688 'z-index': 1, 2689 transform: 'translate3d(0,0,0) scale(1)' 2690 }); 2691 2692 // Style previous section 2693 $currentSection.css({ 2694 position: 'fixed', 2695 width: '100%', 2696 top: 0, 2697 left: 0, 2698 opacity: 0, 2699 'z-index': 0,
2700 transform: 'translate3d(0,0,-10px) scale(0.7)', 2701 transition: 'ease transform 600ms, ease opacity 600ms', 2702 }); 2703 2704 setTimeout(function(){ 2705 $currentSection.css({ 2706 position: 'relative', 2707 opacity: 1, 2708 transform: 'translate3d(0,0,-10px) scale(1)' 2709 }); 2710 2711 $(window).trigger('section.scroll.change.header.color'); 2712 2713 setTimeout(function(){ 2714 flag = false; 2715 }, 500); 2716 }, 1000); 2717 2718 flag = true; 2719 2720 } 2721 2722 return; 2723 }); 2724 2725 // Dots Navigation 2726 if( this.options.dotsNav ) { 2727 self.dotsNavigation(); 2728 } 2729 2730 // First Load 2731 setTimeout(function(){ 2732 if( $(window.location.hash).get(0) ) { 2733 self.moveTo( $(window.location.hash).parent().offset().top ); 2734 2735 self.changeSectionActiveState( $(window.location.hash) ); 2736 2737 // Change Dots Active Class 2738 self.changeDotsActiveState(); 2739 2740 self.updateHash( true ); 2741 } else { 2742 var hash = window.location.hash, 2743 index = hash.replace('#',''); 2744 2745 if( !hash ) { 2746 index = 1; 2747 } 2748 2749 self.moveTo( $('.section-wrapper').eq( index - 1 ).offset().top ); 2750 2751 self.changeSectionActiveState( $('.section-wrapper').eq( index - 1 ).find('.section-scroll') ); 2752 2753 // Change Dots Active Class 2754 self.changeDotsActiveState(); 2755 2756 self.updateHash( true ); 2757 } 2758 2759 $(window).trigger('section.scroll.ready'); 2760 }, 500); 2761 2762 return this; 2763 }, 2764 2765 updateSectionsHeight: function() { 2766 var self = this; 2767 2768 $('.section-scroll').each(function(){ 2769 if( $(this).outerHeight() < ( $(window).height() + 3 ) ) { 2770 $(this).css({ height: '100vh' }); 2771 } else { 2772 $(this).addClass('section-scroll-scrollable'); 2773 } 2774 }); 2775 2776 return this; 2777 }, 2778 2779 updateHash: function( first_load ){ 2780 var self = this; 2781 2782 if( !window.location.hash ) { 2783 window.location.hash = 1; 2784 } else { 2785 if(!first_load) { 2786 var $section = $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll'), 2787 section_id = $section.attr('id') ? $section.attr('id') : $section.parent().index() + 1; 2788 2789 window.location.hash = section_id; 2790 } 2791 } 2792 2793 return this; 2794 }, 2795 2796 getCurrentIndex: function() { 2797 var self = this, 2798 currentIndex = 0; 2799 2800 currentIndex = $('.section-wrapper.active').index(); 2801 2802 return currentIndex; 2803 }, 2804 2805 moveTo: function( $scrollTopValue, first_load ) { 2806 var self = this; 2807 2808 $('body, html').animate({ 2809 scrollTop: $scrollTopValue 2810 }, 1000, 'easeOutQuint'); 2811 2812 setTimeout(function(){ 2813 self.updateHash(); 2814 }, 500); 2815 2816 return this; 2817 }, 2818 2819 getNextSection: function(wheelDirection, touchDirection) { 2820 var self = this, 2821 $nextSection = ''; 2822 2823 // Scroll Direction 2824 if(wheelDirection || touchDirection == 'up') { 2825 $nextSection = $('.section-wrapper').eq( self.getCurrentIndex() + 1 ).find('.section-scroll'); 2826 } else { 2827 $nextSection = $('.section-wrapper').eq( self.getCurrentIndex() - 1 ).find('.section-scroll'); 2828 } 2829 2830 return $nextSection; 2831 }, 2832 2833 changeSectionActiveState: function( $nextSection ) { 2834 var self = this; 2835 2836 $('.section-wrapper').removeClass('active'); 2837 $nextSection.parent().addClass('active'); 2838 2839 return this; 2840 }, 2841 2842 changeDotsActiveState: function() { 2843 var self = this; 2844 2845 $('.section-scroll-dots-navigation > ul > li').removeClass('active'); 2846 $('.section-scroll-dots-navigation > ul > li').eq( self.getCurrentIndex() ).addClass('active'); 2847 2848 return this; 2849 }, 2850 2851 dotsNavigation: function() { 2852 var self = this; 2853 2854 var dotsNav = $('<div class="section-scroll-dots-navigation"><ul class="list list-unstyled"></ul></div>'), 2855 currentSectionIndex = self.getCurrentIndex(); 2856 2857 if( self.options.dotsClass ) { 2858 dotsNav.addClass( self.options.dotsClass ); 2859 } 2860 2861 for( var i = 0; i < $('.section-scroll').length; i++ ) { 2862 var title = $('.section-wrapper').eq( i ).find('.section-scroll').data('section-scroll-title'); 2863 2864 dotsNav.find('> ul').append( '<li'+ ( ( currentSectionIndex == i ) ? ' class="active"' : '' ) +'><a href="#'+ i +'" data-nav-id="'+ i +'"><span>'+ title +'</span></a></li>' ); 2865 } 2866 2867 $('.body').append( dotsNav ); 2868 2869 dotsNav.find('a[data-nav-id]').on('click touchstart', function(e){ 2870 e.preventDefault(); 2871 var $this = $(this); 2872 2873 $('.section-scroll').css({ 2874 opacity: 0, 2875 transition: 'ease opacity 300ms' 2876 }); 2877 2878 self.$header.css({ 2879 opacity: 0, 2880 transition: 'ease opacity 500ms' 2881 }); 2882 2883 setTimeout(function(){
2884 self.moveTo( $('.section-wrapper').eq( $this.data('nav-id') ).offset().top ) 2885 2886 $('.section-wrapper').removeClass('active'); 2887 $('.section-wrapper').eq( $this.data('nav-id') ).addClass('active'); 2888 2889 $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll').css({ 2890 opacity: 1 2891 }); 2892 2893 setTimeout(function(){ 2894 $('.section-scroll').css({ opacity: 1 }); 2895 2896 $(window).trigger('section.scroll.change.header.color'); 2897 }, 500); 2898 2899 self.changeDotsActiveState(); 2900 }, 500); 2901 }); 2902 2903 return this; 2904 }, 2905 2906 events: function() { 2907 var self = this; 2908 2909 $(window).on('section.scroll.ready', function(){ 2910 $(window).scrollTop(0); 2911 }); 2912 2913 $(window).on('section.scroll.change.header.color', function(){ 2914 var headerColor = $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll').data('section-scroll-header-color'); 2915 2916 $('#header .header-nav').removeClass('header-nav-light-text header-nav-dark-text').addClass('header-nav-' + headerColor + '-text'); 2917 $('#header .header-nav-features').removeClass('header-nav-features-dark header-nav-features-light').addClass('header-nav-features-' + headerColor); 2918 $('#header .header-social-icons').removeClass('social-icons-icon-dark social-icons-icon-light').addClass('social-icons-icon-' + headerColor); 2919 2920 // Change Logo 2921 if( self.options.changeHeaderLogo && headerColor != undefined ) { 2922 if( headerColor == 'light' ) { 2923 $('#header .header-logo img').attr('src', self.options.headerLogoLight); 2924 } else if( headerColor == 'dark' ) { 2925 $('#header .header-logo img').attr('src', self.options.headerLogoDark); 2926 } 2927 } 2928 2929 self.$header.css({ 2930 opacity: 1 2931 }); 2932 }); 2933 2934 $(document).ready(function(){ 2935 $(window).afterResize(function(){ 2936 self.updateSectionsHeight(); 2937 }); 2938 }); 2939 2940 return this; 2941 } 2942 }; 2943 2944 // expose to scope 2945 $.extend(theme, { 2946 PluginSectionScroll: PluginSectionScroll 2947 }); 2948 2949 // jquery plugin 2950 $.fn.themePluginSectionScroll = function(opts) { 2951 return this.map(function() { 2952 var $this = $(this); 2953 2954 if ($this.data(instanceName)) { 2955 return $this.data(instanceName); 2956 } else { 2957 return new PluginSectionScroll($this, opts); 2958 } 2959 2960 }); 2961 }; 2962 2963}).apply(this, [window.theme, jQuery]); 2964 2965// Sort 2966(function(theme, $) { 2967 2968 theme = theme || {}; 2969 2970 var instanceName = '__sort'; 2971 2972 var PluginSort = function($el, opts) { 2973 return this.initialize($el, opts); 2974 }; 2975 2976 PluginSort.defaults = { 2977 useHash: true, 2978 itemSelector: '.isotope-item', 2979 layoutMode: 'masonry', 2980 filter: '*', 2981 hiddenStyle: { 2982 opacity: 0 2983 }, 2984 visibleStyle: { 2985 opacity: 1 2986 }, 2987 stagger: 30, 2988 isOriginLeft: ($('html').attr('dir') == 'rtl' ? false : true) 2989 }; 2990 2991 PluginSort.prototype = { 2992 initialize: function($el, opts) { 2993 if ($el.data(instanceName)) { 2994 return this; 2995 } 2996 2997 this.$el = $el; 2998 2999 this 3000 .setData() 3001 .setOptions(opts) 3002 .build(); 3003 3004 return this; 3005 }, 3006 3007 setData: function() { 3008 this.$el.data(instanceName, this); 3009 3010 return this; 3011 }, 3012 3013 setOptions: function(opts) { 3014 this.options = $.extend(true, {}, PluginSort.defaults, opts, { 3015 wrapper: this.$el 3016 }); 3017 3018 return this; 3019 }, 3020 3021 build: function() { 3022 if (!($.isFunction($.fn.isotope))) { 3023 return this; 3024 } 3025 3026 var self = this, 3027 $source = this.options.wrapper, 3028 $destination = $('.sort-destination[data-sort-id="' + $source.attr('data-sort-id') + '"]'), 3029 $window = $(window); 3030 3031 if ($destination.get(0)) { 3032 3033 self.$source = $source; 3034 self.$destination = $destination; 3035 self.$loader = false;
3036 3037 self.setParagraphHeight($destination); 3038 3039 if (self.$destination.parents('.sort-destination-loader').get(0)) { 3040 self.$loader = self.$destination.parents('.sort-destination-loader'); 3041 self.createLoader(); 3042 } 3043 3044 $destination.attr('data-filter', '*'); 3045 3046 $destination.one('layoutComplete', function(event, laidOutItems) { 3047 self.removeLoader(); 3048 }); 3049 3050 // IE10/11 fix 3051 if( $('html').hasClass('ie10') || $('html').hasClass('ie11') ) { 3052 var padding = parseInt( self.options.wrapper.children().css('padding-left') ) + parseInt( self.options.wrapper.children().css('padding-right') ); 3053 } 3054 3055 $destination.waitForImages(function() { 3056 $destination.isotope(self.options); 3057 self.events(); 3058 }); 3059 3060 3061 setTimeout(function() { 3062 self.removeLoader(); 3063 }, 3000); 3064 3065 } 3066 3067 return this; 3068 }, 3069 3070 events: function() { 3071 var self = this, 3072 filter = null, 3073 $window = $(window); 3074 3075 self.$source.find('a').click(function(e) { 3076 e.preventDefault(); 3077 3078 filter = $(this).parent().data('option-value'); 3079 3080 self.setFilter(filter); 3081 3082 if (e.originalEvent) { 3083 self.$source.trigger('filtered'); 3084 } 3085 3086 return this; 3087 }); 3088 3089 self.$destination.trigger('filtered'); 3090 self.$source.trigger('filtered'); 3091 3092 if (self.options.useHash) { 3093 self.hashEvents(); 3094 } 3095 3096 $window.on('resize', function() { 3097 setTimeout(function() { 3098 self.$destination.isotope('layout'); 3099 }, 300); 3100 }); 3101 3102 setTimeout(function() { 3103 $window.trigger('resize'); 3104 }, 300); 3105 3106 return this; 3107 }, 3108 3109 setFilter: function(filter) { 3110 var self = this, 3111 page = false, 3112 currentFilter = filter; 3113 3114 self.$source.find('.active').removeClass('active'); 3115 self.$source.find('li[data-option-value="' + filter + '"], li[data-option-value="' + filter + '"] > a').addClass('active'); 3116 3117 self.options.filter = currentFilter; 3118 3119 if (self.$destination.attr('data-current-page')) { 3120 currentFilter = currentFilter + '[data-page-rel=' + self.$destination.attr('data-current-page') + ']'; 3121 } 3122 3123 self.$destination.attr('data-filter', filter).isotope({ 3124 filter: currentFilter 3125 }).one('arrangeComplete', function( event, filteredItems ) { 3126 3127 if (self.options.useHash) { 3128 if (window.location.hash != '' || self.options.filter.replace('.', '') != '*') { 3129 window.location.hash = self.options.filter.replace('.', ''); 3130 } 3131 } 3132 3133 $(window).trigger('scroll'); 3134 3135 }).trigger('filtered'); 3136 3137 return this; 3138 }, 3139 3140 hashEvents: function() { 3141 var self = this, 3142 hash = null, 3143 hashFilter = null, 3144 initHashFilter = '.' + location.hash.replace('#', ''); 3145 3146 if (initHashFilter != '.' && initHashFilter != '.*') { 3147 self.setFilter(initHashFilter); 3148 } 3149 3150 $(window).on('hashchange', function(e) { 3151 3152 hashFilter = '.' + location.hash.replace('#', ''); 3153 hash = (hashFilter == '.' || hashFilter == '.*' ? '*' : hashFilter); 3154 3155 self.setFilter(hash); 3156 3157 }); 3158 3159 return this; 3160 }, 3161 3162 setParagraphHeight: function() { 3163 var self = this, 3164 minParagraphHeight = 0, 3165 paragraphs = $('span.thumb-info-caption p', self.$destination); 3166 3167 paragraphs.each(function() { 3168 if ($(this).height() > minParagraphHeight) { 3169 minParagraphHeight = ($(this).height() + 10); 3170 } 3171 }); 3172 3173 paragraphs.height(minParagraphHeight); 3174 3175 return this; 3176 }, 3177 3178 createLoader: function() { 3179 var self = this; 3180 3181 var loaderTemplate = [ 3182 '<div class="bounce-loader">', 3183 '<div class="bounce1"></div>', 3184 '<div class="bounce2"></div>', 3185 '<div class="bounce3"></div>', 3186 '</div>' 3187 ].join(''); 3188 3189 self.$loader.append(loaderTemplate); 3190 3191 return this; 3192 }, 3193 3194 removeLoader: function() { 3195 3196 var self = this; 3197 3198 if (self.$loader) { 3199 3200 self.$loader.removeClass('sort-destination-loader-showing'); 3201 3202 setTimeout(function() { 3203 self.$loader.addClass('sort-destination-loader-loaded'); 3204 }, 300); 3205 3206 } 3207 3208 } 3209 3210 }; 3211 3212 // expose to scope 3213 $.extend(theme, { 3214 PluginSort: PluginSort 3215 }); 3216 3217 // jquery plugin 3218 $.fn.themePluginSort = function(opts) { 3219 return this.map(function() { 3220 var $this = $(this); 3221 3222 if ($this.data(instanceName)) { 3223 return $this.data(instanceName); 3224 } else { 3225 return new PluginSort($this, opts); 3226 } 3227 3228 }); 3229 } 3230 3231}).apply(this, [window.theme, jQuery]); 3232 3233// Star Rating 3234(function(theme, $) { 3235 3236 theme = theme || {}; 3237 3238 var instanceName = '__starrating'; 3239 3240 var PluginStarRating = function($el, opts) { 3241 return this.initialize($el, opts); 3242 }; 3243 3244 PluginStarRating.defaults = { 3245 theme: 'krajee-fas', 3246 color: 'primary', 3247 showClear: false, 3248 showCaption: false 3249 }; 3250 3251 PluginStarRating.prototype = { 3252 initialize: function($el, opts) { 3253 this.$el = $el; 3254 3255 this 3256 .setData() 3257 .setOptions(opts) 3258 .build(); 3259 3260 return this; 3261 }, 3262 3263 setData: function() { 3264 this.$el.data(instanceName, this); 3265 3266 return this; 3267 }, 3268 3269 setOptions: function(opts) { 3270 this.options = $.extend(true, {}, PluginStarRating.defaults, opts, { 3271 wrapper: this.$el 3272 }); 3273 3274 return this; 3275 }, 3276 3277 build: function() { 3278 3279 if (!($.isFunction($.fn.rating))) { 3280 return this; 3281 } 3282 3283 var self = this; 3284 3285 self.options.wrapper 3286 .rating(self.options); 3287 3288 self.options.wrapper.parents('.rating-container') 3289 .addClass('rating-' + self.options.color); 3290 3291 return this; 3292 3293 } 3294 }; 3295 3296 // expose to scope 3297 $.extend(theme, { 3298 PluginStarRating: PluginStarRating 3299 }); 3300 3301 // jquery plugin 3302 $.fn.themePluginStarRating = function(opts) { 3303 return this.map(function() { 3304 var $this = $(this); 3305 3306 if ($this.data(instanceName)) { 3307 return $this.data(instanceName); 3308 } else { 3309 return new PluginStarRating($this, opts); 3310 } 3311 3312 }); 3313 } 3314 3315}).apply(this, [window.theme, jQuery]); 3316 3317// Sticky 3318(function(theme, $) { 3319 3320 theme = theme || {}; 3321 3322 var instanceName = '__sticky'; 3323 3324 var PluginSticky = function($el, opts) { 3325 return this.initialize($el, opts); 3326 }; 3327 3328 PluginSticky.defaults = { 3329 minWidth: 991, 3330 activeClass: 'sticky-active' 3331 }; 3332 3333 PluginSticky.prototype = { 3334 initialize: function($el, opts) { 3335 if ( $el.data( instanceName ) ) { 3336 return this; 3337 } 3338 3339 this.$el = $el; 3340 3341 this 3342 .setData() 3343 .setOptions(opts) 3344 .build() 3345 .events(); 3346 3347 return this; 3348 }, 3349 3350 setData: function() { 3351 this.$el.data(instanceName, this); 3352 3353 return this; 3354 }, 3355 3356 setOptions: function(opts) { 3357 this.options = $.extend(true, {}, PluginSticky.defaults, opts, { 3358 wrapper: this.$el 3359 }); 3360 3361 return this; 3362 }, 3363 3364 build: function() { 3365 if (!($.isFunction($.fn.pin))) { 3366 return this; 3367 } 3368 3369 var self = this, 3370 $window = $(window); 3371 3372 self.options.wrapper.pin(self.options); 3373 3374 if( self.options.wrapper.hasClass('sticky-wrapper-transparent') ) { 3375 self.options.wrapper.parent().addClass('position-absolute w-100'); 3376 } 3377 3378 $window.afterResize(function() { 3379 self.options.wrapper.removeAttr('style').removeData('pin'); 3380 self.options.wrapper.pin(self.options); 3381 $window.trigger('scroll'); 3382 }); 3383 3384 // Change Logo Src 3385 if( self.options.wrapper.find('img').attr('data-change-src') ) { 3386 var $logo = self.options.wrapper.find('img'), 3387 logoSrc = $logo.attr('src'), 3388 logoNewSrc = $logo.attr('data-change-src'); 3389 3390 self.changeLogoSrc = function(activate) { 3391 if(activate) { 3392 $logo.attr('src', logoNewSrc); 3393 } else { 3394 $logo.attr('src', logoSrc); 3395 } 3396 } 3397 } 3398 3399 return this; 3400 }, 3401 3402 events: function() { 3403 var self = this, 3404 $window = $(window), 3405 $logo = self.options.wrapper.find('img'), 3406 sticky_activate_flag = true, 3407 sticky_deactivate_flag = false, 3408 class_to_check = ( self.options.wrapper.hasClass('sticky-wrapper-effect-1') ) ? 'sticky-effect-active' : 'sticky-active'; 3409 3410 $window.on('scroll sticky.effect.active', function(){ 3411 if( self.options.wrapper.hasClass( class_to_check ) ) { 3412 if( sticky_activate_flag ) { 3413 if( $logo.attr('data-change-src') ) { 3414 self.changeLogoSrc(true); 3415 } 3416 3417 sticky_activate_flag = false;
3418 sticky_deactivate_flag = true; 3419 } 3420 } else { 3421 if( sticky_deactivate_flag ) { 3422 if( $logo.attr('data-change-src') ) { 3423 self.changeLogoSrc(false); 3424 } 3425 3426 sticky_deactivate_flag = false; 3427 sticky_activate_flag = true; 3428 } 3429 } 3430 }); 3431 3432 var is_backing = false; 3433 if( self.options.stickyStartEffectAt ) { 3434 3435 // First Load 3436 if( self.options.stickyStartEffectAt < $window.scrollTop() ) { 3437 self.options.wrapper.addClass('sticky-effect-active'); 3438 3439 $window.trigger('sticky.effect.active'); 3440 } 3441 3442 $window.on('scroll', function(){ 3443 if( self.options.stickyStartEffectAt < $window.scrollTop() ) { 3444 self.options.wrapper.addClass('sticky-effect-active'); 3445 is_backing = true; 3446 3447 $window.trigger('sticky.effect.active'); 3448 } else { 3449 if( is_backing ) { 3450 self.options.wrapper.find('.sticky-body').addClass('position-fixed'); 3451 is_backing = false; 3452 } 3453 3454 if( $window.scrollTop() == 0 ) { 3455 self.options.wrapper.find('.sticky-body').removeClass('position-fixed'); 3456 } 3457 3458 self.options.wrapper.removeClass('sticky-effect-active'); 3459 } 3460 }); 3461 } 3462 } 3463 }; 3464 3465 // expose to scope 3466 $.extend(theme, { 3467 PluginSticky: PluginSticky 3468 }); 3469 3470 // jquery plugin 3471 $.fn.themePluginSticky = function(opts) { 3472 return this.map(function() { 3473 var $this = $(this); 3474 3475 if ($this.data(instanceName)) { 3476 return $this.data(instanceName); 3477 } else { 3478 return new PluginSticky($this, opts); 3479 } 3480 3481 }); 3482 } 3483 3484}).apply(this, [ window.theme, jQuery ]); 3485 3486// Toggle 3487(function(theme, $) { 3488 3489 theme = theme || {}; 3490 3491 var instanceName = '__toggle'; 3492 3493 var PluginToggle = function($el, opts) { 3494 return this.initialize($el, opts); 3495 }; 3496 3497 PluginToggle.defaults = { 3498 duration: 350, 3499 isAccordion: false 3500 }; 3501 3502 PluginToggle.prototype = { 3503 initialize: function($el, opts) { 3504 if ($el.data(instanceName)) { 3505 return this; 3506 } 3507 3508 this.$el = $el; 3509 3510 this 3511 .setData() 3512 .setOptions(opts) 3513 .build(); 3514 3515 return this; 3516 }, 3517 3518 setData: function() { 3519 this.$el.data(instanceName, this); 3520 3521 return this; 3522 }, 3523 3524 setOptions: function(opts) { 3525 this.options = $.extend(true, {}, PluginToggle.defaults, opts, { 3526 wrapper: this.$el 3527 }); 3528 3529 return this; 3530 }, 3531 3532 build: function() { 3533 var self = this, 3534 $wrapper = this.options.wrapper, 3535 $items = $wrapper.find('> .toggle'), 3536 $el = null; 3537 3538 $items.each(function() { 3539 $el = $(this); 3540 3541 if ($el.hasClass('active')) { 3542 $el.find('> p').addClass('preview-active'); 3543 $el.find('> .toggle-content').slideDown(self.options.duration); 3544 } 3545 3546 self.events($el); 3547 }); 3548 3549 if (self.options.isAccordion) { 3550 self.options.duration = self.options.duration / 2; 3551 } 3552 3553 return this; 3554 }, 3555 3556 events: function($el) { 3557 var self = this, 3558 previewParCurrentHeight = 0, 3559 previewParAnimateHeight = 0, 3560 toggleContent = null; 3561 3562 $el.find('> label').click(function(e) { 3563 3564 var $this = $(this), 3565 parentSection = $this.parent(), 3566 parentWrapper = $this.parents('.toggle'), 3567 previewPar = null, 3568 closeElement = null; 3569 3570 if (self.options.isAccordion && typeof(e.originalEvent) != 'undefined') { 3571 closeElement = parentWrapper.find('.toggle.active > label'); 3572 3573 if (closeElement[0] == $this[0]) { 3574 return; 3575 } 3576 } 3577 3578 parentSection.toggleClass('active'); 3579 3580 // Preview Paragraph 3581 if (parentSection.find('> p').get(0)) { 3582 3583 previewPar = parentSection.find('> p'); 3584 previewParCurrentHeight = previewPar.css('height'); 3585 previewPar.css('height', 'auto'); 3586 previewParAnimateHeight = previewPar.css('height'); 3587 previewPar.css('height', previewParCurrentHeight); 3588 3589 } 3590 3591 // Content 3592 toggleContent = parentSection.find('> .toggle-content'); 3593 3594 if (parentSection.hasClass('active')) { 3595 3596 $(previewPar).animate({ 3597 height: previewParAnimateHeight 3598 }, self.options.duration, function() { 3599 $(this).addClass('preview-active'); 3600 }); 3601 3602 toggleContent.slideDown(self.options.duration, function() { 3603 if (closeElement) { 3604 closeElement.trigger('click'); 3605 } 3606 }); 3607 3608 } else { 3609 3610 $(previewPar).animate({ 3611 height: 0 3612 }, self.options.duration, function() { 3613 $(this).removeClass('preview-active'); 3614 }); 3615 3616 toggleContent.slideUp(self.options.duration); 3617 3618 } 3619 3620 }); 3621 } 3622 }; 3623 3624 // expose to scope 3625 $.extend(theme, { 3626 PluginToggle: PluginToggle 3627 }); 3628 3629 // jquery plugin 3630 $.fn.themePluginToggle = function(opts) { 3631 return this.map(function() { 3632 var $this = $(this); 3633 3634 if ($this.data(instanceName)) { 3635 return $this.data(instanceName); 3636 } else { 3637 return new PluginToggle($this, opts); 3638 } 3639 3640 }); 3641 } 3642 3643}).apply(this, [window.theme, jQuery]); 3644 3645// Tweets 3646(function(theme, $) { 3647 3648 theme = theme || {}; 3649 3650 var instanceName = '__tweets'; 3651 3652 var PluginTweets = function($el, opts) { 3653 return this.initialize($el, opts); 3654 }; 3655 3656 PluginTweets.defaults = { 3657 username: null, 3658 count: 2, 3659 URL: 'php/twitter-feed.php' 3660 }; 3661 3662 PluginTweets.prototype = { 3663 initialize: function($el, opts) { 3664 if ($el.data(instanceName)) { 3665 return this; 3666 } 3667 3668 this.$el = $el; 3669 3670 this 3671 .setData() 3672 .setOptions(opts) 3673 .build(); 3674 3675 return this; 3676 }, 3677 3678 setData: function() { 3679 this.$el.data(instanceName, this); 3680 3681 return this; 3682 }, 3683 3684 setOptions: function(opts) { 3685 this.options = $.extend(true, {}, PluginTweets.defaults, opts, { 3686 wrapper: this.$el 3687 }); 3688 3689 return this; 3690 }, 3691 3692 build: function() { 3693 if (this.options.username == null || this.options.username == '') { 3694 return this; 3695 } 3696 3697 var self = this, 3698 $wrapper = this.options.wrapper; 3699 3700 $.ajax({ 3701 type: 'GET', 3702 data: { 3703 twitter_screen_name: self.options.username, 3704 tweets_to_display: self.options.count 3705 }, 3706 url: self.options.URL, 3707 }).done(function(html) { 3708 $wrapper.html(html).find('a').attr('target','_blank'); 3709 }); 3710 3711 return this; 3712 } 3713 }; 3714 3715 // expose to scope 3716 $.extend(theme, { 3717 PluginTweets: PluginTweets 3718 }); 3719 3720 // jquery plugin 3721 $.fn.themePluginTweets = function(opts) { 3722 return this.map(function() { 3723 var $this = $(this); 3724 3725 if ($this.data(instanceName)) { 3726 return $this.data(instanceName); 3727 } else { 3728 return new PluginTweets($this, opts); 3729 } 3730 3731 }); 3732 } 3733 3734}).apply(this, [window.theme, jQuery]); 3735 3736// Validation 3737(function(theme, $) { 3738 3739 theme = theme || {}; 3740 3741 $.extend(theme, { 3742 3743 PluginValidation: { 3744 3745 defaults: { 3746 formClass: 'needs-validation', 3747 validator: { 3748 highlight: function(element) { 3749 $(element) 3750 .addClass('is-invalid') 3751 .removeClass('is-valid') 3752 .parent() 3753 .removeClass('has-success') 3754 .addClass('has-danger'); 3755 }, 3756 success: function(label, element) { 3757 $(element) 3758 .removeClass('is-invalid') 3759 .addClass('is-valid') 3760 .parent() 3761 .removeClass('has-danger') 3762 .addClass('has-success') 3763 .find('label.error') 3764 .remove(); 3765 }, 3766 errorPlacement: function(error, element) { 3767 if (element.attr('type') == 'radio' || element.attr('type') == 'checkbox') { 3768 error.appendTo(element.parent().parent()); 3769 } else { 3770 error.insertAfter(element); 3771 } 3772 } 3773 }, 3774 validateCaptchaURL: 'php/contact-form-verify-captcha.php', 3775 refreshCaptchaURL: 'php/contact-form-refresh-captcha.php' 3776 }, 3777 3778 initialize: function(opts) { 3779 initialized = true; 3780 3781 this 3782 .setOptions(opts) 3783 .build(); 3784 3785 return this; 3786 }, 3787 3788 setOptions: function(opts) { 3789 this.options = $.extend(true, {}, this.defaults, opts); 3790 3791 return this; 3792 }, 3793 3794 build: function() { 3795 var self = this; 3796 3797 if (!($.isFunction($.validator))) { 3798 return this; 3799 } 3800 3801 self.addMethods(); 3802 self.setMessageGroups(); 3803 3804 $.validator.setDefaults(self.options.validator); 3805
3806 $('.' + self.options.formClass).validate(); 3807 3808 return this; 3809 }, 3810 3811 addMethods: function() { 3812 var self = this; 3813 3814 $.validator.addMethod('captcha', function(value, element, params) { 3815 var captchaValid = false; 3816 3817 $.ajax({ 3818 url: self.options.validateCaptchaURL, 3819 type: 'POST', 3820 async: false, 3821 dataType: 'json', 3822 data: { 3823 captcha: $.trim(value) 3824 }, 3825 success: function(data) { 3826 if (data.response == 'success') { 3827 captchaValid = true; 3828 } 3829 } 3830 }); 3831 3832 if (captchaValid) { 3833 return true; 3834 } 3835 3836 }, ''); 3837 3838 // Refresh Captcha 3839 $('#refreshCaptcha').on('click', function(e) { 3840 e.preventDefault(); 3841 $.get(self.options.refreshCaptchaURL, function(url) { 3842 $('#captcha-image').attr('src', url); 3843 }); 3844 }); 3845 3846 }, 3847 3848 setMessageGroups: function() { 3849 3850 $('.checkbox-group[data-msg-required], .radio-group[data-msg-required]').each(function() { 3851 var message = $(this).data('msg-required'); 3852 $(this).find('input').attr('data-msg-required', message); 3853 }); 3854 3855 } 3856 3857 } 3858 3859 }); 3860 3861}).apply(this, [window.theme, jQuery]); 3862 3863// Video Background 3864(function(theme, $) { 3865 3866 theme = theme || {}; 3867 3868 var instanceName = '__videobackground'; 3869 3870 var PluginVideoBackground = function($el, opts) { 3871 return this.initialize($el, opts); 3872 }; 3873 3874 PluginVideoBackground.defaults = { 3875 overlay: false, 3876 volume: 1, 3877 playbackRate: 1, 3878 muted: true, 3879 loop: true, 3880 autoplay: true, 3881 position: '50% 50%', 3882 posterType: 'detect' 3883 }; 3884 3885 PluginVideoBackground.prototype = { 3886 initialize: function($el, opts) { 3887 this.$el = $el; 3888 3889 this 3890 .setData() 3891 .setOptions(opts) 3892 .build(); 3893 3894 return this; 3895 }, 3896 3897 setData: function() { 3898 this.$el.data(instanceName, this); 3899 3900 return this; 3901 }, 3902 3903 setOptions: function(opts) { 3904 this.options = $.extend(true, {}, PluginVideoBackground.defaults, opts, { 3905 path: this.$el.data('video-path'), 3906 wrapper: this.$el 3907 }); 3908 3909 return this; 3910 }, 3911 3912 build: function() { 3913 3914 if (!($.isFunction($.fn.vide)) || (!this.options.path)) { 3915 return this; 3916 } 3917 3918 if (this.options.overlay) { 3919 3920 var overlayClass = this.options.overlayClass; 3921 3922 this.options.wrapper.prepend( 3923 $('<div />').addClass(overlayClass) 3924 ); 3925 } 3926 3927 this.options.wrapper 3928 .vide(this.options.path, this.options) 3929 .first().css('z-index', 0); 3930 3931 return this; 3932 } 3933 }; 3934 3935 // expose to scope 3936 $.extend(theme, { 3937 PluginVideoBackground: PluginVideoBackground 3938 }); 3939 3940 // jquery plugin 3941 $.fn.themePluginVideoBackground = function(opts) { 3942 return this.map(function() { 3943 var $this = $(this); 3944 3945 if ($this.data(instanceName)) { 3946 return $this.data(instanceName); 3947 } else { 3948 return new PluginVideoBackground($this, opts); 3949 } 3950 3951 }); 3952 } 3953 3954}).apply(this, [window.theme, jQuery]); 3955 3956// Account 3957(function(theme, $) { 3958 3959 theme = theme || {}; 3960 3961 var initialized = false; 3962 3963 $.extend(theme, { 3964 3965 Account: { 3966 3967 defaults: { 3968 wrapper: $('#headerAccount') 3969 }, 3970 3971 initialize: function($wrapper, opts) { 3972 if (initialized) { 3973 return this; 3974 } 3975 3976 initialized = true; 3977 this.$wrapper = ($wrapper || this.defaults.wrapper); 3978 3979 this 3980 .setOptions(opts) 3981 .events(); 3982 3983 return this; 3984 }, 3985 3986 setOptions: function(opts) { 3987 this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options'))); 3988 3989 return this; 3990 }, 3991 3992 events: function() { 3993 var self = this; 3994 3995 $(window).on('load', function(){ 3996 $(document).ready(function(){ 3997 setTimeout(function(){ 3998 3999 self.$wrapper.find('input').on('focus', function() { 4000 self.$wrapper.addClass('open'); 4001 4002 $(document).mouseup(function(e) { 4003 if (!self.$wrapper.is(e.target) && self.$wrapper.has(e.target).length === 0) { 4004 self.$wrapper.removeClass('open'); 4005 } 4006 }); 4007 }); 4008 4009 }, 1500); 4010 }); 4011 }); 4012 4013 $('#headerSignUp').on('click', function(e) { 4014 e.preventDefault(); 4015 self.$wrapper.addClass('signup').removeClass('signin').removeClass('recover'); 4016 self.$wrapper.find('.signup-form input:first').focus(); 4017 }); 4018 4019 $('#headerSignIn').on('click', function(e) { 4020 e.preventDefault(); 4021 self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover'); 4022 self.$wrapper.find('.signin-form input:first').focus(); 4023 }); 4024 4025 $('#headerRecover').on('click', function(e) { 4026 e.preventDefault(); 4027 self.$wrapper.addClass('recover').removeClass('signup').removeClass('signin'); 4028 self.$wrapper.find('.recover-form input:first').focus(); 4029 }); 4030 4031 $('#headerRecoverCancel').on('click', function(e) { 4032 e.preventDefault(); 4033 self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover'); 4034 self.$wrapper.find('.signin-form input:first').focus(); 4035 }); 4036 } 4037 4038 } 4039 4040 }); 4041 4042}).apply(this, [window.theme, jQuery]); 4043 4044// Nav 4045(function(theme, $) { 4046 4047 theme = theme || {}; 4048 4049 var initialized = false;
4050 4051 $.extend(theme, { 4052 4053 Nav: { 4054 4055 defaults: { 4056 wrapper: $('#mainNav'), 4057 scrollDelay: 600, 4058 scrollAnimation: 'easeOutQuad' 4059 }, 4060 4061 initialize: function($wrapper, opts) { 4062 if (initialized) { 4063 return this; 4064 } 4065 4066 initialized = true; 4067 this.$wrapper = ($wrapper || this.defaults.wrapper); 4068 4069 this 4070 .setOptions(opts) 4071 .build() 4072 .events(); 4073 4074 return this; 4075 }, 4076 4077 setOptions: function(opts) { 4078 this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options'))); 4079 4080 return this; 4081 }, 4082 4083 build: function() { 4084 var self = this, 4085 $html = $('html'), 4086 $header = $('#header'), 4087 $headerNavMain = $('#header .header-nav-main'), 4088 thumbInfoPreview; 4089 4090 // Preview Thumbs 4091 self.$wrapper.find('a[data-thumb-preview]').each(function() { 4092 thumbInfoPreview = $('<span />').addClass('thumb-info thumb-info-preview') 4093 .append($('<span />').addClass('thumb-info-wrapper') 4094 .append($('<span />').addClass('thumb-info-image').css('background-image', 'url(' + $(this).data('thumb-preview') + ')') 4095 ) 4096 ); 4097 4098 $(this).append(thumbInfoPreview); 4099 }); 4100 4101 // Side Header / Side Header Hamburguer Sidebar (Reverse Dropdown) 4102 if($html.hasClass('side-header') || $html.hasClass('side-header-hamburguer-sidebar')) { 4103 4104 // Side Header Right / Side Header Hamburguer Sidebar Right 4105 if($html.hasClass('side-header-right') || $html.hasClass('side-header-hamburguer-sidebar-right')) { 4106 if(!$html.hasClass('side-header-right-no-reverse')) { 4107 $header.find('.dropdown-submenu').addClass('dropdown-reverse'); 4108 } 4109 } 4110 4111 } else { 4112 4113 // Reverse 4114 self.checkReverse = function() { 4115 self.$wrapper.find('.dropdown, .dropdown-submenu').removeClass('dropdown-reverse'); 4116 4117 self.$wrapper.find('.dropdown:not(.manual):not(.dropdown-mega), .dropdown-submenu:not(.manual)').each(function() { 4118 if(!$(this).find('.dropdown-menu').visible( false, true, 'horizontal' ) ) { 4119 $(this).addClass('dropdown-reverse'); 4120 } 4121 }); 4122 } 4123 4124 self.checkReverse(); 4125 4126 $(window).on('resize', function() { 4127 self.checkReverse(); 4128 }); 4129 4130 } 4131 4132 // Clone Items 4133 if($headerNavMain.hasClass('header-nav-main-clone-items')) { 4134 4135 $headerNavMain.find('nav > ul > li > a').each(function(){ 4136 var parent = $(this).parent(), 4137 clone = $(this).clone(), 4138 clone2 = $(this).clone(), 4139 wrapper = $('<span class="wrapper-items-cloned"></span>'); 4140 4141 // Config Classes 4142 $(this).addClass('item-original'); 4143 clone2.addClass('item-two'); 4144 4145 // Insert on DOM 4146 parent.prepend(wrapper); 4147 wrapper.append(clone).append(clone2); 4148 }); 4149 4150 } 4151 4152 // Floating 4153 if($('#header.header-floating-icons').get(0) && $(window).width() > 991) { 4154 4155 var menuFloatingAnim = { 4156 $menuFloating: $('#header.header-floating-icons .header-container > .header-row'), 4157 4158 build: function() { 4159 var self = this; 4160 4161 self.init(); 4162 }, 4163 init: function(){ 4164 var self = this, 4165 divisor = 0; 4166 4167 $(window).scroll(function() { 4168 var scrollPercent = 100 * $(window).scrollTop() / ($(document).height() - $(window).height()), 4169 st = $(this).scrollTop(); 4170 4171 divisor = $(document).height() / $(window).height(); 4172 4173 self.$menuFloating.find('.header-column > .header-row').css({ 4174 transform : 'translateY( calc('+ scrollPercent +'vh - '+ st / divisor +'px) )' 4175 }); 4176 }); 4177 } 4178 } 4179 4180 menuFloatingAnim.build(); 4181 4182 } 4183 4184 // Slide 4185 if($('.header-nav-links-vertical-slide').get(0)) { 4186 var slideNavigation = { 4187 $mainNav: $('#mainNav'), 4188 $mainNavItem: $('#mainNav li'), 4189 4190 build: function(){ 4191 var self = this; 4192 4193 self.menuNav(); 4194 }, 4195 menuNav: function(){ 4196 var self = this; 4197 4198 self.$mainNavItem.on('click', function(e){ 4199 var currentMenuItem = $(this), 4200 currentMenu = $(this).parent(), 4201 nextMenu = $(this).find('ul').first(), 4202 prevMenu = $(this).closest('.next-menu'), 4203 isSubMenu = currentMenuItem.hasClass('dropdown') || currentMenuItem.hasClass('dropdown-submenu'), 4204 isBack = currentMenuItem.hasClass('back-button'), 4205 nextMenuHeightDiff = ( ( nextMenu.find('> li').length * nextMenu.find('> li').outerHeight() ) - nextMenu.outerHeight() ), 4206 prevMenuHeightDiff = ( ( prevMenu.find('> li').length * prevMenu.find('> li').outerHeight() ) - prevMenu.outerHeight() ); 4207 4208 if( isSubMenu ) { 4209 currentMenu.addClass('next-menu'); 4210 nextMenu.addClass('visible'); 4211 currentMenu.css({ 4212 overflow: 'visible', 4213 'overflow-y': 'visible' 4214 }); 4215 4216 if( nextMenuHeightDiff > 0 ) { 4217 nextMenu.css({ 4218 overflow: 'hidden', 4219 'overflow-y': 'scroll' 4220 }); 4221 } 4222 4223 for( i = 0; i < nextMenu.find('> li').length; i++ ) { 4224 if( nextMenu.outerHeight() < ($('.header-row-side-header').outerHeight() - 100) ) { 4225 nextMenu.css({ 4226 height: nextMenu.outerHeight() + nextMenu.find('> li').outerHeight() 4227 }); 4228 } 4229 } 4230 4231 nextMenu.css({ 4232 'padding-top': nextMenuHeightDiff + 'px' 4233 }); 4234 } 4235 4236 if( isBack ) { 4237 currentMenu.parent().parent().removeClass('next-menu'); 4238 currentMenu.removeClass('visible'); 4239 4240 if( prevMenuHeightDiff > 0 ) { 4241 prevMenu.css({ 4242 overflow: 'hidden', 4243 'overflow-y': 'scroll' 4244 }); 4245 } 4246 } 4247 4248 e.stopPropagation(); 4249 }); 4250 } 4251 } 4252 4253 $(window).trigger('resize'); 4254 4255 if( $(window).width() > 991 ) { 4256 slideNavigation.build(); 4257 } 4258 4259 $(document).ready(function(){ 4260 $(window).afterResize(function(){ 4261 if( $(window).width() > 991 ) { 4262 slideNavigation.build(); 4263 } 4264 }); 4265 }); 4266 } 4267 4268 // Header Nav Main Mobile Dark 4269 if($('.header-nav-main-mobile-dark').get(0)) { 4270 $('#header:not(.header-transparent-dark-bottom-border):not(.header-transparent-light-bottom-border)').addClass('header-no-border-bottom'); 4271 } 4272 4273 return this; 4274 }, 4275 4276 events: function() { 4277 var self = this, 4278 $html = $('html'), 4279 $header = $('#header'), 4280 $window = $(window), 4281 headerBodyHeight = $('.header-body').outerHeight(); 4282 4283 $header.find('a[href="#"]').on('click', function(e) { 4284 e.preventDefault(); 4285 }); 4286 4287 // Mobile Arrows 4288 $header.find('.dropdown-toggle, .dropdown-submenu > a') 4289 .append('<i class="fas fa-chevron-down"></i>'); 4290 4291 $header.find('.dropdown-toggle[href="#"], .dropdown-submenu a[href="#"], .dropdown-toggle[href!="#"] .fa-chevron-down, .dropdown-submenu a[href!="#"] .fa-chevron-down').on('click', function(e) { 4292 e.preventDefault(); 4293 if ($window.width() < 992) { 4294 $(this).closest('li').toggleClass('open'); 4295 4296 // Adjust Header Body Height 4297 var height = ( $header.hasClass('header-effect-shrink') && $html.hasClass('sticky-header-active') ) ? theme.StickyHeader.options.stickyHeaderContainerHeight : headerBodyHeight; 4298 $('.header-body').animate({ 4299 height: ($('.header-nav-main nav').outerHeight(true) + height) + 10 4300 }, 0); 4301 } 4302 }); 4303 4304 // Add Open Class 4305 $header.find('.header-nav-click-to-open .dropdown-toggle[href="#"], .header-nav-click-to-open .dropdown-submenu a[href="#"]').on('click', function(e) { 4306 e.preventDefault(); 4307 if ($window.width() > 991) { 4308 4309 if (!$(this).closest('li').hasClass('open')) { 4310 4311 var $li = $(this).closest('li'), 4312 isSub = false;
4313 4314 if ( $(this).parent().hasClass('dropdown-submenu') ) { 4315 isSub = true; 4316 } 4317 4318 $(this).closest('.dropdown-menu').find('.dropdown-submenu.open').removeClass('open'); 4319 $(this).parent('.dropdown').parent().find('.dropdown.open').removeClass('open'); 4320 4321 if (!isSub) { 4322 $(this).parent().find('.dropdown-submenu.open').removeClass('open'); 4323 } 4324 4325 $li.addClass('open'); 4326 4327 $(document).off('click.nav-click-to-open').on('click.nav-click-to-open', function (e) { 4328 if (!$li.is(e.target) && $li.has(e.target).length === 0) { 4329 $li.removeClass('open'); 4330 $li.parents('.open').removeClass('open'); 4331 } 4332 }); 4333 4334 } else { 4335 $(this).closest('li').removeClass('open'); 4336 } 4337 4338 $window.trigger('resize'); 4339 } 4340 }); 4341 4342 // Collapse Nav 4343 $header.find('[data-collapse-nav]').on('click', function(e) { 4344 $(this).parents('.collapse').removeClass('show'); 4345 }); 4346 4347 // Top Features 4348 $header.find('.header-nav-features-toggle').on('click', function(e) { 4349 e.preventDefault(); 4350 4351 var $toggleParent = $(this).parent(); 4352 4353 if (!$(this).siblings('.header-nav-features-dropdown').hasClass('show')) { 4354 4355 var $dropdown = $(this).siblings('.header-nav-features-dropdown'); 4356 4357 $('.header-nav-features-dropdown.show').removeClass('show'); 4358 4359 $dropdown.addClass('show'); 4360 4361 $(document).off('click.header-nav-features-toggle').on('click.header-nav-features-toggle', function (e) { 4362 if (!$toggleParent.is(e.target) && $toggleParent.has(e.target).length === 0) { 4363 $('.header-nav-features-dropdown.show').removeClass('show'); 4364 } 4365 }); 4366 4367 if ($(this).attr('data-focus')) { 4368 $('#' + $(this).attr('data-focus')).focus(); 4369 } 4370 4371 } else { 4372 $(this).siblings('.header-nav-features-dropdown').removeClass('show'); 4373 } 4374 }); 4375 4376 // Hamburguer Menu 4377 var hamburguerMenuBtn = $('.hamburguer-btn:not(.side-panel-toggle)'), 4378 hamburguerSideHeader = $('#header.side-header, #header.side-header-overlay-full-screen'); 4379 4380 hamburguerMenuBtn.on('click', function(){ 4381 if($(this).attr('data-set-active') != 'false') { 4382 $(this).toggleClass('active'); 4383 } 4384 hamburguerSideHeader.toggleClass('side-header-hide'); 4385 $html.toggleClass('side-header-hide'); 4386 4387 $window.trigger('resize'); 4388 }); 4389 4390 $('.hamburguer-close:not(.side-panel-toggle)').on('click', function(){ 4391 $('.hamburguer-btn:not(.hamburguer-btn-side-header-mobile-show)').trigger('click'); 4392 }); 4393 4394 // Set Header Body Height when open mobile menu 4395 $('.header-nav-main nav').on('show.bs.collapse', function () { 4396 $(this).removeClass('closed'); 4397 4398 // Add Mobile Menu Opened Class 4399 $('html').addClass('mobile-menu-opened'); 4400 4401 $('.header-body').animate({ 4402 height: ($('.header-body').outerHeight() + $('.header-nav-main nav').outerHeight(true)) + 10 4403 }); 4404 4405 // Header Below Slider / Header Bottom Slider - Scroll to menu position 4406 if( $('#header').is('.header-bottom-slider, .header-below-slider') && !$('html').hasClass('sticky-header-active') ) { 4407 self.scrollToTarget( $('#header'), 0 ); 4408 } 4409 }); 4410 4411 // Set Header Body Height when collapse mobile menu 4412 $('.header-nav-main nav').on('hide.bs.collapse', function () { 4413 $(this).addClass('closed'); 4414 4415 // Remove Mobile Menu Opened Class 4416 $('html').removeClass('mobile-menu-opened'); 4417 4418 $('.header-body').animate({ 4419 height: ($('.header-body').outerHeight() - $('.header-nav-main nav').outerHeight(true)) 4420 }, function(){ 4421 $(this).height('auto'); 4422 }); 4423 }); 4424 4425 // Header Effect Shrink - Adjust header body height on mobile 4426 $window.on('stickyHeader.activate', function(){ 4427 if( $window.width() < 992 && $header.hasClass('header-effect-shrink') ) { 4428 if( $('.header-btn-collapse-nav').attr('aria-expanded') == 'true' ) { 4429 $('.header-body').animate({ 4430 height: ( $('.header-nav-main nav').outerHeight(true) + theme.StickyHeader.options.stickyHeaderContainerHeight ) + ( ($('.header-nav-bar').get(0)) ? $('.header-nav-bar').outerHeight() : 0 ) 4431 }); 4432 } 4433 } 4434 }); 4435 4436 $window.on('stickyHeader.deactivate', function(){ 4437 if( $window.width() < 992 && $header.hasClass('header-effect-shrink') ) { 4438 if( $('.header-btn-collapse-nav').attr('aria-expanded') == 'true' ) { 4439 $('.header-body').animate({ 4440 height: headerBodyHeight + $('.header-nav-main nav').outerHeight(true) + 10 4441 }); 4442 } 4443 } 4444 }); 4445 4446 // Side Header - Change value of initial header body height 4447 $(document).ready(function(){ 4448 if( $window.width() > 991 ) { 4449 var flag = false;
4450 4451 $window.on('resize', function(){ 4452 if( $window.width() < 992 && flag == false ) { 4453 headerBodyHeight = $('.header-body').outerHeight(); 4454 flag = true; 4455 4456 setTimeout(function(){ 4457 flag = false; 4458 }, 500); 4459 } 4460 }); 4461 } 4462 }); 4463 4464 // Side Header - Set header height on mobile 4465 if( $html.hasClass('side-header') ) { 4466 if( $window.width() < 992 ) { 4467 $header.css({ 4468 height: $('.header-body .header-container').outerHeight() + (parseInt( $('.header-body').css('border-top-width') ) + parseInt( $('.header-body').css('border-bottom-width') )) 4469 }); 4470 } 4471 4472 $(document).ready(function(){ 4473 $window.afterResize(function(){ 4474 if( $window.width() < 992 ) { 4475 $header.css({ 4476 height: $('.header-body .header-container').outerHeight() + (parseInt( $('.header-body').css('border-top-width') ) + parseInt( $('.header-body').css('border-bottom-width') )) 4477 }); 4478 } else { 4479 $header.css({ 4480 height: '' 4481 }); 4482 } 4483 }); 4484 }); 4485 } 4486 4487 // Anchors Position 4488 $('[data-hash]').each(function() { 4489 4490 var target = $(this).attr('href'), 4491 offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0); 4492 4493 if($(target).get(0)) { 4494 $(this).on('click', function(e) { 4495 e.preventDefault(); 4496 4497 if( !$(e.target).is('i') ) { 4498 4499 // Close Collapse if open 4500 $(this).parents('.collapse.show').collapse('hide'); 4501 4502 self.scrollToTarget(target, offset); 4503 4504 } 4505 4506 return; 4507 }); 4508 } 4509 4510 }); 4511 4512 // Floating 4513 if($('#header.header-floating-icons').get(0)) { 4514 4515 $('#header.header-floating-icons [data-hash]').off().each(function() { 4516 4517 var target = $(this).attr('href'), 4518 offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0); 4519 4520 if($(target).get(0)) { 4521 $(this).on('click', function(e) { 4522 e.preventDefault(); 4523 4524 $('html, body').animate({ 4525 scrollTop: $(target).offset().top - offset 4526 }, 600, 'easeOutQuad', function() { 4527 4528 }); 4529 4530 return; 4531 }); 4532 } 4533 4534 }); 4535 4536 } 4537 4538 // Side Panel Toggle 4539 if( $('.side-panel-toggle').get(0) ) { 4540 var init_html_class = $('html').attr('class'); 4541 4542 $('.side-panel-toggle').on('click', function(e){ 4543 var extra_class = $(this).data('extra-class'), 4544 delay = ( extra_class ) ? 100 : 0; 4545 4546 e.preventDefault(); 4547 4548 if( $(this).hasClass('active') ) { 4549 $('html').removeClass('side-panel-open'); 4550 $('.hamburguer-btn.side-panel-toggle:not(.side-panel-close)').removeClass('active'); 4551 return false; 4552 } 4553 4554 if( extra_class ) { 4555 $('.side-panel-wrapper').css('transition','none'); 4556 $('html') 4557 .removeClass() 4558 .addClass( init_html_class ) 4559 .addClass( extra_class ); 4560 } 4561 4562 setTimeout(function(){ 4563 $('.side-panel-wrapper').css('transition',''); 4564 $('html').toggleClass('side-panel-open'); 4565 }, delay); 4566 }); 4567 4568 $(document).on('click', function(e){ 4569 if( !$(e.target).closest('.side-panel-wrapper').get(0) && !$(e.target).hasClass('side-panel-toggle') ) { 4570 $('.hamburguer-btn.side-panel-toggle:not(.side-panel-close)').removeClass('active'); 4571 $('html').removeClass('side-panel-open'); 4572 } 4573 }); 4574 } 4575 4576 return this; 4577 }, 4578 4579 scrollToTarget: function(target, offset) { 4580 var self = this; 4581 4582 $('body').addClass('scrolling'); 4583 4584 $('html, body').animate({ 4585 scrollTop: $(target).offset().top - offset 4586 }, self.options.scrollDelay, self.options.scrollAnimation, function() { 4587 $('body').removeClass('scrolling'); 4588 }); 4589 4590 return this; 4591 4592 } 4593 4594 } 4595 4596 }); 4597 4598}).apply(this, [window.theme, jQuery]); 4599 4600 4601// Newsletter 4602(function(theme, $) { 4603 4604 theme = theme || {}; 4605 4606 var initialized = false; 4607 4608 $.extend(theme, { 4609 4610 Newsletter: { 4611 4612 defaults: { 4613 wrapper: $('#newsletterForm') 4614 }, 4615 4616 initialize: function($wrapper, opts) { 4617 if (initialized) { 4618 return this; 4619 } 4620 4621 initialized = true; 4622 this.$wrapper = ($wrapper || this.defaults.wrapper); 4623 4624 this 4625 .setOptions(opts) 4626 .build(); 4627 4628 return this; 4629 }, 4630 4631 setOptions: function(opts) { 4632 this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options'))); 4633 4634 return this; 4635 }, 4636 4637 build: function() { 4638 if (!($.isFunction($.fn.validate))) { 4639 return this; 4640 } 4641 4642 var self = this,
4643 $email = self.$wrapper.find('#newsletterEmail'), 4644 $success = $('#newsletterSuccess'), 4645 $error = $('#newsletterError'); 4646 4647 self.$wrapper.validate({ 4648 submitHandler: function(form) { 4649 4650 $.ajax({ 4651 type: 'POST', 4652 url: self.$wrapper.attr('action'), 4653 data: { 4654 'email': $email.val() 4655 }, 4656 dataType: 'json', 4657 success: function(data) { 4658 if (data.response == 'success') { 4659 4660 $success.removeClass('d-none'); 4661 $error.addClass('d-none'); 4662 4663 $email 4664 .val('') 4665 .blur() 4666 .closest('.control-group') 4667 .removeClass('success') 4668 .removeClass('error'); 4669 4670 } else { 4671 4672 $error.html(data.message); 4673 $error.removeClass('d-none'); 4674 $success.addClass('d-none'); 4675 4676 $email 4677 .blur() 4678 .closest('.control-group') 4679 .removeClass('success') 4680 .addClass('error'); 4681 4682 } 4683 } 4684 }); 4685 4686 }, 4687 rules: { 4688 newsletterEmail: { 4689 required: true, 4690 email: true 4691 } 4692 }, 4693 errorPlacement: function(error, element) { 4694 4695 } 4696 }); 4697 4698 return this; 4699 } 4700 4701 } 4702 4703 }); 4704 4705}).apply(this, [window.theme, jQuery]); 4706 4707// Search 4708(function(theme, $) { 4709 4710 theme = theme || {}; 4711 4712 var initialized = false; 4713 4714 $.extend(theme, { 4715 4716 Search: { 4717 4718 defaults: { 4719 wrapper: $('#searchForm') 4720 }, 4721 4722 initialize: function($wrapper, opts) { 4723 if (initialized) { 4724 return this; 4725 } 4726 4727 initialized = true; 4728 this.$wrapper = ($wrapper || this.defaults.wrapper); 4729 4730 this 4731 .setOptions(opts) 4732 .build(); 4733 4734 return this; 4735 }, 4736 4737 setOptions: function(opts) { 4738 this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options'))); 4739 4740 return this; 4741 }, 4742 4743 build: function() { 4744 if (!($.isFunction($.fn.validate))) { 4745 return this; 4746 } 4747 4748 this.$wrapper.validate({ 4749 errorPlacement: function(error, element) {} 4750 }); 4751 4752 // Search Reveal 4753 $('.header-nav-features-search-reveal').each(function() { 4754 4755 var $el = $(this) 4756 $header = $('#header'), 4757 $html = $('htmnl'); 4758 4759 $el.find('.header-nav-features-search-show-icon').on('click', function() { 4760 $el.addClass('show'); 4761 $header.addClass('search-show'); 4762 $html.addClass('search-show'); 4763 $('#headerSearch').focus(); 4764 }); 4765 4766 $el.find('.header-nav-features-search-hide-icon').on('click', function() { 4767 $el.removeClass('show'); 4768 $header.removeClass('search-show'); 4769 $html.removeClass('search-show'); 4770 }); 4771 4772 }); 4773 4774 return this; 4775 } 4776 4777 } 4778 4779 }); 4780 4781}).apply(this, [window.theme, jQuery]); 4782 4783// Sticky Header 4784(function(theme, $) { 4785 4786 theme = theme || {}; 4787 4788 var initialized = false; 4789 4790 $.extend(theme, { 4791 4792 StickyHeader: { 4793 4794 defaults: { 4795 wrapper: $('#header'), 4796 headerBody: $('#header .header-body'), 4797 stickyEnabled: true, 4798 stickyEnableOnBoxed: true, 4799 stickyEnableOnMobile: true, 4800 stickyStartAt: 0, 4801 stickyStartAtElement: false, 4802 stickySetTop: 0, 4803 stickyEffect: '', 4804 stickyHeaderContainerHeight: false, 4805 stickyChangeLogo: false, 4806 stickyChangeLogoWrapper: true 4807 }, 4808 4809 initialize: function($wrapper, opts) { 4810 if (initialized) { 4811 return this; 4812 } 4813 4814 initialized = true; 4815 this.$wrapper = ($wrapper || this.defaults.wrapper); 4816 4817 this 4818 .setOptions(opts) 4819 .build() 4820 .events(); 4821 4822 return this; 4823 }, 4824 4825 setOptions: function(opts) { 4826 this.options = $.extend(true, {}, this.defaults, opts, theme.fn.getOptions(this.$wrapper.data('plugin-options'))); 4827 4828 return this; 4829 }, 4830 4831 build: function() { 4832 if (!this.options.stickyEnableOnBoxed && $('html').hasClass('boxed') || $('html').hasClass('side-header-hamburguer-sidebar') || !this.options.stickyEnabled) { 4833 return this; 4834 } 4835 4836 var self = this, 4837 $html = $('html'), 4838 $window = $(window), 4839 sideHeader = $html.hasClass('side-header'), 4840 initialHeaderTopHeight = self.options.wrapper.find('.header-top').outerHeight(), 4841 initialHeaderContainerHeight = self.options.wrapper.find('.header-container').outerHeight(), 4842 minHeight; 4843 4844 // HTML Classes 4845 $html.addClass('sticky-header-enabled'); 4846 4847 if (parseInt(self.options.stickySetTop) < 0) { 4848 $html.addClass('sticky-header-negative'); 4849 } 4850 4851 // Set Start At 4852 if(self.options.stickyStartAtElement) { 4853 4854 var $stickyStartAtElement = $(self.options.stickyStartAtElement); 4855 4856 $(window).on('scroll resize', function() { 4857 self.options.stickyStartAt = $stickyStartAtElement.offset().top; 4858 }); 4859 4860 $(window).trigger('resize'); 4861 } 4862 4863 // Define Min Height value 4864 if( self.options.wrapper.find('.header-top').get(0) ) { 4865 minHeight = ( initialHeaderTopHeight + initialHeaderContainerHeight ); 4866 } else { 4867 minHeight = initialHeaderContainerHeight; 4868 } 4869 4870 // Set Wrapper Min-Height 4871 if( !sideHeader ) { 4872 if( !$('.header-logo-sticky-change').get(0) ) { 4873 self.options.wrapper.css('height', self.options.headerBody.outerHeight()); 4874 } else { 4875 $window.on('stickyChangeLogo.loaded', function(){ 4876 self.options.wrapper.css('height', self.options.headerBody.outerHeight()); 4877 }); 4878 } 4879 4880 if( self.options.stickyEffect == 'shrink' ) { 4881 4882 // Prevent wrong visualization of header when reload on middle of page 4883 $(document).ready(function(){ 4884 if( $window.scrollTop() >= self.options.stickyStartAt ) { 4885 self.options.wrapper.find('.header-container').on('transitionend webkitTransitionEnd oTransitionEnd', function(){ 4886 self.options.headerBody.css('position', 'fixed'); 4887 }); 4888 } else { 4889 self.options.headerBody.css('position', 'fixed'); 4890 } 4891 }); 4892 4893 self.options.wrapper.find('.header-container').css('height', initialHeaderContainerHeight); 4894 self.options.wrapper.find('.header-top').css('height', initialHeaderTopHeight); 4895 } 4896 } 4897 4898 // Sticky Header Container Height 4899 if( self.options.stickyHeaderContainerHeight ) { 4900 self.options.wrapper.find('.header-container').css('height', self.options.wrapper.find('.header-container').outerHeight()); 4901 } 4902 4903 // Boxed 4904 if($html.hasClass('boxed') && self.options.stickyEffect == 'shrink') { 4905 if( (parseInt(self.options.stickyStartAt) == 0) && $window.width() > 991) { 4906 self.options.stickyStartAt = 30; 4907 } 4908 4909 // Set Header Body Position Absolute 4910 self.options.headerBody.css('position','absolute'); 4911 4912 // Set position absolute because top margin from boxed layout 4913 $window.on('scroll', function(){ 4914 if( $window.scrollTop() > $('.body').offset().top ) { 4915 self.options.headerBody.css({ 4916 'position' : 'fixed', 4917 'top' : 0 4918 }); 4919 } else { 4920 self.options.headerBody.css({ 4921 'position' : 'absolute', 4922 'top' : 0 4923 }); 4924 } 4925 }); 4926 } 4927 4928 // Check Sticky Header / Flags prevent multiple runs at same time 4929 var activate_flag = true, 4930 deactivate_flag = false;
4931 4932 self.checkStickyHeader = function() { 4933 if( $window.width() > 991 && $html.hasClass('side-header') ) { 4934 $html.removeClass('sticky-header-active'); 4935 activate_flag = true; 4936 return; 4937 } 4938 4939 if ($window.scrollTop() >= parseInt(self.options.stickyStartAt)) { 4940 if( activate_flag ) { 4941 self.activateStickyHeader(); 4942 activate_flag = false; 4943 deactivate_flag = true; 4944 } 4945 } else { 4946 if( deactivate_flag ) { 4947 self.deactivateStickyHeader(); 4948 deactivate_flag = false; 4949 activate_flag = true; 4950 } 4951 } 4952 }; 4953 4954 // Activate Sticky Header 4955 self.activateStickyHeader = function() { 4956 4957 if ($window.width() < 992) { 4958 if (!self.options.stickyEnableOnMobile) { 4959 self.deactivateStickyHeader(); 4960 return; 4961 } 4962 } else { 4963 if (sideHeader) { 4964 self.deactivateStickyHeader(); 4965 return; 4966 } 4967 } 4968 4969 $html.addClass('sticky-header-active'); 4970 4971 // Sticky Effect - Reveal 4972 if( self.options.stickyEffect == 'reveal' ) { 4973 4974 self.options.headerBody.css('top','-' + self.options.stickyStartAt + 'px'); 4975 4976 self.options.headerBody.animate({ 4977 top: self.options.stickySetTop 4978 }, 400, function() {}); 4979 4980 } 4981 4982 // Sticky Effect - Shrink 4983 if( self.options.stickyEffect == 'shrink' ) { 4984 4985 // If Header Top 4986 if( self.options.wrapper.find('.header-top').get(0) ) { 4987 self.options.wrapper.find('.header-top').css({ 4988 height: 0, 4989 'min-height': 0, 4990 overflow: 'hidden' 4991 }); 4992 } 4993 4994 // Header Container 4995 if( self.options.stickyHeaderContainerHeight ) { 4996 self.options.wrapper.find('.header-container').css({ 4997 height: self.options.stickyHeaderContainerHeight, 4998 'min-height': 0 4999 }); 5000 } else { 5001 self.options.wrapper.find('.header-container').css({ 5002 height: (initialHeaderContainerHeight / 3) * 2, // two third of container height 5003 'min-height': 0 5004 }); 5005 5006 var y = initialHeaderContainerHeight - ((initialHeaderContainerHeight / 3) * 2); 5007 $('.main').css({ 5008 transform: 'translate3d(0, -'+ y +'px, 0)', 5009 transition: 'ease transform 300ms' 5010 }); 5011 5012 if($html.hasClass('boxed')) { 5013 self.options.headerBody.css('position','fixed'); 5014 } 5015 } 5016 5017 } 5018 5019 self.options.headerBody.css('top', self.options.stickySetTop); 5020 5021 if (self.options.stickyChangeLogo) { 5022 self.changeLogo(true); 5023 } 5024 5025 // Set Elements Style 5026 $('[data-sticky-header-style]').each(function() { 5027 var $el = $(this), 5028 css = theme.fn.getOptions($el.data('sticky-header-style-active')), 5029 opts = theme.fn.getOptions($el.data('sticky-header-style')); 5030 5031 if( $window.width() > opts.minResolution ) { 5032 $el.css(css); 5033 } 5034 }); 5035 5036 $.event.trigger({ 5037 type: 'stickyHeader.activate' 5038 }); 5039 }; 5040 5041 // Deactivate Sticky Header 5042 self.deactivateStickyHeader = function() { 5043 5044 $html.removeClass('sticky-header-active'); 5045 5046 // Sticky Effect - Shrink 5047 if( self.options.stickyEffect == 'shrink' ) { 5048 5049 // Boxed Layout 5050 if( $html.hasClass('boxed') ) { 5051 5052 // Set Header Body Position Absolute 5053 self.options.headerBody.css('position','absolute'); 5054 5055 if( $window.scrollTop() > $('.body').offset().top ) { 5056 // Set Header Body Position Fixed 5057 self.options.headerBody.css('position','fixed'); 5058 } 5059 5060 } else { 5061 // Set Header Body Position Fixed 5062 self.options.headerBody.css('position','fixed'); 5063 } 5064 5065 // If Header Top 5066 if( self.options.wrapper.find('.header-top').get(0) ) { 5067 self.options.wrapper.find('.header-top').css({ 5068 height: initialHeaderTopHeight, 5069 overflow: 'visible' 5070 }); 5071 } 5072 5073 // Header Container 5074 self.options.wrapper.find('.header-container').css({ 5075 height: initialHeaderContainerHeight 5076 }); 5077 5078 } 5079 5080 self.options.headerBody.css('top', 0); 5081 5082 if (self.options.stickyChangeLogo) { 5083 self.changeLogo(false); 5084 } 5085 5086 // Set Elements Style 5087 $('[data-sticky-header-style]').each(function() { 5088 var $el = $(this), 5089 css = theme.fn.getOptions($el.data('sticky-header-style-deactive')), 5090 opts = theme.fn.getOptions($el.data('sticky-header-style')); 5091 5092 if( $window.width() > opts.minResolution ) { 5093 $el.css(css); 5094 } 5095 }); 5096 5097 $.event.trigger({ 5098 type: 'stickyHeader.deactivate' 5099 }); 5100 }; 5101 5102 // Always Sticky 5103 if (parseInt(self.options.stickyStartAt) <= 0) { 5104 self.activateStickyHeader(); 5105 } 5106 5107 // Notice Top Bar 5108 if ($('.notice-top-bar').get(0)) { 5109 self.options.stickyStartAt = $('.notice-top-bar').outerHeight(); 5110 } 5111 5112 // Set Logo 5113 if (self.options.stickyChangeLogo) { 5114 5115 var $logoWrapper = self.options.wrapper.find('.header-logo'), 5116 $logo = $logoWrapper.find('img'), 5117 logoWidth = $logo.attr('width'), 5118 logoHeight = $logo.attr('height'), 5119 logoSmallTop = parseInt($logo.attr('data-sticky-top') ? $logo.attr('data-sticky-top') : 0), 5120 logoSmallWidth = parseInt($logo.attr('data-sticky-width') ? $logo.attr('data-sticky-width') : 'auto'),
5121 logoSmallHeight = parseInt($logo.attr('data-sticky-height') ? $logo.attr('data-sticky-height') : 'auto'); 5122 5123 if (self.options.stickyChangeLogoWrapper) { 5124 $logoWrapper.css({ 5125 'width': $logo.outerWidth(true), 5126 'height': $logo.outerHeight(true) 5127 }); 5128 } 5129 5130 self.changeLogo = function(activate) { 5131 if(activate) { 5132 5133 $logo.css({ 5134 'top': logoSmallTop, 5135 'width': logoSmallWidth, 5136 'height': logoSmallHeight 5137 }); 5138 5139 } else { 5140 5141 $logo.css({ 5142 'top': 0, 5143 'width': logoWidth, 5144 'height': logoHeight 5145 }); 5146 5147 } 5148 } 5149 5150 $.event.trigger({ 5151 type: 'stickyChangeLogo.loaded' 5152 }); 5153 5154 } 5155 5156 // Side Header 5157 var headerBodyHeight, 5158 flag = false; 5159 5160 self.checkSideHeader = function() { 5161 if($window.width() < 992 && flag == false) { 5162 headerBodyHeight = self.options.headerBody.height(); 5163 flag = true; 5164 } 5165 5166 if(self.options.stickyStartAt == 0 && sideHeader) { 5167 self.options.wrapper.css('min-height', 0); 5168 } 5169 5170 if(self.options.stickyStartAt > 0 && sideHeader && $window.width() < 992) { 5171 self.options.wrapper.css('min-height', headerBodyHeight); 5172 } 5173 } 5174 5175 return this; 5176 }, 5177 5178 events: function() { 5179 var self = this; 5180 5181 if (!this.options.stickyEnableOnBoxed && $('body').hasClass('boxed') || $('html').hasClass('side-header-hamburguer-sidebar') || !this.options.stickyEnabled) { 5182 return this; 5183 } 5184 5185 if (!self.options.alwaysStickyEnabled) { 5186 $(window).on('scroll resize', function() { 5187 self.checkStickyHeader(); 5188 }); 5189 } else { 5190 self.activateStickyHeader(); 5191 } 5192 5193 $(window).on('load resize', function(){ 5194 self.checkSideHeader(); 5195 }); 5196 5197 return this; 5198 } 5199 5200 } 5201 5202 }); 5203 5204}).apply(this, [window.theme, jQuery]);
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.