1var THEMEMASCOT = {}; 2 3(function($) { 4 "use strict"; 5 6 /* ---------------------------------------------------------------------- */ 7 /* -------------------------- Declare Variables ------------------------- */ 8 /* ---------------------------------------------------------------------- */ 9 var $document = $(document); 10 var $document_body = $(document.body); 11 var $window = $(window); 12 var $html = $('html'); 13 var $body = $('body'); 14 var $wrapper = $('#wrapper'); 15 var $header = $('#header'); 16 var $footer = $('#footer'); 17 var $sections = $('section'); 18 var $portfolio_gallery = $(".gallery-isotope"); 19 var portfolio_filter = ".portfolio-filter a"; 20 var $portfolio_filter_first_child = $(".portfolio-filter a:eq(0)"); 21 var $portfolio_flex_slider = $(".portfolio-slider"); 22 23 24 THEMEMASCOT.isMobile = { 25 Android: function() { 26 return navigator.userAgent.match(/Android/i); 27 }, 28 BlackBerry: function() { 29 return navigator.userAgent.match(/BlackBerry/i); 30 }, 31 iOS: function() { 32 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 33 }, 34 Opera: function() { 35 return navigator.userAgent.match(/Opera Mini/i); 36 }, 37 Windows: function() { 38 return navigator.userAgent.match(/IEMobile/i); 39 }, 40 any: function() { 41 return (THEMEMASCOT.isMobile.Android() || THEMEMASCOT.isMobile.BlackBerry() || THEMEMASCOT.isMobile.iOS() || THEMEMASCOT.isMobile.Opera() || THEMEMASCOT.isMobile.Windows()); 42 } 43 }; 44 45 THEMEMASCOT.isRTL = { 46 check: function() { 47 if( $( "html" ).attr("dir") == "rtl" ) { 48 return true; 49 } else { 50 return false; 51 } 52 } 53 }; 54 55 THEMEMASCOT.urlParameter = { 56 get: function(sParam) { 57 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 58 sURLVariables = sPageURL.split('&'), 59 sParameterName, 60 i; 61 62 for (i = 0; i < sURLVariables.length; i++) { 63 sParameterName = sURLVariables[i].split('='); 64 65 if (sParameterName[0] === sParam) { 66 return sParameterName[1] === undefined ? true : sParameterName[1]; 67 } 68 } 69 } 70 }; 71 72 73 THEMEMASCOT.bmiCalculator = { 74 magic: function(bmi) { 75 var output = ''; 76 var info = ''; 77 if (bmi) { 78 if (bmi < 15) { 79 info = "very severely underweight"; 80 } 81 if ((bmi >= 15)&&(bmi < 16)) { 82 info = "severely underweight"; 83 } 84 if ((bmi >= 16)&&(bmi < 18.5)) { 85 info = "underweight"; 86 } 87 if ((bmi >= 18.5)&&(bmi < 25)) { 88 info = "normal"; 89 } 90 if ((bmi >= 25)&&(bmi < 30)) { 91 info = "overweight"; 92 } 93 if ((bmi >= 30)&&(bmi < 35)) { 94 info = "moderately obese"; 95 } 96 if ((bmi >= 35)&&(bmi <= 40)) { 97 info = "severely obese"; 98 } 99 if (bmi >40) { 100 info = "very severely obese"; 101 } 102 output = "Your BMI is <span>" + bmi + "</span><br />" + 103 "You are <span>" + info + "</span>."; 104 } else { 105 output = "You broke it!"; 106 }; 107 return output; 108 }, 109 110 calculateStandard: function (bmi_form) { 111 var weight_lbs = bmi_form.find('input[name="bmi_standard_weight_lbs"]').val(); 112 var height_ft = bmi_form.find('input[name="bmi_standard_height_ft"]').val(); 113 var height_in = bmi_form.find('input[name="bmi_standard_height_in"]').val(); 114 var age = bmi_form.find('input[name="bmi_standard_age"]').val(); 115 var gender = bmi_form.find('radio[name="bmi_standard_gender"]').val(); 116
117 var total_height_inc = ( parseInt(height_ft, 10) * 12 ) + parseInt(height_in, 10); 118 var bmi = ( parseFloat(weight_lbs) / (total_height_inc * total_height_inc) ) * 703; 119 var output = THEMEMASCOT.bmiCalculator.magic(bmi); 120 121 bmi_form.find('#bmi_standard_calculator_form_result').html(output).fadeIn('slow'); 122 }, 123 124 calculateMetric: function (bmi_form) { 125 var weight_kg = bmi_form.find('input[name="bmi_metric_weight_kg"]').val(); 126 var height_cm = bmi_form.find('input[name="bmi_metric_height_cm"]').val(); 127 var age = bmi_form.find('input[name="bmi_standard_age"]').val(); 128 var gender = bmi_form.find('radio[name="bmi_standard_gender"]').val(); 129 130 var total_weight_kg = parseFloat(weight_kg) ; 131 var total_height_m = parseFloat(height_cm) * 0.01; 132 var bmi = ( total_weight_kg / (total_height_m * total_height_m) ); 133 var output = THEMEMASCOT.bmiCalculator.magic(bmi); 134 135 bmi_form.find('#bmi_metric_calculator_form_result').html(output).fadeIn('slow'); 136 }, 137 138 init: function () { 139 var bmi_Standard_Form = $('#form_bmi_standard_calculator'); 140 bmi_Standard_Form.on('submit', function(e) { 141 e.preventDefault(); 142 THEMEMASCOT.bmiCalculator.calculateStandard(bmi_Standard_Form); 143 return false; 144 }); 145 146 var bmi_Metric_Form = $('#form_bmi_metric_calculator'); 147 bmi_Metric_Form.on('submit', function(e) { 148 e.preventDefault(); 149 THEMEMASCOT.bmiCalculator.calculateMetric(bmi_Metric_Form); 150 return false; 151 }); 152 } 153 154 }; 155 156 THEMEMASCOT.initialize = { 157 158 init: function() { 159 THEMEMASCOT.bmiCalculator.init(); 160 THEMEMASCOT.initialize.TM_datePicker(); 161 THEMEMASCOT.initialize.TM_ddslick(); 162 //THEMEMASCOT.initialize.TM_loadBSParentModal(); 163 //THEMEMASCOT.initialize.TM_demoSwitcher(); 164 THEMEMASCOT.initialize.TM_platformDetect(); 165 THEMEMASCOT.initialize.TM_onLoadModal(); 166 THEMEMASCOT.initialize.TM_customDataAttributes(); 167 THEMEMASCOT.initialize.TM_parallaxBgInit(); 168 THEMEMASCOT.initialize.TM_resizeFullscreen(); 169 THEMEMASCOT.initialize.TM_prettyPhoto_lightbox(); 170 THEMEMASCOT.initialize.TM_nivolightbox(); 171 THEMEMASCOT.initialize.TM_fitVids(); 172 THEMEMASCOT.initialize.TM_YTPlayer(); 173 THEMEMASCOT.initialize.TM_equalHeightDivs(); 174 }, 175 176 177 /* ---------------------------------------------------------------------- */ 178 /* ------------------------------ Date Picker -------------------------- */ 179 /* ---------------------------------------------------------------------- */ 180 TM_datePicker: function() { 181 $( ".date-picker" ).datepicker(); 182 $( ".time-picker" ).timepicker(); 183 $( ".datetime-picker" ).datetimepicker(); 184 }, 185 186 /* ---------------------------------------------------------------------- */ 187 /* -------------------------------- ddslick ---------------------------- */ 188 /* ---------------------------------------------------------------------- */ 189 TM_ddslick: function() { 190 $("select.ddslick").each(function(){ 191 var name = $(this).attr('name'); 192 var id = $(this).attr('id'); 193 $("#"+id).ddslick({ 194 imagePosition: "left", 195 onSelected: function(selectedData){ 196 $("#"+id+ " .dd-selected-value").prop ('name', name); 197 } 198 }); 199 }); 200 }, 201 202 /* ---------------------------------------------------------------------- */ 203 /* ----------------------------- slider range -------------------------- */ 204 /* ---------------------------------------------------------------------- */ 205 TM_sliderRange: function() { 206 $(".slider-range").each(function(){ 207 var id = $(this).attr('id'); 208 var target_id = $(this).data('target'); 209 $( "#" + target_id ).slider({ 210 range: "max", 211 min: 2001, 212 max: 2016, 213 value: 2010, 214 slide: function( event, ui ) { 215 $( "#" + id ).val( ui.value ); 216 } 217 }); 218 $( "#" + id ).val( $( "#" + target_id ).slider( "value" ) ); 219 }); 220 }, 221 222 /* ---------------------------------------------------------------------- */ 223 /* ------------------------ Bootstrap Parent Modal --------------------- */ 224 /* ---------------------------------------------------------------------- */
225 /*TM_loadBSParentModal: function() { 226 var ajaxLoadContent = true; 227 if( ajaxLoadContent ) { 228 $.ajax({ 229 url: "ajax-load/bootstrap-parent-modal.html", 230 success: function (data) { $body.append(data); }, 231 dataType: 'html' 232 }); 233 } 234 },*/ 235 /* ---------------------------------------------------------------------- */ 236 /* ------------------------------ Demo Switcher ------------------------ */ 237 /* ---------------------------------------------------------------------- */ 238 /*TM_demoSwitcher: function() { 239 var showSwitcher = true; 240 var $style_switcher = $('#style-switcher'); 241 if( !$style_switcher.length && showSwitcher ) { 242 $.ajax({ 243 url: "color-switcher/style-switcher.html", 244 success: function (data) { $body.append(data); }, 245 dataType: 'html' 246 }); 247 } 248 },*/ 249 250 /* ---------------------------------------------------------------------- */ 251 /* ------------------------------ Preloader ---------------------------- */ 252 /* ---------------------------------------------------------------------- */ 253 TM_preLoaderClickDisable: function() { 254 var $preloader = $('#preloader'); 255 $preloader.children('#disable-preloader').on('click', function(e) { 256 $preloader.fadeOut(); 257 return false; 258 }); 259 }, 260 261 TM_preLoaderOnLoad: function() { 262 var $preloader = $('#preloader'); 263 $preloader.delay(200).fadeOut('slow'); 264 }, 265 266 267 /* ---------------------------------------------------------------------- */ 268 /* ------------------------------- Platform detect --------------------- */ 269 /* ---------------------------------------------------------------------- */ 270 TM_platformDetect: function() { 271 if (THEMEMASCOT.isMobile.any()) { 272 $html.addClass("mobile"); 273 } else { 274 $html.addClass("no-mobile"); 275 } 276 }, 277 278 /* ---------------------------------------------------------------------- */ 279 /* ------------------------------ Hash Forwarding ---------------------- */ 280 /* ---------------------------------------------------------------------- */ 281 TM_onLoadModal: function() { 282 var $modal = $('.on-pageload-popup-modal'); 283 if( $modal.length > 0 ) { 284 $modal.each( function(){ 285 var $current_item = $(this); 286 var target = $current_item.data('target'); 287 var timeout = $current_item.data('timeout'); 288 //var target_id = target.split('#')[1]; 289 290 var delay = $current_item.data('delay'); 291 delay = ( !delay ) ? 2500 : Number(delay) + 2500; 292 293 if( !$current_item.hasClass('cookie-enabled') ) { 294 $.removeCookie( target ); 295 } 296 297 var t = setTimeout(function() { 298 $.magnificPopup.open({ 299 items: { src: target }, 300 type: 'inline', 301 mainClass: 'mfp-no-margins mfp-fade', 302 closeBtnInside: false, 303 fixedContentPos: true, 304 removalDelay: 500, 305 callbacks: { 306 afterClose: function() { 307 if( element.hasClass('cookie-enabled') ) { 308 $.cookie( target, '0' ); 309 } 310 } 311 } 312 }, 0); 313 }, Number(delay) ); 314 315 if( timeout !== '' ) { 316 var to = setTimeout(function() { 317 $.magnificPopup.close(); 318 }, Number(delay) + Number(timeout) ); 319 } 320 }); 321 } 322 }, 323 324 TM_onLoadModal2: function() { 325 var $modal = $('.modal-on-load'); 326 if( $modal.length > 0 ) { 327 $modal.each( function(){ 328 var element = $(this), 329 elementTarget = element.attr('data-target'), 330 elementTargetValue = elementTarget.split('#')[1], 331 elementDelay = element.attr('data-delay'), 332 elementTimeout = element.attr('data-timeout'), 333 elementAnimateIn = element.attr('data-animate-in'), 334 elementAnimateOut = element.attr('data-animate-out'); 335 336 if( !element.hasClass('enable-cookie') ) { $.removeCookie( elementTargetValue ); } 337 338 if( element.hasClass('enable-cookie') ) { 339 var elementCookie = $.cookie( elementTargetValue ); 340 341 if( typeof elementCookie !== 'undefined' && elementCookie == '0' ) { 342 return true; 343 } 344 } 345 346 if( !elementDelay ) {
347 elementDelay = 1500; 348 } else { 349 elementDelay = Number(elementDelay) + 1500; 350 } 351 352 var t = setTimeout(function() { 353 $.magnificPopup.open({ 354 items: { src: elementTarget }, 355 type: 'inline', 356 mainClass: 'mfp-no-margins mfp-fade', 357 closeBtnInside: false, 358 fixedContentPos: true, 359 removalDelay: 500, 360 callbacks: { 361 open: function(){ 362 if( elementAnimateIn !== '' ) { 363 $(elementTarget).addClass( elementAnimateIn + ' animated' ); 364 } 365 }, 366 beforeClose: function(){ 367 if( elementAnimateOut !== '' ) { 368 $(elementTarget).removeClass( elementAnimateIn ).addClass( elementAnimateOut ); 369 } 370 }, 371 afterClose: function() { 372 if( elementAnimateIn !== '' || elementAnimateOut !== '' ) { 373 $(elementTarget).removeClass( elementAnimateIn + ' ' + elementAnimateOut + ' animated' ); 374 } 375 if( element.hasClass('enable-cookie') ) { 376 $.cookie( elementTargetValue, '0' ); 377 } 378 } 379 } 380 }, 0); 381 }, Number(elementDelay) ); 382 383 if( elementTimeout !== '' ) { 384 var to = setTimeout(function() { 385 $.magnificPopup.close(); 386 }, Number(elementDelay) + Number(elementTimeout) ); 387 } 388 }); 389 } 390 }, 391 392 393 /* ---------------------------------------------------------------------- */ 394 /* ------------------------------ Hash Forwarding ---------------------- */ 395 /* ---------------------------------------------------------------------- */ 396 TM_hashForwarding: function() { 397 if (window.location.hash) { 398 var hash_offset = $(window.location.hash).offset().top; 399 $("html, body").animate({ 400 scrollTop: hash_offset 401 }); 402 } 403 }, 404 405 406 /* ---------------------------------------------------------------------- */ 407 /* ----------------------- Background image, color ---------------------- */ 408 /* ---------------------------------------------------------------------- */ 409 TM_customDataAttributes: function() { 410 $('[data-bg-color]').each(function() { 411 $(this).css("cssText", "background: " + $(this).data("bg-color") + "
411!important;"); 412 }); 413 $('[data-bg-img]').each(function() { 414 $(this).css('background-image', 'url(' + $(this).data("bg-img") + ')'); 415 }); 416 $('[data-text-color]').each(function() { 417 $(this).css('color', $(this).data("text-color")); 418 }); 419 $('[data-font-size]').each(function() { 420 $(this).css('font-size', $(this).data("font-size")); 421 }); 422 $('[data-height]').each(function() { 423 $(this).css('height', $(this).data("height")); 424 }); 425 $('[data-border]').each(function() { 426 $(this).css('border', $(this).data("border")); 427 }); 428 $('[data-margin-top]').each(function() { 429 $(this).css('margin-top', $(this).data("margin-top")); 430 }); 431 $('[data-margin-right]').each(function() { 432 $(this).css('margin-right', $(this).data("margin-right")); 433 }); 434 $('[data-margin-bottom]').each(function() { 435 $(this).css('margin-bottom', $(this).data("margin-bottom")); 436 }); 437 $('[data-margin-left]').each(function() { 438 $(this).css('margin-left', $(this).data("margin-left")); 439 }); 440 }, 441 442 443 444 /* ---------------------------------------------------------------------- */ 445 /* -------------------------- Background Parallax ----------------------- */ 446 /* ---------------------------------------------------------------------- */ 447 TM_parallaxBgInit: function() { 448 if (!THEMEMASCOT.isMobile.any() && $window.width() >= 800 ) { 449 $('.parallax').each(function() { 450 var data_parallax_ratio = ( $(this).data("parallax-ratio") === undefined ) ? '0.5': $(this).data("parallax-ratio"); 451 $(this).parallax("50%", data_parallax_ratio); 452 }); 453 } else { 454 $('.parallax').addClass("mobile-parallax"); 455 } 456 }, 457 458 /* ---------------------------------------------------------------------- */ 459 /* --------------------------- Home Resize Fullscreen ------------------- */ 460 /* ---------------------------------------------------------------------- */ 461 TM_resizeFullscreen: function() { 462 var windowHeight = $window.height(); 463 $('.fullscreen, .revslider-fullscreen').height(windowHeight); 464 }, 465 466 /* ---------------------------------------------------------------------- */ 467 /* ----------------------------- Magnific Popup ------------------------- */ 468 /* ---------------------------------------------------------------------- */ 469 TM_magnificPopup_lightbox: function() { 470 471 $('.image-popup-lightbox').magnificPopup({ 472 type: 'image', 473 closeOnContentClick: true, 474 closeBtnInside: false, 475 fixedContentPos: true, 476 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 477 image: { 478 verticalFit: true 479 } 480 }); 481 482 $('.image-popup-vertical-fit').magnificPopup({ 483 type: 'image', 484 closeOnContentClick: true, 485 mainClass: 'mfp-img-mobile', 486 image: { 487 verticalFit: true 488 } 489 }); 490 491 $('.image-popup-fit-width').magnificPopup({ 492 type: 'image', 493 closeOnContentClick: true, 494 image: { 495 verticalFit: false 496 } 497 }); 498 499 $('.image-popup-no-margins').magnificPopup({ 500 type: 'image', 501 closeOnContentClick: true, 502 closeBtnInside: false, 503 fixedContentPos: true, 504 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 505 image: { 506 verticalFit: true 507 }, 508 zoom: { 509 enabled: true, 510 duration: 300 // don't foget to change the duration also in CSS 511 } 512 }); 513 514 $('.popup-gallery').magnificPopup({ 515 delegate: 'a', 516 type: 'image', 517 tLoading: 'Loading image #%curr%...', 518 mainClass: 'mfp-img-mobile', 519 gallery: { 520 enabled: true, 521 navigateByImgClick: true, 522 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 523 }, 524 image: { 525 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 526 titleSrc: function(item) { 527 return item.el.attr('title') + '<small>by Marsel Van Oosten</small>'; 528 } 529 } 530 }); 531 532 $('.zoom-gallery').magnificPopup({ 533 delegate: 'a', 534 type: 'image', 535 closeOnContentClick: false, 536 closeBtnInside: false, 537 mainClass: 'mfp-with-zoom mfp-img-mobile', 538 image: { 539 verticalFit: true, 540 titleSrc: function(item) { 541 return item.el.attr('title') + ' · <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>'; 542 } 543 }, 544 gallery: { 545 enabled: true 546 }, 547 zoom: { 548 enabled: true, 549 duration: 300, // don't foget to change the duration also in CSS 550 opener: function(element) { 551 return element.find('img'); 552 } 553 } 554 555 }); 556 557 $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 558 disableOn: 700, 559 type: 'iframe', 560 mainClass: 'mfp-fade', 561 removalDelay: 160, 562 preloader: false, 563
564 fixedContentPos: false 565 }); 566 567 $('.popup-with-zoom-anim').magnificPopup({ 568 type: 'inline', 569 570 fixedContentPos: false, 571 fixedBgPos: true, 572 573 overflowY: 'auto', 574 575 closeBtnInside: true, 576 preloader: false, 577 578 midClick: true, 579 removalDelay: 300, 580 mainClass: 'my-mfp-zoom-in' 581 }); 582 583 $('.popup-with-move-anim').magnificPopup({ 584 type: 'inline', 585 586 fixedContentPos: false, 587 fixedBgPos: true, 588 589 overflowY: 'auto', 590 591 closeBtnInside: true, 592 preloader: false, 593 594 midClick: true, 595 removalDelay: 300, 596 mainClass: 'my-mfp-slide-bottom' 597 }); 598 599 $('.ajaxload-popup').magnificPopup({ 600 type: 'ajax', 601 alignTop: true, 602 overflowY: 'scroll', // as we know that popup content is tall we set scroll overflow by default to avoid jump 603 callbacks: { 604 parseAjax: function(mfpResponse) { 605 THEMEMASCOT.initialize.TM_datePicker(); 606 } 607 } 608 }); 609 610 $('.form-ajax-load').magnificPopup({ 611 type: 'ajax' 612 }); 613 614 $('.popup-with-form').magnificPopup({ 615 type: 'inline', 616 preloader: false, 617 focus: '#name', 618 619 mainClass: 'mfp-no-margins mfp-fade', 620 closeBtnInside: false, 621 fixedContentPos: true, 622 623 // When elemened is focused, some mobile browsers in some cases zoom in 624 // It looks not nice, so we disable it: 625 callbacks: { 626 beforeOpen: function() { 627 if($window.width() < 700) { 628 this.st.focus = false; 629 } else { 630 this.st.focus = '#name'; 631 } 632 } 633 } 634 }); 635 636 var $mfpLightboxAjax = $('[data-lightbox="ajax"]'); 637 if( $mfpLightboxAjax.length > 0 ) { 638 $mfpLightboxAjax.magnificPopup({ 639 type: 'ajax', 640 closeBtnInside: false, 641 callbacks: { 642 ajaxContentAdded: function(mfpResponse) { 643 }, 644 open: function() { 645 }, 646 close: function() { 647 } 648 } 649 }); 650 } 651 652 //lightbox image 653 var $mfpLightboxImage = $('[data-lightbox="image"]'); 654 if( $mfpLightboxImage.length > 0 ) { 655 $mfpLightboxImage.magnificPopup({ 656 type: 'image', 657 closeOnContentClick: true, 658 closeBtnInside: false, 659 fixedContentPos: true, 660 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 661 image: { 662 verticalFit: true 663 } 664 }); 665 } 666 667 //lightbox gallery 668 var $mfpLightboxGallery = $('[data-lightbox="gallery"]'); 669 if( $mfpLightboxGallery.length > 0 ) { 670 $mfpLightboxGallery.each(function() { 671 var element = $(this); 672 element.magnificPopup({ 673 delegate: 'a[data-lightbox="gallery-item"]', 674 type: 'image', 675 closeOnContentClick: true, 676 closeBtnInside: false, 677 fixedContentPos: true, 678 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 679 image: { 680 verticalFit: true 681 }, 682 gallery: { 683 enabled: true, 684 navigateByImgClick: true, 685 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 686 }, 687 zoom: { 688 enabled: true, 689 duration: 300, // don't foget to change the duration also in CSS 690 opener: function(element) { 691 return element.find('img'); 692 } 693 } 694 695 }); 696 }); 697 } 698 699 //lightbox iframe 700 var $mfpLightboxIframe = $('[data-lightbox="iframe"]'); 701 if( $mfpLightboxIframe.length > 0 ) { 702 $mfpLightboxIframe.magnificPopup({ 703 disableOn: 600, 704 type: 'iframe', 705 removalDelay: 160, 706 preloader: false,
707 fixedContentPos: false 708 }); 709 } 710 711 //lightbox inline 712 var $mfpLightboxInline = $('[data-lightbox="inline"]'); 713 if( $mfpLightboxInline.length > 0 ) { 714 $mfpLightboxInline.magnificPopup({ 715 type: 'inline', 716 mainClass: 'mfp-no-margins mfp-zoom-in', 717 closeBtnInside: false, 718 fixedContentPos: true 719 }); 720 } 721 }, 722 723 /* ---------------------------------------------------------------------- */ 724 /* ----------------------------- lightbox popup ------------------------- */ 725 /* ---------------------------------------------------------------------- */ 726 TM_prettyPhoto_lightbox: function() { 727 //prettyPhoto lightbox 728 $("a[data-rel^='prettyPhoto']").prettyPhoto({ 729 hook: 'data-rel', 730 animation_speed:'normal', 731 theme:'light_square', 732 slideshow:3000, 733 autoplay_slideshow: false, 734 social_tools: false 735 }); 736 }, 737 738 /* ---------------------------------------------------------------------- */ 739 /* ------------------------------ Nivo Lightbox ------------------------- */ 740 /* ---------------------------------------------------------------------- */ 741 TM_nivolightbox: function() { 742 $('a[data-lightbox-gallery]').nivoLightbox({ 743 effect: 'fadeScale', 744 afterShowLightbox: function(){ 745 var $nivo_iframe = $('.nivo-lightbox-content > iframe'); 746 if( $nivo_iframe.length > 0 ) { 747 var src = $nivo_iframe.attr('src'); 748 $nivo_iframe.attr('src', src + '?autoplay=1'); 749 } 750 } 751 }); 752 }, 753 754 755 756 /* ---------------------------------------------------------------------- */ 757 /* ---------------------------- Wow initialize ------------------------- */ 758 /* ---------------------------------------------------------------------- */ 759 TM_wow: function() { 760 var wow = new WOW({ 761 mobile: false // trigger animations on mobile devices (default is true) 762 }); 763 wow.init(); 764 }, 765 766 /* ---------------------------------------------------------------------- */ 767 /* ----------------------------- Fit Vids ------------------------------- */ 768 /* ---------------------------------------------------------------------- */ 769 TM_fitVids: function() { 770 $body.fitVids(); 771 }, 772 773 /* ---------------------------------------------------------------------- */ 774 /* ----------------------------- YT Player for Video -------------------- */ 775 /* ---------------------------------------------------------------------- */ 776 TM_YTPlayer: function() { 777 $(".player").mb_YTPlayer(); 778 }, 779 780 /* ---------------------------------------------------------------------- */ 781 /* ---------------------------- equalHeights ---------------------------- */ 782 /* ---------------------------------------------------------------------- */ 783 TM_equalHeightDivs: function() { 784 /* equal heigh */ 785 var $equal_height = $('.equal-height'); 786 $equal_height.children('div').css('min-height', 'auto'); 787 $equal_height.equalHeights(); 788 789 /* equal heigh inner div */ 790 var $equal_height_inner = $('.equal-height-inner'); 791 $equal_height_inner.children('div').css('min-height', 'auto'); 792 $equal_height_inner.children('div').children('div').css('min-height', 'auto'); 793 $equal_height_inner.equalHeights(); 794 $equal_height_inner.children('div').each(function() { 795 $(this).children('div').css('min-height', $(this).css('min-height')); 796 }); 797 798 /* pricing-table equal heigh*/ 799 var $equal_height_pricing_table = $('.equal-height-pricing-table'); 800 $equal_height_pricing_table.children('div').css('min-height', 'auto'); 801 $equal_height_pricing_table.children('div').children('div').css('min-height', 'auto'); 802 $equal_height_pricing_table.equalHeights();
803 $equal_height_pricing_table.children('div').each(function() { 804 $(this).children('div').css('min-height', $(this).css('min-height')); 805 }); 806 } 807 808 }; 809 810 811 THEMEMASCOT.header = { 812 813 init: function() { 814 815 var t = setTimeout(function() { 816 THEMEMASCOT.header.TM_fullscreenMenu(); 817 THEMEMASCOT.header.TM_sidePanelReveal(); 818 THEMEMASCOT.header.TM_scroolToTopOnClick(); 819 THEMEMASCOT.header.TM_scrollToFixed(); 820 THEMEMASCOT.header.TM_topnavAnimate(); 821 THEMEMASCOT.header.TM_scrolltoTarget(); 822 THEMEMASCOT.header.TM_menuzord(); 823 THEMEMASCOT.header.TM_navLocalScorll(); 824 THEMEMASCOT.header.TM_menuCollapseOnClick(); 825 THEMEMASCOT.header.TM_homeParallaxFadeEffect(); 826 THEMEMASCOT.header.TM_topsearch_toggle(); 827 }, 0); 828 829 }, 830 831 832 /* ---------------------------------------------------------------------- */ 833 /* ------------------------- menufullpage ---------------------------- */ 834 /* ---------------------------------------------------------------------- */ 835 TM_fullscreenMenu: function() { 836 var $menufullpage = $('.menu-full-page .fullpage-nav-toggle'); 837 $menufullpage.menufullpage(); 838 }, 839 840 841 /* ---------------------------------------------------------------------- */ 842 /* ------------------------- Side Push Panel ---------------------------- */ 843 /* ---------------------------------------------------------------------- */ 844 TM_sidePanelReveal: function() { 845 $('.side-panel-trigger').on('click', function(e) { 846 $body.toggleClass("side-panel-open"); 847 if ( THEMEMASCOT.isMobile.any() ) { 848 $body.toggleClass("overflow-hidden"); 849 } 850 return false; 851 }); 852 853 $('.has-side-panel .body-overlay').on('click', function(e) { 854 $body.toggleClass("side-panel-open"); 855 return false; 856 }); 857 858 //sitebar tree 859 $('.side-panel-nav .nav .tree-toggler').on('click', function(e) { 860 $(this).parent().children('ul.tree').toggle(300); 861 }); 862 }, 863 864 /* ---------------------------------------------------------------------- */ 865 /* ------------------------------- scrollToTop ------------------------- */ 866 /* ---------------------------------------------------------------------- */ 867 TM_scroolToTop: function() { 868 if ($window.scrollTop() > 600) { 869 $('.scrollToTop').fadeIn(); 870 } else { 871 $('.scrollToTop').fadeOut(); 872 } 873 }, 874 875 TM_scroolToTopOnClick: function() { 876 $document_body.on('click', '.scrollToTop', function(e) { 877 $('html, body').animate({ 878 scrollTop: 0 879 }, 800); 880 return false; 881 }); 882 }, 883 884 885 /* ---------------------------------------------------------------------------- */ 886 /* --------------------------- One Page Nav close on click -------------------- */ 887 /* ---------------------------------------------------------------------------- */ 888 TM_menuCollapseOnClick: function() { 889 $document.on('click', '.onepage-nav a', function(e) { 890 $('.showhide').trigger('click'); 891 return false; 892 }); 893 }, 894 895 /* ---------------------------------------------------------------------- */ 896 /* ----------- Active Menu Item on Reaching Different Sections ---------- */ 897 /* ---------------------------------------------------------------------- */ 898 TM_activateMenuItemOnReach: function() { 899 var $onepage_nav = $('.onepage-nav'); 900 var cur_pos = $window.scrollTop() + 2; 901 var nav_height = $onepage_nav.outerHeight(); 902 $sections.each(function() { 903 var top = $(this).offset().top - nav_height - 80, 904 bottom = top + $(this).outerHeight(); 905 906 if (cur_pos >= top && cur_pos <= bottom) { 907 $onepage_nav.find('a').parent().removeClass('current').removeClass('active'); 908 $sections.removeClass('current').removeClass('active'); 909 910 //$(this).addClass('current').addClass('active'); 911 $onepage_nav.find('a[href="#' + $(this).attr('id') + '"]').parent().addClass('current').addClass('active'); 912 } 913 }); 914 }, 915 916 /* ---------------------------------------------------------------------- */ 917 /* ------------------- on click scrool to target with smoothness -------- */ 918 /* ---------------------------------------------------------------------- */ 919 TM_scrolltoTarget: function() { 920 //jQuery for page scrolling feature - requires jQuery Easing plugin 921 $('.smooth-scroll-to-target, .fullscreen-onepage-nav a').on('click', function(e) { 922 e.preventDefault(); 923 924 var $anchor = $(this); 925 926 var $hearder_top = $('.header .header-nav'); 927 var hearder_top_offset = 0; 928 if ($hearder_top[0]){ 929 hearder_top_offset = $hearder_top.outerHeight(true); 930 } else { 931 hearder_top_offset = 0; 932 } 933 934 //for vertical nav, offset 0 935 if ($body.hasClass("vertical-nav")){ 936 hearder_top_offset = 0; 937 } 938 939 var top = $($anchor.attr('href')).offset().top - hearder_top_offset; 940 $('html, body').stop().animate({ 941 scrollTop: top 942 }, 1500, 'easeInOutExpo'); 943 944 }); 945 }, 946 947 /* ---------------------------------------------------------------------- */ 948 /* -------------------------- Scroll navigation ------------------------- */ 949 /* ---------------------------------------------------------------------- */ 950 TM_navLocalScorll: function() { 951 var data_offset = -60; 952 $("#menuzord .menuzord-menu, #menuzord-right .menuzord-menu").localScroll({ 953 target: "body",
954 duration: 800, 955 offset: data_offset, 956 easing: "easeInOutExpo" 957 }); 958 959 $("#menuzord-side-panel .menuzord-menu, #menuzord-verticalnav .menuzord-menu, #fullpage-nav").localScroll({ 960 target: "body", 961 duration: 800, 962 offset: 0, 963 easing: "easeInOutExpo" 964 }); 965 }, 966 967 /* ---------------------------------------------------------------------------- */ 968 /* --------------------------- collapsed menu close on click ------------------ */ 969 /* ---------------------------------------------------------------------------- */ 970 TM_scrollToFixed: function() { 971 $('.navbar-scrolltofixed').scrollToFixed(); 972 $('.scrolltofixed').scrollToFixed({ 973 marginTop: $('.header .header-nav').outerHeight(true) + 10, 974 limit: function() { 975 var limit = $('#footer').offset().top - $(this).outerHeight(true); 976 return limit; 977 } 978 }); 979 $('#sidebar').scrollToFixed({ 980 marginTop: $('.header .header-nav').outerHeight() + 20, 981 limit: function() { 982 var limit = $('#footer').offset().top - $('#sidebar').outerHeight() - 20; 983 return limit; 984 } 985 }); 986 }, 987 988 /* ----------------------------------------------------------------------------- */ 989 /* --------------------------- Menuzord - Responsive Megamenu ------------------ */ 990 /* ----------------------------------------------------------------------------- */ 991 TM_menuzord: function() { 992 $("#menuzord").menuzord({ 993 align: "left", 994 effect: "slide", 995 animation: "none", 996 indicatorFirstLevel: "<i class='fa fa-angle-down'></i>", 997 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 998 }); 999 $("#menuzord-right").menuzord({ 1000 align: "right", 1001 effect: "slide", 1002 animation: "none", 1003 indicatorFirstLevel: "<i class='fa fa-angle-down'></i>", 1004 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 1005 }); 1006 $("#menuzord-side-panel").menuzord({ 1007 align: "right", 1008 effect: "slide", 1009 animation: "none", 1010 indicatorFirstLevel: "", 1011 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 1012 }); 1013 1014 $("#menuzord-verticalnav").menuzord({ 1015 align: "right", 1016 effect: "slide", 1017 animation: "none", 1018 indicatorFirstLevel: "<i class='fa fa-angle-down'></i>", 1019 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 1020 /*indicatorFirstLevel: "<i class='fa fa-angle-right'></i>", 1021 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>"*/ 1022 }); 1023 }, 1024 1025 /* ---------------------------------------------------------------------- */ 1026 /* --------------------------- Waypoint Top Nav Sticky ------------------ */ 1027 /* ---------------------------------------------------------------------- */ 1028 TM_topnavAnimate: function() { 1029 if ($window.scrollTop() > (50)) { 1030 $(".navbar-sticky-animated").removeClass("animated-active"); 1031 } else { 1032 $(".navbar-sticky-animated").addClass("animated-active"); 1033 } 1034 1035 if ($window.scrollTop() > (50)) { 1036 $(".navbar-sticky-animated .header-nav-wrapper .container, .navbar-sticky-animated .header-nav-wrapper .container-fluid").removeClass("add-padding"); 1037 } else { 1038 $(".navbar-sticky-animated .header-nav-wrapper .container, .navbar-sticky-animated .header-nav-wrapper .container-fluid").addClass("add-padding"); 1039 } 1040 }, 1041 1042 /* ---------------------------------------------------------------------- */ 1043 /* ---------------- home section on scroll parallax & fade -------------- */ 1044 /* ---------------------------------------------------------------------- */ 1045 TM_homeParallaxFadeEffect: function() { 1046 if ($window.width() >= 1200) { 1047 var scrolled = $window.scrollTop(); 1048 $('.content-fade-effect .home-content .home-text').css('padding-top', (scrolled * 0.0610) + '%').css('opacity', 1 - (scrolled * 0.00120)); 1049 } 1050 }, 1051 1052 /* ---------------------------------------------------------------------- */ 1053 /* --------------------------- Top search toggle ----------------------- */ 1054 /* ---------------------------------------------------------------------- */ 1055 TM_topsearch_toggle: function() { 1056 $document_body.on('click', '#top-search-toggle', function(e) { 1057 e.preventDefault(); 1058 $('.search-form-wrapper.toggle').toggleClass('active'); 1059 return false; 1060 }); 1061 } 1062 1063 }; 1064 1065 THEMEMASCOT.widget = { 1066 1067 init: function() { 1068 1069 var t = setTimeout(function() { 1070 THEMEMASCOT.widget.TM_shopClickEvents(); 1071 THEMEMASCOT.widget.TM_fcCalender(); 1072 THEMEMASCOT.widget.TM_verticalTimeline(); 1073 THEMEMASCOT.widget.TM_verticalMasonryTimeline(); 1074 THEMEMASCOT.widget.TM_masonryIsotop(); 1075 THEMEMASCOT.widget.TM_pieChart(); 1076 THEMEMASCOT.widget.TM_progressBar(); 1077 THEMEMASCOT.widget.TM_funfact(); 1078 //THEMEMASCOT.widget.TM_instagramFeed(); 1079 //THEMEMASCOT.widget.TM_jflickrfeed(); 1080 THEMEMASCOT.widget.TM_accordion_toggles();
1081 THEMEMASCOT.widget.TM_tooltip(); 1082 //THEMEMASCOT.widget.TM_countDownTimer(); 1083 }, 0); 1084 1085 }, 1086 1087 /* ---------------------------------------------------------------------- */ 1088 /* ------------------------------ Shop Plus Minus ----------------------- */ 1089 /* ---------------------------------------------------------------------- */ 1090 TM_shopClickEvents: function() { 1091 $document_body.on('click', '.quantity .plus', function(e) { 1092 var currentVal = parseInt($(this).parent().children(".qty").val(), 10); 1093 if (!isNaN(currentVal)) { 1094 $(this).parent().children(".qty").val(currentVal + 1); 1095 } 1096 return false; 1097 }); 1098 1099 $document_body.on('click', '.quantity .minus', function(e) { 1100 var currentVal = parseInt($(this).parent().children(".qty").val(), 10); 1101 if (!isNaN(currentVal) && currentVal > 0) { 1102 $(this).parent().children(".qty").val(currentVal - 1); 1103 } 1104 return false; 1105 }); 1106 1107 $document_body.on('click', '#checkbox-ship-to-different-address', function(e) { 1108 $("#checkout-shipping-address").toggle(this.checked); 1109 }); 1110 }, 1111 1112 1113 /* ---------------------------------------------------------------------- */ 1114 /* ------------------------------ Event Calendar ------------------------ */ 1115 /* ---------------------------------------------------------------------- */ 1116 TM_fcCalender: function() { 1117 if (typeof calendarEvents !== "undefined" ) { 1118 $('#full-event-calendar').fullCalendar({ 1119 header: { 1120 left: 'prev,next today', 1121 center: 'title', 1122 right: 'month,agendaWeek,agendaDay' 1123 }, 1124 defaultDate: '2016-01-12', 1125 selectable: true, 1126 selectHelper: true, 1127 select: function(start, end) { 1128 var title = prompt('Event Title:'); 1129 var eventData; 1130 if (title) { 1131 eventData = { 1132 title: title, 1133 start: start, 1134 end: end 1135 }; 1136 $('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true 1137 } 1138 $('#calendar').fullCalendar('unselect'); 1139 }, 1140 editable: true, 1141 eventLimit: true, // allow "more" link when too many events 1142 events: calendarEvents 1143 }); 1144 } 1145 }, 1146 1147 /* ---------------------------------------------------------------------- */ 1148 /* ------------------------------ Timeline Block ------------------------ */ 1149 /* ---------------------------------------------------------------------- */ 1150 TM_verticalTimeline: function() { 1151 var timelineBlocks = $('.cd-timeline-block'), 1152 offset = 0.8; 1153 1154 //hide timeline blocks which are outside the viewport 1155 hideBlocks(timelineBlocks, offset); 1156 1157 //on scolling, show/animate timeline blocks when enter the viewport 1158 $window.on('scroll', function(){ 1159 (!window.requestAnimationFrame) ? setTimeout(function(){ showBlocks(timelineBlocks, offset); }, 100) : window.requestAnimationFrame(function(){ showBlocks(timelineBlocks, offset); }); 1160 }); 1161 1162 function hideBlocks(blocks, offset) { 1163 blocks.each(function(){ 1164 ( $(this).offset().top > $window.scrollTop()+$window.height()*offset ) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden'); 1165 }); 1166 } 1167 1168 function showBlocks(blocks, offset) { 1169 blocks.each(function(){ 1170 ( $(this).offset().top <= $window.scrollTop()+$window.height()*offset && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in'); 1171 }); 1172 } 1173 }, 1174 1175 /* ---------------------------------------------------------------------- */ 1176 /* ----------------------- Vertical Masonry Timeline -------------------- */ 1177 /* ---------------------------------------------------------------------- */ 1178 TM_verticalMasonryTimeline: function() { 1179 var $masonry_timeline = $('.vertical-masonry-timeline'); 1180 $masonry_timeline.isotope({ 1181 itemSelector : '.each-masonry-item', 1182 sortBy: 'original-order', 1183 layoutMode: 'masonry', 1184 resizable: false 1185 }); 1186 1187 //=====> Timeline Positions 1188 function timeline_on_left_and_right(){ 1189 $masonry_timeline.children('.each-masonry-item').each(function(index, element) { 1190 var last_child = $(this); 1191 var prev_last = $(this).prev(); 1192 var last_child_offset = parseInt(last_child.css('top'), 10); 1193 var prev_last_offset = parseInt(prev_last.css('top'), 10); 1194 var offset_icon = last_child_offset - prev_last_offset; 1195 1196 var go_top_to = 0; 1197 if(offset_icon){ 1198 if ( offset_icon <= 87 ){ 1199 go_top_to = 87 - offset_icon; 1200 last_child.find('.timeline-post-format').animate({ 1201 top: go_top_to 1202 }, 300); 1203 } 1204 } 1205 1206 if( $(this).position().left === 0 ){ 1207 $(this).removeClass('item-right'); 1208 $(this).addClass('item-left'); 1209 }else{ 1210 $(this).removeClass('item-left'); 1211 $(this).addClass('item-right'); 1212 } 1213 }); 1214 } 1215 timeline_on_left_and_right(); 1216 1217 $window.resize(function() { 1218 timeline_on_left_and_right(); 1219 }); 1220 }, 1221 1222 /* ---------------------------------------------------------------------- */ 1223 /* ----------------------------- Masonry Isotope ------------------------ */ 1224 /* ---------------------------------------------------------------------- */ 1225 TM_masonryIsotop: function() { 1226 var isotope_mode; 1227 if ($portfolio_gallery.hasClass("masonry")){ 1228 isotope_mode = "masonry"; 1229 } else{ 1230 isotope_mode = "fitRows"; 1231 } 1232 1233 //isotope firsttime loading 1234 $portfolio_gallery.imagesLoaded(function(){ 1235 $portfolio_gallery.isotope({ 1236 itemSelector: '.gallery-item', 1237 layoutMode: isotope_mode, 1238 filter: "*" 1239 }); 1240 }); 1241 1242 //isotope filter 1243 $document_body.on('click', portfolio_filter, function(e) { 1244 $(portfolio_filter).removeClass("active"); 1245 $(this).addClass("active"); 1246 var fselector = $(this).data('filter'); 1247 1248 $portfolio_gallery.isotope({ 1249 itemSelector: '.gallery-item', 1250 layoutMode: isotope_mode, 1251 filter: fselector 1252 }); 1253 return false; 1254 }); 1255 1256 THEMEMASCOT.slider.TM_flexslider(); 1257 1258 }, 1259 1260 TM_portfolioFlexSliderGalleryPopUpInit: function() { 1261 var $flexSliders = $portfolio_gallery.find('.slides'); 1262 $flexSliders.each(function () { 1263 var _items = $(this).find("li > a"); 1264 var items = []; 1265 for (var i = 0; i < _items.length; i++) { 1266 items.push({src: $(_items[i]).attr("href"), title: $(_items[i]).attr("title")}); 1267 } 1268 $(this).parent().parent().parent().find(".icons-holder").magnificPopup({ 1269 items: items, 1270 type: 'image', 1271 gallery: { 1272 enabled: true 1273 } 1274 }); 1275 }); 1276 }, 1277 1278 TM_isotopeGridRearrange: function() { 1279 var isotope_mode; 1280 if ($portfolio_gallery.hasClass("masonry")){ 1281 isotope_mode = "masonry"; 1282 } else{ 1283 isotope_mode = "fitRows"; 1284 } 1285 $portfolio_gallery.isotope({ 1286 itemSelector: '.gallery-item', 1287 layoutMode: isotope_mode 1288 }); 1289 }, 1290 1291 TM_isotopeGridShuffle: function() { 1292 $portfolio_gallery.isotope('shuffle'); 1293 }, 1294 1295 /* ---------------------------------------------------------------------- */ 1296 /* ----------------------------- CountDown ------------------------------ */ 1297 /* ---------------------------------------------------------------------- */ 1298 TM_countDownTimer: function() { 1299 var $clock = $('#clock-count-down'); 1300 var endingdate = $clock.data("endingdate"); 1301 $clock.countdown(endingdate, function(event) { 1302 var countdown_text = '' + 1303 '<ul class="countdown-timer">' + 1304 '<li>%D <span>Days</span></li>' + 1305 '<li>%H <span>Hours</span></li>' + 1306 '<li>%M <span>Minutes</span></li>' + 1307 '<li>%S <span>Seconds</span></li>' + 1308 '</ul>'; 1309 $(this).html(event.strftime(countdown_text)); 1310 }); 1311 }, 1312 1313 1314 /* ---------------------------------------------------------------------- */ 1315 /* ----------------------- pie chart / circle skill bar ----------------- */ 1316 /* ---------------------------------------------------------------------- */ 1317 TM_pieChart: function() { 1318 var $piechart = $('.piechart');
1319 $piechart.appear(); 1320 $document_body.on('appear', '.piechart', function() { 1321 var current_item = $(this); 1322 if (!current_item.hasClass('appeared')) { 1323 var barcolor = current_item.data('barcolor'); 1324 var trackcolor = current_item.data('trackcolor'); 1325 var linewidth = current_item.data('linewidth'); 1326 var boxwidth = current_item.data('boxwidth'); 1327 current_item.css("width", boxwidth); 1328 current_item.easyPieChart({ 1329 animate: 3000, 1330 barColor: barcolor, 1331 trackColor: trackcolor, 1332 easing: 'easeOutBounce', 1333 lineWidth: linewidth, 1334 size: boxwidth, 1335 lineCap: 'square', 1336 scaleColor: false, 1337 onStep: function(from, to, percent) { 1338 $(this.el).find('span').text(Math.round(percent)); 1339 } 1340 }); 1341 current_item.addClass('appeared'); 1342 } 1343 }); 1344 }, 1345 1346 /* ---------------------------------------------------------------------- */ 1347 /* ------------------- progress bar / horizontal skill bar -------------- */ 1348 /* ---------------------------------------------------------------------- */ 1349 TM_progressBar: function() { 1350 var $progress_bar = $('.progress-bar'); 1351 $progress_bar.appear(); 1352 $document_body.on('appear', '.progress-bar', function() { 1353 var current_item = $(this); 1354 if (!current_item.hasClass('appeared')) { 1355 var percent = current_item.data('percent'); 1356 var barcolor = current_item.data('barcolor'); 1357 current_item.append('<span class="percent">' + percent + '%' + '</span>').css('background-color', barcolor).css('width', percent + '%').addClass('appeared'); 1358 } 1359 1360 }); 1361 }, 1362 1363 /* ---------------------------------------------------------------------- */ 1364 /* ------------------------ Funfact Number Counter ---------------------- */ 1365 /* ---------------------------------------------------------------------- */ 1366 TM_funfact: function() { 1367 var $animate_number = $('.animate-number'); 1368 $animate_number.appear(); 1369 $document_body.on('appear', '.animate-number', function() { 1370 $animate_number.each(function() { 1371 var current_item = $(this); 1372 if (!current_item.hasClass('appeared')) { 1373 current_item.animateNumbers(current_item.attr("data-value"), true, parseInt(current_item.attr("data-animation-duration"), 10)).addClass('appeared'); 1374 } 1375 }); 1376 }); 1377 }, 1378 1379 /* ---------------------------------------------------------------------- */ 1380 /* ----------------------------- Instagram Feed ---------------------------- */ 1381 /* ---------------------------------------------------------------------- */ 1382 /*TM_instagramFeed: function() { 1383 $('.instagram-feed').each(function() { 1384 var current_div = $(this); 1385 var instagramFeed = new Instafeed({ 1386 target: current_div.attr('id'), 1387 get: 'user', 1388 userId: current_div.data('userid'), 1389 accessToken: current_div.data('accesstoken'), 1390 resolution: current_div.data('resolution'), 1391 limit: current_div.data('limit'), 1392 template: '<div class="item"><figure><img src="{{image}}" /><a href="{{link}}" class="link-out" target="_blank"><i class="fa fa-link"></i></a></figure></div>', 1393 after: function() { 1394 } 1395 }); 1396 instagramFeed.run(); 1397 }); 1398 1399 $('.instagram-feed-carousel').each(function() { 1400 var current_div = $(this); 1401 var instagramFeed = new Instafeed({ 1402 target: current_div.attr('id'), 1403 get: 'user', 1404 userId: current_div.data('userid'), 1405 accessToken: current_div.data('accesstoken'), 1406 resolution: current_div.data('resolution'), 1407 limit: current_div.data('limit'), 1408 template: '<div class="item"><figure><img src="{{image}}" /><a href="{{link}}" class="link-out" target="_blank"><i class="fa fa-link"></i></a></figure></div>', 1409 after: function() { 1410 current_div.owlCarousel({ 1411 rtl: THEMEMASCOT.isRTL.check(), 1412 autoplay: true, 1413 autoplayTimeout: 4000, 1414 loop: true, 1415 margin: 15, 1416 dots: true, 1417 nav: false, 1418 responsive: { 1419 0: { 1420 items: 2 1421 }, 1422 768: { 1423 items: 4 1424 }, 1425 1000: { 1426 items: 5 1427 } 1428 } 1429 }); 1430 } 1431 }); 1432 instagramFeed.run(); 1433 }); 1434 }, 1435*/ 1436 /* ---------------------------------------------------------------------- */ 1437 /* ---------------------------- Flickr Feed ----------------------------- */ 1438 /* ---------------------------------------------------------------------- */ 1439 /* TM_jflickrfeed: function() { 1440 $(".flickr-widget .flickr-feed, .jflickrfeed").each(function() { 1441 var current_div = $(this); 1442 current_div.jflickrfeed({ 1443 limit: 9, 1444 qstrings: { 1445 id: current_div.data('userid') 1446 }, 1447 itemTemplate: '<a href="{{link}}" title="{{title}}" target="_blank"><img src="{{image_m}}" alt="{{title}}"> </a>' 1448 }); 1449 }); 1450 }, 1451*/ 1452 /* ---------------------------------------------------------------------- */ 1453 /* ------------------------- accordion & toggles ------------------------ */ 1454 /* ---------------------------------------------------------------------- */ 1455 TM_accordion_toggles: function() { 1456 var $panel_group_collapse = $('.panel-group .collapse'); 1457 $panel_group_collapse.on("show.bs.collapse", function(e) { 1458 $(this).closest(".panel-group").find("[href='#" + $(this).attr("id") + "']").addClass("active"); 1459 }); 1460 $panel_group_collapse.on("hide.bs.collapse", function(e) { 1461 $(this).closest(".panel-group").find("[href='#" + $(this).attr("id") + "']").removeClass("active"); 1462 }); 1463 }, 1464 1465 /* ---------------------------------------------------------------------- */ 1466 /* ------------------------------- tooltip ----------------------------- */ 1467 /* ---------------------------------------------------------------------- */ 1468 TM_tooltip: function() { 1469 $('[data-toggle="tooltip"]').tooltip(); 1470 }, 1471 1472 /* ---------------------------------------------------------------------- */ 1473 /* ---------------------------- Twitter Feed --------------------------- */ 1474 /* ---------------------------------------------------------------------- */ 1475 TM_twittie: function() { 1476 //var $twitter_feed = $('.twitter-feed'); 1477 // var $twitter_feed_carousel = $('.twitter-feed-carousel'); 1478 1479 /*if( $twitter_feed.length > 0 ) { 1480 $twitter_feed.twittie({ 1481 username: $twitter_feed.data('username'), 1482 dateFormat: '%b. %d, %Y', 1483 template: '{{tweet}} <div class="date">{{date}}</div>',
1484 count: ( $twitter_feed.data("count") === undefined ) ? 4: $twitter_feed.data("count"), 1485 loadingText: 'Loading!' 1486 }); 1487 } 1488 1489 if( $twitter_feed_carousel.length > 0 ) { 1490 $twitter_feed_carousel.twittie({ 1491 username: $twitter_feed_carousel.data('username'), 1492 dateFormat: '%b. %d, %Y', 1493 template: '{{tweet}} <div class="date">{{date}}</div>', 1494 count: ( $twitter_feed_carousel.data("count") === undefined ) ? 4: $twitter_feed_carousel.data("count"), 1495 loadingText: 'Loading!' 1496 }, function() { 1497 $twitter_feed_carousel.find('ul').owlCarousel({ 1498 rtl: THEMEMASCOT.isRTL.check(), 1499 autoplay: true, 1500 autoplayTimeout: 2000, 1501 loop: true, 1502 items: 1, 1503 dots: true, 1504 nav: false 1505 }); 1506 }); 1507 }*/ 1508 } 1509 }; 1510 1511 THEMEMASCOT.slider = { 1512 1513 init: function() { 1514 1515 var t = setTimeout(function() { 1516 THEMEMASCOT.slider.TM_typedAnimation(); 1517 THEMEMASCOT.slider.TM_flexslider(); 1518 THEMEMASCOT.slider.TM_owlCarousel(); 1519 THEMEMASCOT.slider.TM_maximageSlider(); 1520 THEMEMASCOT.slider.TM_bxslider(); 1521 }, 0); 1522 1523 }, 1524 1525 1526 /* ---------------------------------------------------------------------- */ 1527 /* -------------------------- Typed Text Carousel ---------------------- */ 1528 /* ---------------------------------------------------------------------- */ 1529 TM_typedAnimation: function() { 1530 if ($('.typed-text-carousel').length) { 1531 $('.typed-text-carousel').each(function() { 1532 var string_1 = $(this).find('span:first-child').text(); 1533 var string_2 = $(this).find('span:nth-child(2)').text(); 1534 var string_3 = $(this).find('span:nth-child(3)').text(); 1535 var str = ''; 1536 var $this = $(this); 1537 if (!string_2.trim() || !string_3.trim()) { 1538 str = [string_1]; 1539 } 1540 if (!string_3.trim() && string_2.length) { 1541 str = [string_1, string_2]; 1542 } 1543 if (string_1.length && string_2.length && string_3.length) { 1544 str = [string_1, string_2, string_3]; 1545 } 1546 var speed = $(this).data('speed'); 1547 var back_delay = $(this).data('back_delay'); 1548 var loop = $(this).data('loop'); 1549 $(this).typed({ 1550 strings: str, 1551 typeSpeed: speed, 1552 backSpeed: 0, 1553 backDelay: back_delay, 1554 cursorChar: "|", 1555 loop: loop, 1556 contentType: 'text', 1557 loopCount: false 1558 }); 1559 }); 1560 } 1561 }, 1562 1563 1564 /* ---------------------------------------------------------------------- */ 1565 /* -------------------------------- flexslider ------------------------- */ 1566 /* ---------------------------------------------------------------------- */ 1567 TM_flexslider: function() { 1568 var $each_flex_slider = $('.flexslider-wrapper').find('.flexslider'); 1569 THEMEMASCOT.widget.TM_portfolioFlexSliderGalleryPopUpInit(); 1570 $each_flex_slider.each(function() { 1571 var $flex_slider = $(this); 1572 var data_direction = ( $flex_slider.parent().data("direction") === undefined ) ? 'horizontal': $flex_slider.parent().data("direction"); 1573 var data_controlNav = ( $flex_slider.parent().data("c
1573ontrolnav") === undefined ) ? true: $flex_slider.parent().data("controlnav"); 1574 var data_directionnav = ( $flex_slider.parent().data("directionnav") === undefined ) ? true: $flex_slider.parent().data("directionnav"); 1575 $flex_slider.flexslider({ 1576 rtl: THEMEMASCOT.isRTL.check(), 1577 selector: ".slides > li", 1578 animation: "slide", 1579 easing: "swing", 1580 direction: data_direction, 1581 slideshow: true, 1582 slideshowSpeed: 7000, 1583 animationSpeed: 600, 1584 pauseOnHover: false, 1585 controlNav: data_controlNav, 1586 directionNav: data_directionnav, 1587 start: function(slider){ 1588 imagesLoaded($portfolio_gallery, function(){ 1589 setTimeout(function(){ 1590 $portfolio_filter_first_child.trigger("click"); 1591 },500); 1592 }); 1593 THEMEMASCOT.initialize.TM_magnificPopup_lightbox(); 1594 THEMEMASCOT.initialize.TM_prettyPhoto_lightbox(); 1595 THEMEMASCOT.initialize.TM_nivolightbox(); 1596 }, 1597 after: function(){ 1598 } 1599 }); 1600 }); 1601 }, 1602 1603 /* ---------------------------------------------------------------------- */ 1604 /* -------------------------------- Owl Carousel ----------------------- */ 1605 /* ---------------------------------------------------------------------- */ 1606 TM_owlCarousel: function() { 1607 $('.owl-carousel-1col, .text-carousel, .image-carousel, .fullwidth-carousel').each(function() { 1608 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1609 var data_nav = ( $(this).data("nav") === undefined ) ? false: $(this).data("nav"); 1610 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1611 $(this).owlCarousel({ 1612 rtl: THEMEMASCOT.isRTL.check(), 1613 autoplay: true, 1614 autoplayTimeout: data_duration, 1615 loop: true, 1616 items: 1, 1617 dots: data_dots, 1618 nav: data_nav, 1619 navText: [ 1620 '<i class="pe-7s-angle-left"></i>', 1621 '<i class="pe-7s-angle-right"></i>' 1622 ] 1623 }); 1624 }); 1625 1626 $('.owl-carousel-2col').each(function() { 1627 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1628 var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav"); 1629 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1630 $(this).owlCarousel({ 1631 rtl: THEMEMASCOT.isRTL.check(), 1632 autoplay: true, 1633 autoplayTimeout: data_duration, 1634 loop: true, 1635 items: 2, 1636 margin: 15, 1637 dots: data_dots, 1638 nav: data_nav, 1639 navText: [ 1640 '<i class="fa fa-angle-left"></i>', 1641 '<i class="fa fa-angle-right"></i>' 1642 ], 1643 responsive: { 1644 0: { 1645 items: 1, 1646 center: false 1647 }, 1648 480: { 1649 items: 1, 1650 center: false 1651 }, 1652 600: { 1653 items: 1, 1654 center: false 1655 }, 1656 750: { 1657 items: 2, 1658 center: false 1659 }, 1660 960: { 1661 items: 2 1662 }, 1663 1170: { 1664 items: 2 1665 }, 1666 1300: { 1667 items: 2 1668 } 1669 } 1670 }); 1671 }); 1672 1673 $('.owl-carousel-3col').each(function() { 1674 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1675 var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav"); 1676 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1677 $(this).owlCarousel({ 1678 rtl: THEMEMASCOT.isRTL.check(), 1679 autoplay: false, 1680 autoplayTimeout: data_duration, 1681 loop: true, 1682 items: 3, 1683 margin: 15, 1684 dots: data_dots, 1685 nav: data_nav, 1686 navText: [ 1687 '<i class="fa fa-angle-left"></i>', 1688 '<i class="fa fa-angle-right"></i>' 1689 ], 1690 responsive: { 1691 0: { 1692 items: 1, 1693 center: false 1694 }, 1695 480: { 1696 items: 1, 1697 center: false 1698 }, 1699 600: { 1700 items: 1, 1701 center: false 1702 }, 1703 750: { 1704 items: 2, 1705 center: false 1706 }, 1707 960: { 1708 items: 2 1709 }, 1710 1170: { 1711 items: 3 1712 }, 1713 1300: { 1714 items: 3 1715 } 1716 } 1717 }); 1718 }); 1719 1720 1721 $('.owl-carousel-4col').each(function() { 1722 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1723 var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav"); 1724 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1725 $(this).owlCarousel({ 1726 rtl: THEMEMASCOT.isRTL.check(), 1727 autoplay: true, 1728 autoplayTimeout: data_duration, 1729 loop: true, 1730 items: 4, 1731 margin: 15, 1732 dots: data_dots, 1733 nav: data_nav, 1734 navText: [ 1735 '<i class="fa fa-angle-left"></i>', 1736 '<i class="fa fa-angle-right"></i>' 1737 ], 1738 responsive: { 1739 0: { 1740 items: 1, 1741 center: true 1742 }, 1743 480: { 1744 items: 1, 1745 center: false 1746 }, 1747 600: { 1748 items: 3, 1749 center: false 1750 }, 1751 750: { 1752 items: 3, 1753 center: false 1754 }, 1755 960: { 1756 items: 3 1757 }, 1758 1170: { 1759 items: 4 1760 }, 1761 1300: { 1762 items: 4 1763 } 1764 } 1765 }); 1766 }); 1767 1768 $('.owl-carousel-5col').each(function() { 1769 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1770 var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav"); 1771 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1772 $(this).owlCarousel({ 1773 rtl: THEMEMASCOT.isRTL.check(), 1774 autoplay: true, 1775 autoplayTimeout: data_duration, 1776 loop: true, 1777 items: 5, 1778 margin: 15, 1779 dots: data_dots, 1780 nav: data_nav, 1781 navText: [ 1782 '<i class="fa fa-angle-left"></i>', 1783 '<i class="fa fa-angle-right"></i>' 1784 ], 1785 responsive: { 1786 0: { 1787 items: 1, 1788 center: false 1789 }, 1790 480: { 1791 items: 1, 1792 center: false 1793 }, 1794 600: { 1795 items: 2, 1796 center: false 1797 }, 1798 750: { 1799 items: 3, 1800 center: false 1801 }, 1802 960: { 1803 items: 4 1804 }, 1805 1170: { 1806 items: 5 1807 }, 1808 1300: { 1809 items: 5 1810 } 1811 } 1812 }); 1813 }); 1814 1815 $('.owl-carousel-6col').each(function() { 1816 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1817 var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav"); 1818 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1819 $(this).owlCarousel({ 1820 rtl: THEMEMASCOT.isRTL.check(), 1821 autoplay: true, 1822 autoplayTimeout: data_duration, 1823 loop: true, 1824 items: 6, 1825 margin: 15, 1826 dots: data_dots, 1827 nav: data_nav, 1828 navText: [ 1829 '<i class="fa fa-angle-left"></i>', 1830 '<i class="fa fa-angle-right"></i>' 1831 ], 1832 responsive: { 1833 0: { 1834 items: 1, 1835 center: false 1836 }, 1837 480: { 1838 items: 1, 1839 center: false 1840 }, 1841 600: { 1842 items: 2, 1843 center: false 1844 }, 1845 750: { 1846 items: 3, 1847 center: false 1848 }, 1849 960: { 1850 items: 4 1851 }, 1852 1170: { 1853 items: 6 1854 }, 1855 1300: { 1856 items: 6 1857 } 1858 } 1859 }); 1860 }); 1861 1862 $('.owl-carousel-7col').each(function() { 1863 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1864 var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav"); 1865 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1866 $(this).owlCarousel({ 1867 rtl: THEMEMASCOT.isRTL.check(), 1868 autoplay: true, 1869 autoplayTimeout: data_duration, 1870 loop: true, 1871 items: 7, 1872 margin: 15, 1873 dots: data_dots, 1874 nav: data_nav, 1875 navText: [ 1876 '<i class="fa fa-angle-left"></i>', 1877 '<i class="fa fa-angle-right"></i>' 1878 ], 1879 responsive: { 1880 0: { 1881 items: 1, 1882 center: false 1883 }, 1884 600: { 1885 items: 2, 1886 center: false 1887 }, 1888 750: { 1889 items: 3, 1890 center: false 1891 }, 1892 960: { 1893 items: 4 1894 }, 1895 1170: { 1896 items: 7 1897 }, 1898 1300: { 1899 items: 7 1900 } 1901 } 1902 }); 1903 }); 1904 1905 $('.owl-carousel-8col').each(function() { 1906 var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots"); 1907 var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav"); 1908 var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration"); 1909 $(this).owlCarousel({ 1910 rtl: THEMEMASCOT.isRTL.check(), 1911 autoplay: true, 1912 autoplayTimeout: data_duration, 1913 loop: true, 1914 items: 8, 1915 margin: 15, 1916 dots: data_dots, 1917 nav: data_nav, 1918 navText: [ 1919 '<i class="fa fa-angle-left"></i>', 1920 '<i class="fa fa-angle-right"></i>' 1921 ], 1922 responsive: { 1923 0: { 1924 items: 1, 1925 center: false 1926 }, 1927 600: { 1928 items: 2, 1929 center: false 1930 }, 1931 750: { 1932 items: 3, 1933 center: false 1934 }, 1935 960: { 1936 items: 5 1937 }, 1938 1170: { 1939 items: 8 1940 }, 1941 1300: { 1942 items: 8 1943 } 1944 } 1945 }); 1946 }); 1947 1948 }, 1949 1950 1951 /* ---------------------------------------------------------------------- */ 1952 /* ----------------------------- BxSlider ------------------------------ */ 1953 /* ---------------------------------------------------------------------- */ 1954 TM_bxslider: function() { 1955 var $bxslider = $('.bxslider'); 1956 if( $bxslider.length > 0 ) { 1957 $bxslider.bxSlider({ 1958 mode: 'vertical', 1959 minSlides: ( $bxslider.data("count") === undefined ) ? 2: $bxslider.data("count"), 1960 slideMargin: 20, 1961 pager: false, 1962 prevText: '<i class="fa fa-angle-left"></i>', 1963 nextText: '<i class="fa fa-angle-right"></i>' 1964 }); 1965 } 1966 }, 1967 1968 1969 /* ----------------------------------------------------------------
1969------ */ 1970 /* ---------- maximage Fullscreen Parallax Background Slider ----------- */ 1971 /* ---------------------------------------------------------------------- */ 1972 TM_maximageSlider: function() { 1973 $('#maximage').maximage({ 1974 cycleOptions: { 1975 fx: 'fade', 1976 speed: 1500, 1977 prev: '.img-prev', 1978 next: '.img-next' 1979 } 1980 }); 1981 } 1982 }; 1983 1984 1985 /* ---------------------------------------------------------------------- */ 1986 /* ---------- document ready, window load, scroll and resize ------------ */ 1987 /* ---------------------------------------------------------------------- */ 1988 //document ready 1989 THEMEMASCOT.documentOnReady = { 1990 init: function() { 1991 THEMEMASCOT.initialize.init(); 1992 THEMEMASCOT.header.init(); 1993 THEMEMASCOT.slider.init(); 1994 THEMEMASCOT.widget.init(); 1995 THEMEMASCOT.windowOnscroll.init(); 1996 } 1997 }; 1998 1999 //window on load 2000 THEMEMASCOT.windowOnLoad = { 2001 init: function() { 2002 var t = setTimeout(function() { 2003 THEMEMASCOT.initialize.TM_wow(); 2004 //THEMEMASCOT.widget.TM_twittie(); 2005 //THEMEMASCOT.initialize.TM_magnificPopup_lightbox(); 2006 THEMEMASCOT.initialize.TM_preLoaderOnLoad(); 2007 THEMEMASCOT.initialize.TM_hashForwarding(); 2008 THEMEMASCOT.initialize.TM_parallaxBgInit(); 2009 }, 0); 2010 $window.trigger("scroll"); 2011 $window.trigger("resize"); 2012 } 2013 }; 2014 2015 //window on scroll 2016 THEMEMASCOT.windowOnscroll = { 2017 init: function() { 2018 $window.on( 'scroll', function(){ 2019 THEMEMASCOT.header.TM_scroolToTop(); 2020 THEMEMASCOT.header.TM_activateMenuItemOnReach(); 2021 THEMEMASCOT.header.TM_topnavAnimate(); 2022 }); 2023 } 2024 }; 2025 2026 //window on resize 2027 THEMEMASCOT.windowOnResize = { 2028 init: function() { 2029 var t = setTimeout(function() { 2030 THEMEMASCOT.initialize.TM_equalHeightDivs(); 2031 THEMEMASCOT.initialize.TM_resizeFullscreen(); 2032 }, 400); 2033 } 2034 }; 2035 2036 2037 /* ---------------------------------------------------------------------- */ 2038 /* ---------------------------- Call Functions -------------------------- */ 2039 /* ---------------------------------------------------------------------- */ 2040 $document.ready( 2041 THEMEMASCOT.documentOnReady.init 2042 ); 2043 $window.on('load', 2044 THEMEMASCOT.windowOnLoad.init 2045 ); 2046 $window.on('resize', 2047 THEMEMASCOT.windowOnResize.init 2048 ); 2049 2050 //call function before document ready 2051 THEMEMASCOT.initialize.TM_preLoaderClickDisable(); 2052 2053})(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.