1 2(function () { 3 "use strict"; 4 5 var Core = { 6 7 initialized: false, 8 9 initialize: function () { 10 if (this.initialized) return; 11 this.initialized = true; 12 13 AOS.init({ 14 offset: 120, 15 duration: 500 16 }); 17 this.v_Common(); 18 this.v_FancyHeading(); 19 this.v_AnimateCharts(); 20 this.v_Counter(); 21 this.v_IconBoxes(); 22 this.v_IntoAnimations(); 23 this.v_Map.init(); 24 this.v_Parallax.init(); 25 this.v_FlexSlider.init(); 26 this.v_Portfolio.init(); 27 this.v_Blog.init(); 28 this.v_ProgressBar(); 29 this.v_owlCarousel(); 30 this.v_AnchorsPosition(); 31 }, 32 33 //Anchors Position 34 v_AnchorsPosition: function () { 35 $("a[data-hash]").on("click", function (e) { 36 e.preventDefault(); 37 var header = $("body header:first"), 38 headerHeight = header.height(), 39 target = $(this).attr("href"), 40 $this = $(this); 41 42 var stickyHeight = $(window).scrollTop() > 60 ? 0: 30; // for the sticky menu 43 44 if ($(window).width() > 991) { 45 $("html,body").animate({ scrollTop: $(target).offset().top - (headerHeight) + stickyHeight }, 600, "easeOutQuad"); 46 } else { 47 $("html,body").animate({ scrollTop: $(target).offset().top }, 600, "easeOutQuad"); 48 } 49 50 return false; 51 }); 52 }, 53 //End Anchors Position 54 55 56 //owlCarousel 57 v_owlCarousel: function (options) { 58 59 var total = $("div.owl-carousel:not(.manual)").length, 60 count = 0; 61 62 $("div.owl-carousel:not(.manual)").each(function () { 63 64 var slider = $(this); 65 66 var defaults = { 67 // Most important owl features 68 items: 5, 69 itemsCustom: false, 70 itemsDesktop: [1199, 4], 71 itemsDesktopSmall: [980, 3], 72 itemsTablet: [768, 2], 73 itemsTabletSmall: false, 74 itemsMobile: [479, 1], 75 singleItem: false, 76 itemsScaleUp: false, 77 78 //Basic Speeds 79 slideSpeed: 200, 80 paginationSpeed: 800, 81 rewindSpeed: 1000, 82 83 //Autoplay 84 autoPlay: false, 85 stopOnHover: false, 86 87 // Navigation 88 navigation: false, 89 navigationText: ["<i class=\"fa fa-chevron-left\"></i>", "<i class=\"fa fa-chevron-right\"></i>"], 90 rewindNav: true, 91 scrollPerPage: false, 92 93 //Pagination 94 pagination: false, 95 paginationNumbers: false, 96 97 // Responsive 98 responsive: true, 99 responsiveRefreshRate: 200, 100 responsiveBaseWidth: window, 101 102 // CSS Styles 103 baseClass: "owl-carousel", 104 theme: "owl-theme", 105 106 //Lazy load 107 lazyLoad: false, 108 lazyFollow: true, 109 lazyEffect: "fade", 110 111 //Auto height 112 autoHeight: false, 113 114 //JSON 115 jsonPath: false, 116 jsonSuccess: false, 117 118 //Mouse Events 119 dragBeforeAnimFinish: true, 120 mouseDrag: true, 121 touchDrag: true, 122 123 //Transitions 124 transitionStyle: false, 125 126 // Other 127 addClassActive: false, 128 129 //Callbacks 130 beforeUpdate: false, 131 afterUpdate: false, 132 beforeInit: false, 133 afterInit: false, 134 beforeMove: false, 135 afterMove: false, 136 afterAction: false, 137 startDragging: false, 138 afterLazyLoad: false 139 } 140 141 var config = $.extend({}, defaults, options, slider.data("plugin-options")); 142 143 // Initialize Slider 144 slider.owlCarousel(config).addClass("owl-carousel-init"); 145 146 }); 147 148 149 $("div.carousel-wrap").each(function () { 150 151 var slider = $(this); 152 153 slider.find(".customNavigation .next").click(function () { 154 slider.find("div.owl-carousel:not(.manual)").trigger('owl.next'); 155 }) 156 slider.find(".customNavigation .prev").click(function () { 157 slider.find("div.owl-carousel:not(.manual)").trigger('owl.prev'); 158 }) 159 160 }); 161 162 }, 163 //owlCarousel 164 165 166 //FlexSlider 167 v_FlexSlider: { 168 init: function () { 169 170 if (jQuery('.recent-posts').length > 0) { 171 Core.v_FlexSlider.thumb(); 172 } 173
174 jQuery('.item-slider').flexslider({ 175 animation: "slide", //String: Select your animation type, "fade" or "slide" 176 slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" 177 slideshow: true, //Boolean: Animate slider automatically 178 slideshowSpeed: 6000, //Integer: Set the speed of the slideshow cycling, in milliseconds 179 animationDuration: 500, //Integer: Set the speed of animations, in milliseconds 180 smoothHeight: true, 181 directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) 182 controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage 183 keyboardNav: false, //Boolean: Allow slider navigating via keyboard left/right keys 184 mousewheel: false, //Boolean: Allow slider navigating via mousewheel 185 prevText: "Prev", //String: Set the text for the "previous" directionNav item 186 nextText: "Next", //String: Set the text for the "next" directionNav item 187 pausePlay: true, //Boolean: Create pause/play dynamic element 188 pauseText: '', //String: Set the text for the "pause" pausePlay item 189 playText: '', //String: Set the text for the "play" pausePlay item 190 randomize: false, //Boolean: Randomize slide order 191 slideToStart: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) 192 animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end 193 pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. 194 pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering 195 controlsContainer: "", //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", ".main", etc. If the given element is not found, the default action will be taken. 196 manualControls: "", //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. 197 start: function () { }, //Callback: function(slider) - Fires when the slider loads the first slide 198 before: function () { }, //Callback: function(slider) - Fires asynchronously with each slider animation 199 after: function () { }, //Callback: function(slider) - Fires after each slider animation completes 200 end: function () { } //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) 201 }); 202 jQuery('.content-slider').each(function () { 203 var slider = jQuery(this), 204 autoplay = ((slider.attr('data-autoplay') === "yes") ? true : false); 205 206 slider.flexslider({ 207 animation: "fade", //String: Select your animation type, "fade" or "slide" 208 slideshow: autoplay, //Boolean: Animate slider automatically 209 slideshowSpeed: 6000, //Integer: Set the speed of the slideshow cycling, in milliseconds 210 animationDuration: 1000, //Integer: Set the speed of animations, in milliseconds 211 smoothHeight: true, 212 directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) 213 controlNav: false, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage 214 start: function () { } 215 }); 216 }); 217 218 }, 219 thumb: function () { 220 jQuery('.thumb-slider').flexslider({ 221 animation: "fade", //String: Select your animation type, "fade" or "slide" 222 slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" 223 slideshow: false, //Boolean: Animate slider automatically 224 slideshowSpeed: 6000, //Integer: Set the speed of the slideshow cycling, in milliseconds 225 animationDuration: 600, //Integer: Set the speed of animations, in milliseconds 226 directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) 227 controlNav: false, //Boolean: Create navigation for paging control of each slide? Note: Leave true for manualControls usage 228 keyboardNav: false, //Boolean: Allow slider navigating via keyboard left/right keys 229 smoothHeight: true 230 }); 231 }, 232 233 gallery: function () { 234 jQuery('.v-gallery-widget').each(function () { 235 236 var gallerySlider = jQuery(this).find('.gallery-slider'); 237 238 gallerySlider.flexslider({ 239 animation: gallerySlider.data('transition'), 240 controlNav: false, 241 animationLoop: false, 242 slideshow: false 243 }); 244 245 }); 246 247 } 248 }, 249 //End FlexSlider 250 251 252 //Blog 253 v_Blog: { 254 init: function () { 255 if (blogItems.hasClass('masonry-items')) { 256 Core.v_Blog.masonryBlog(); 257 } 258 }, 259 masonryBlog: function () { 260 if (!(IEVersion && IEVersion < 9)) { 261 var scrollAnimateElement = new AnimOnScroll(document.getElementById('blogGrid'), { 262 minDuration: 0.4, 263 maxDuration: 0.7, 264 viewportFactor: 0.2 265 }); 266 } 267 blogItems.imagesLoaded(function () { 268 Core.v_FlexSlider.thumb(); 269 }); 270 blogItems.fitVids(); 271 } 272 }, 273 //End Blog 274 275 276 //Parallax 277 v_Parallax: { 278 init: function () { 279 280 jQuery('.v-parallax').each(function () { 281 282 var parallaxAsset = jQuery(this); 283 284 if (parallaxAsset.hasClass('v-parallax-video')) { 285 286 if (!isMobileAlt) { 287 288 var parallaxVideo = parallaxAsset.find('video'), 289 parallaxContent = parallaxAsset.find('.v-content-wrapper'), 290 parallaxVideoTop = 0; 291
292 parallaxVideo.css('top', -parallaxVideoTop); 293 parallaxVideo.attr('data-top-default', parallaxVideoTop); 294 295 if (parallaxAsset.hasClass('parallax-video-height')) { 296 parallaxAsset.animate({ 297 'height': parallaxVideo.height() / 2 298 }, 400); 299 setTimeout(function () { 300 parallaxAsset.find('.video-overlay').animate({ 301 'opacity': 0.8 302 }, 200); 303 }, 100); 304 parallaxContent.vCenterTop(); 305 setTimeout(function () { 306 parallaxContent.animate({ 307 'opacity': 1, 308 'top': '50%' 309 }, 600, 'easeOutExpo'); 310 }, 600); 311 parallaxAsset.attr('data-height-default', parallaxVideo.height() / 2); 312 $window.smartresize(function () { 313 parallaxAsset.animate({ 314 height: parallaxVideo.height() / 2 315 }, 400); 316 parallaxVideo.css('top', -parallaxVideo.height() / 4); 317 parallaxVideo.attr('data-top-default', parallaxVideo.height() / 4); 318 parallaxAsset.attr('data-height-default', parallaxVideo.height() / 2); 319 }); 320 } 321 322 $window.scroll(function () { 323 if ($window.width() > 1024) { 324 Core.v_Parallax.videoScroll(parallaxAsset); 325 } 326 }); 327 } else { 328 parallaxAsset.find('video').remove(); 329 } 330 331 } else if (parallaxAsset.hasClass('parallax-window-height')) { 332 jQuery(this).height($window.height() - (parseInt(jQuery(this).css('padding-top'), 10) * 2) - 30); 333 jQuery(this).find('.v-content-wrapper').vCenterTop(); 334 $window.scroll(function () { 335 if ($window.width() > 1024) { 336 //Core.v_Parallax.windowImageScroll(parallaxAsset); 337 } 338 }); 339 } 340 }); 341 }, 342 videoScroll: function (asset) { 343 344 var offsetTop = asset.offset().top, 345 windowTop = $window.scrollTop(), 346 defaultHeight = parseInt(asset.data('height-default'), 10), 347 diff = windowTop - offsetTop, 348 currentTop = asset.find('.v-content-wrapper').css('top'), 349 heightDifference = defaultHeight - diff * 1.5; 350 351 if (windowTop > offsetTop) { 352 asset.css('height', heightDifference); 353 asset.find('.v-content-wrapper').css('opacity', 1 - (diff / 300)); 354 if (asset.hasClass('parallax-video-height')) { 355 asset.find('.v-content-wrapper').css('top', currentTop + (diff / 4)); 356 } else { 357 asset.find('.v-content-wrapper').css('top', (diff / 3)); 358 } 359 } else { 360 asset.css('height', defaultHeight); 361 asset.find('.v-content-wrapper').css('opacity', 1); 362 if (asset.hasClass('parallax-video-height')) { 363 asset.find('.v-content-wrapper').css('top', '50%'); 364 } else { 365 asset.find('.v-content-wrapper').css('top', 0); 366 } 367 } 368 369 }, 370 //windowImageScroll: function (asset) { 371 // asset.height($window.height() - jQuery(this).css('padding-top') / 2); 372 // asset.find('.v-content-wrapper').vCenterTop(); 373 //} 374 }, 375 //End Parallax 376 377 378 //Map 379 v_Map: { 380 init: function () { 381 382 var maps = jQuery('.map-canvas'); 383 maps.each(function (index, element) { 384 var mapContainer = element, 385 mapAddress = mapContainer.getAttribute('data-address'), 386 mapZoom = mapContainer.getAttribute('data-zoom'), 387 mapType = mapContainer.getAttribute('data-maptype'), 388 mapColor = mapContainer.getAttribute('data-mapcolor'), 389 mapSaturation = mapContainer.getAttribute('data-mapsaturation'), 390 pinLogoURL = mapContainer.getAttribute('data-pinimage'); 391 392 Core.v_Map.getCoordinates(mapAddress, mapContainer, mapZoom, mapType, mapColor, mapSaturation, pinLogoURL); 393 394 }); 395 396 //Core.v_Map.fullscreenMap(); 397 //$window.smartresize(function () { 398 // Core.v_Map.fullscreenMap(); 399 //}); 400 401 }, 402 getCoordinates: function (address, mapContainer, mapZoom, mapType, mapColor, mapSaturation, pinLogoURL) { 403 var geocoder; 404 geocoder = new google.maps.Geocoder(); 405 geocoder.geocode({ 406 'address': address 407 }, function (results, status) { 408 if (status == google.maps.GeocoderStatus.OK) { 409 410 if (mapSaturation == "mono") { 411 mapSaturation = -100; 412 } else { 413 mapSaturation = -20; 414 } 415 416 var styles = [ 417 { 418 stylers: [ 419 { hue: mapColor }, 420 { saturation: mapSaturation } 421 ] 422 } 423 ]; 424 425 var styledMap = new google.maps.StyledMapType(styles, { name: "Styled Map" }); 426 427 var mapTypeIdentifier = "", 428 companyPos = "", 429 isDraggable = true, 430 mapCoordinates = results[0].geometry.location, 431 latitude = results[0].geometry.location.lat(), 432 longitude = results[0].geometry.location.lng(); 433 434 if (isMobileAlt) { 435 isDraggable = false; 436 } 437 438 if (mapType === "satellite") { 439 mapTypeIdentifier = google.maps.MapTypeId.SATELLITE; 440 } else if (mapType === "terrain") { 441 mapTypeIdentifier = google.maps.MapTypeId.TERRAIN; 442 } else if (mapType === "hybrid") { 443 mapTypeIdentifier = google.maps.MapTypeId.HYBRID; 444 } else { 445 mapTypeIdentifier = google.maps.MapTypeId.ROADMAP; 446 } 447 448 var latlng = new google.maps.LatLng(latitude, longitude); 449 var settings = { 450 zoom: parseInt(mapZoom, 10), 451 scrollwheel: false, 452 center: latlng, 453 draggable: isDraggable, 454 mapTypeControl: true, 455 mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, 456 navigationControl: true, 457 navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL }, 458 mapTypeId: mapTypeIdentifier 459 }; 460 var mapInstance = new google.maps.Map(mapContainer, settings); 461 var companyMarker = ""; 462 463 jQuery(mapContainer).appear(function () { 464 setTimeout(function () { 465 if (pinLogoURL) { 466 var companyLogo = new google.maps.MarkerImage(pinLogoURL, 467 new google.maps.Size(150, 75), 468 new google.maps.Point(0, 0), 469 new google.maps.Point(75, 75) 470 ); 471 companyPos = new google.maps.LatLng(latitude, longitude); 472 companyMarker = new google.maps.Marker({ 473 position: mapCoordinates, 474 map: mapInstance, 475 icon: companyLogo, 476 animation: google.maps.Animation.DROP 477 }); 478 } else { 479 companyPos = new google.maps.LatLng(latitude, longitude); 480 companyMarker = new google.maps.Marker({ 481 position: mapCoordinates, 482 map: mapInstance, 483 animation: google.maps.Animation.DROP 484 }); 485 } 486 487 google.maps.event.addListener(companyMarker, 'click', function () { 488 window.location.href = 'http://maps.google.com/maps?q=' + companyPos; 489 }); 490 491 google.maps.event.addDomListener(window, 'resize', function () { 492 mapInstance.setCenter(companyPos); 493 }); 494 }, 1000); 495 }); 496 497 if (mapColor !== "") { 498 mapInstance.mapTypes.set('map_style', styledMap); 499 mapInstance.setMapTypeId('map_style'); 500 } 501 502 } else { 503 console.log(status); 504 } 505 }); 506 }, 507 fullscreenMap: function () { 508 var fullscreenMap = jQuery('.fullscreen-map'), 509 container = jQuery('.main'), 510 mapOffset = container.offset().left, 511 windowWidth = $window.width(); 512 513 if (windowWidth > 768) { 514 mapOffset = mapOffset; 515 } else { 516 mapOffset = 20; 517 } 518 519 if (jQuery('body').hasClass('boxed-layout')) { 520 windowWidth = jQuery('body').width(); 521 522 if (windowWidth > 1024) { 523 mapOffset = 45; 524 } else if (windowWidth > 768) {
525 mapOffset = 30; 526 } else if (windowWidth > 480) { 527 mapOffset = 24; 528 } else { 529 mapOffset = 20; 530 } 531 } 532 533 fullscreenMap.find('.map-canvas').css('width', windowWidth); 534 fullscreenMap.css('margin-left', '-' + mapOffset + 'px'); 535 536 } 537 }, 538 //End Map 539 540 541 //IntoAnimations 542 v_IntoAnimations: function () { 543 544 if (!isMobileAlt) { 545 // jQuery('.v-animation').each(function () { 546 547 // var animatedItem = jQuery(this), 548 //itemAnimation = animatedItem.data('animation'), 549 //itemDelay = animatedItem.data('delay'); 550 551 // animatedItem.appear(function () { 552 // if (itemAnimation == 'fade-from-left') { 553 // animatedItem.delay(itemDelay).animate({ 554 // 'opacity': 1, 555 // 'left': '0px' 556 // }, 600, 'easeOutCubic'); 557 // } else if (itemAnimation == 'fade-from-right') { 558 // animatedItem.delay(itemDelay).animate({ 559 // 'opacity': 1, 560 // 'right': '0px' 561 // }, 600, 'easeOutCubic'); 562 // } else if (itemAnimation == 'fade-from-bottom') { 563 // { 564 // animatedItem.delay(itemDelay).animate({ 565 // 'opacity': 1, 566 // 'bottom': '0px' 567 // }, 600, 'easeOutCubic'); 568 // } 569 // } else if (itemAnimation == 'fade-in') { 570 // animatedItem.delay(itemDelay).animate({ 571 // 'opacity': 1 572 // }, 600, 'easeOutCubic'); 573 // } else if (itemAnimation == 'grow') { 574 // setTimeout(function () { 575 // animatedItem.addClass('v-animate'); 576 // }, itemDelay); 577 // } else { 578 // setTimeout(function () { 579 // animatedItem.addClass('v-animate'); 580 // }, itemDelay); 581 // } 582 // }, { accX: 0, accY: -150 }, 'easeInCubic'); 583 584 // }); 585 } 586 }, 587 //End IntoAnimations 588 589 590 //Common 591 v_Common: function () { 592 if (isMobile) { 593 body.addClass("mobile-browser"); 594 } else { 595 body.addClass("standard-browser"); 596 } 597 if (isAppleDevice) { 598 body.addClass("apple-mobile-browser"); 599 } 600 // ADD IE CLASS 601 if (IEVersion && IEVersion < 10) { 602 body.addClass('browser-ie'); 603 } 604 605 // ADD IE10 CLASS 606 var pattern = /MSIE\s([\d]+)/, 607 ua = navigator.userAgent, 608 matched = ua.match(pattern); 609 if (matched) { 610 body.addClass('browser-ie10'); 611 } 612 613 jQuery(".modal").each(function () { 614 jQuery(this).appendTo("body"); 615 }); 616 }, 617 //End Common 618 619 620 //IconBoxes 621 v_IconBoxes: function () { 622 jQuery('.v-icon-box').hover( 623 function () { 624 jQuery(this).addClass('sf-hover'); 625 }, function () { 626 jQuery(this).removeClass('sf-hover'); 627 } 628 ); 629 }, 630 //End IconBoxes 631 632 633 //Counter 634 v_Counter: function () { 635 jQuery('.v-counter').each(function () { 636 637 var countAsset = jQuery(this), 638 countNumber = countAsset.find('.count-number'), 639 countDivider = countAsset.find('.count-divider').find('span'), 640 countSubject = countAsset.find('.v-counter-text'); 641 642 if (!isMobileAlt) {
643 countAsset.appear(function () { 644 645 countNumber.countTo({ 646 onComplete: function () { 647 countDivider.animate({ 648 'width': 50 649 }, 400, 'easeOutCubic'); 650 countSubject.delay(100).animate({ 651 'opacity': 1, 652 'bottom': '0px' 653 }, 600, 'easeOutCubic'); 654 } 655 }); 656 657 }, { accX: 0, accY: -150 }, 'easeInCubic'); 658 } else { 659 countNumber.countTo({ 660 onComplete: function () { 661 countDivider.animate({ 662 'width': 50 663 }, 400, 'easeOutCubic'); 664 countSubject.delay(100).animate({ 665 'opacity': 1, 666 'bottom': '0px' 667 }, 600, 'easeOutCubic'); 668 } 669 }); 670 } 671 672 }); 673 }, 674 //End Counter 675 676 677 //AnimateCharts 678 v_AnimateCharts: function () { 679 jQuery('.v-circle-chart').each(function () { 680 jQuery(this).easyPieChart({ 681 animate: 1000, 682 lineCap: 'round', 683 lineWidth: jQuery(this).attr('data-linewidth'), 684 size: jQuery(this).attr('data-size'), 685 barColor: jQuery(this).attr('data-barcolor'), 686 trackColor: jQuery(this).attr('data-trackcolor'), 687 scaleColor: 'transparent' 688 }); 689 }); 690 691 jQuery('.v-circle-chart').each(function () { 692 var chart = jQuery(this); 693 chart.appear(function () { 694 if (!jQuery(this).hasClass('animated')) { 695 jQuery(this).addClass('animated'); 696 var animatePercentage = parseInt(jQuery(this).attr('data-animatepercent'), 10); 697 jQuery(this).data('easyPieChart').update(animatePercentage); 698 } 699 }); 700 }); 701 }, 702 //End AnimateCharts 703 704 705 //FancyHeading 706 v_FancyHeading: function () { 707 if (jQuery('.v-fancy-heading').hasClass('v-fancy-image')) { 708 $window.stellar(); 709 } 710 setTimeout(function () { 711 jQuery('.v-fancy-heading').slideDown({ 712 duration: 600, 713 easing: "easeInOutQuart" 714 }); 715 }, 200); 716 }, 717 //End FancyHeading 718 719 720 //ProgressBar 721 v_ProgressBar: function () { 722 $("[data-appear-progress-animation]").each(function () { 723 var $this = $(this); 724 725 $this.appear(function () { 726 var delay = ($this.attr("data-appear-animation-delay") ? $this.attr("data-appear-animation-delay") : 1); 727 728 if (delay > 1) $this.css("animation-delay", delay + "ms"); 729 $this.addClass($this.attr("data-appear-animation")); 730 731 setTimeout(function () { 732 $this.animate({ 733 width: $this.attr("data-appear-progress-animation") 734 }, 1500, "easeOutQuad", function () { 735 $this.find(".progress-bar-tooltip").animate({ 736 opacity: 1 737 }, 500, "easeOutQuad"); 738 }); 739 }, delay); 740 }, { accX: 0, accY: -50 }); 741 }); 742 }, 743 //End ProgressBar 744 745 746 //ReloadFunctions 747 v_ReloadFunctions: { 748 init: function () { 749 750 // Remove title attributes from images to avoid showing on hover 751 jQuery('img[title]').each(function () { 752 jQuery(this).removeAttr('title'); 753 }); 754 755 if (!isAppleDevice) { 756 jQuery('embed').show(); 757 } 758 759 // Animate Top Links 760 jQuery('.animate-top').on('click', function (e) { 761 e.preventDefault(); 762 jQuery('body,html').animate({ scrollTop: 0 }, 800, 'easeOutCubic'); 763 }); 764 }, 765 load: function () { 766 if (!isMobile) { 767 768 // Button hover tooltips 769 jQuery('.tooltip').each(function () { 770 jQuery(this).css('marginLeft', '-' + Math.round((jQuery(this).outerWidth(true) / 2)) + 'px'); 771 }); 772 773 jQuery('.comment-avatar').hover(function () { 774 jQuery(this).find('.tooltip').stop().animate({ 775 bottom: '44px', 776 opacity: 1 777 }, 500, 'easeInOutExpo'); 778 }, function () { 779 jQuery(this).find('.tooltip').stop().animate({ 780 bottom: '25px', 781 opacity: 0 782 }, 400, 'easeInOutExpo'); 783 }); 784 } 785 } 786 }, 787 //End ReloadFunctions 788 789 790 //Portfolio 791 v_Portfolio: { 792 init: function () { 793 if (portfolioContainer.hasClass('masonry-items')) { 794 Core.v_Portfolio.masonrySetup(); 795 } else { 796 Core.v_Portfolio.standardSetup(); 797 } 798 799 // PORTFOLIO WINDOW RESIZE 800 $window.smartresize(function () { 801 Core.v_Portfolio.windowResized(); 802 }); 803 804 // Enable filter options on when there are items from that skill 805 jQuery('.filtering li').each(function () { 806 var itemCount = 0; 807 var filter = jQuery(this), 808 filterName = jQuery(this).find('a').attr('class'), 809 portfolioItems = jQuery(this).parent().parent().parent().find('.filterable-items'); 810 811 portfolioItems.find('.v-portfolio-item').each(function () { 812 if (jQuery(this).hasClass(filterName)) { 813 filter.addClass('has-items'); 814 itemCount++; 815 } 816 }); 817 818 if (jQuery(this).hasClass('all')) { 819 itemCount = portfolioItems.children('li').length; 820 jQuery(this).find('.item-count').text(itemCount); 821 } else { 822 jQuery(this).find('.item-count').text(itemCount); 823 } 824 }).parents('.v-portfolio-filter-nav').animate({ 825 opacity: 1 826 }, 400); 827 828 // filter items when filter link is clicked 829 jQuery('.filtering li').on('click', 'a', function (e) { 830 e.preventDefault(); 831 jQuery(this).parent().parent().find('li').removeClass('selected'); 832 jQuery(this).parent().addClass('selected'); 833 var selector = jQuery(this).data('filter'); 834 var portfolioItems = jQuery(this).parent().parent().parent().parent().find('.filterable-items'); 835 portfolioItems.isotope({ filter: selector }); 836 }); 837 838 jQuery('.v-portfolio-filter-wrap > a').on('click', function (e) { 839 e.preventDefault(); 840 jQuery(this).parent().find('.filter-slide-wrap').slideToggle(); 841 }); 842 }, 843 standardSetup: function () { 844 // SET ITEM HEIGHTS 845 portfolioContainer.imagesLoaded(function () { 846 Core.v_Portfolio.setItemHeight(); 847 Core.v_FlexSlider.thumb(); 848 portfolioContainer.animate({ opacity: 1 }, 800); 849 portfolioContainer.isotope({ 850 animationEngine: 'best-available', 851 animationOptions: { 852 duration: 300, 853 easing: 'easeInOutQuad', 854 queue: false 855 }, 856 resizable: true, 857 layoutMode: 'fitRows' 858 }); 859 portfolioContainer.isotope("reLayout"); 860 }); 861 }, 862 masonrySetup: function () { 863 portfolioContainer.fitVids(); 864 portfolioContainer.imagesLoaded(function () { 865 Core.v_FlexSlider.thumb(); 866 portfolioContainer.animate({ opacity: 1 }, 800); 867 portfolioContainer.isotope({ 868 itemSelector: '.v-portfolio-item', 869 animationEngine: 'best-available', 870 animationOptions: { 871 duration: 300, 872 easing: 'easeInOutQuad', 873 queue: false 874 }, 875 resizable: true 876 }); 877 878 }); 879 }, 880 setItemHeight: function () { 881 if (!portfolioContainer.hasClass('masonry-items')) { 882 portfolioContainer.children().css('min-height', '0'); 883 portfolioContainer.equalHeights();
884 } 885 }, 886 windowResized: function () { 887 if (!portfolioContainer.hasClass('masonry-items')) { 888 Core.v_Portfolio.setItemHeight(); 889 } 890 portfolioContainer.isotope("reLayout"); 891 }, 892 }, 893 //End Portfolio 894 895 896 //GetIEVersion 897 v_GetIEVersion: function () { 898 899 var undef, 900 v = 3, 901 div = document.createElement('div'), 902 all = div.getElementsByTagName('i'); 903 904 while ( 905 div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', 906 all[0] 907 ); 908 909 return v > 4 ? v : undef; 910 }, 911 //End GetIEVersion 912 913 914 //FitVids 915 v_FitVids: function () { 916 jQuery('.v-portfolio-items,.v-blog-items,article.type-portfolio,article.type-post,article.type-team,.v-video-widget,.infocus-item,.recent-posts,.full-width-detail').fitVids(); 917 }, 918 //End FitVids 919 920 921 //GetWindowHeight 922 v_GetWindowHeight: function () { 923 var height = "innerHeight" in window ? window.innerHeight : document.documentElement.offsetHeight; 924 return height; 925 }, 926 //End GetWindowHeight 927 }; 928 //End Core 929 930 931 var $window = jQuery(window), 932 body = jQuery('body'), 933 deviceAgent = navigator.userAgent.toLowerCase(), 934 isMobile = deviceAgent.match(/(iphone|ipod|android|iemobile)/), 935 isMobileAlt = deviceAgent.match(/(iphone|ipod|ipad|android|iemobile)/), 936 isAppleDevice = deviceAgent.match(/(iphone|ipod|ipad)/), 937 portfolioContainer = jQuery('.v-portfolio-wrap').find('.filterable-items'), 938 blogItems = jQuery('.v-blog-wrap').find('.v-blog-items'), 939 IEVersion = Core.v_GetIEVersion(), 940 windowheight = Core.v_GetWindowHeight(); 941 942 //$("body").queryLoader2({ 943 // percentage: true, 944 // onLoadComplete: Core.initialize() 945 //}).parent().css({ 'overflow': 'hidden' }); 946 947 //$("body").queryLoader2({ 948 // percentage: true, 949 // onLoadComplete: Core.initialize() 950 //}); 951 952 Core.initialize(); 953 954 955 $(window).load(function () { 956 jQuery('[rel=tooltip]').tooltip(); 957 958 $('.popover-dismiss').popover({ 959 trigger: 'focus' 960 }) 961 962 963 Core.v_FlexSlider.init(); 964 965 Core.v_Map.init(); 966 967 Core.v_FitVids(); 968 969 Core.v_ReloadFunctions.load(); 970 Core.v_ReloadFunctions.init(); 971 972 Core.v_FlexSlider.gallery(); 973 }); 974 975})(); 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003jQuery(document).ready(function($){ 1004 //set animation timing 1005 var animationDelay = 2500, 1006 //loading bar effect 1007 barAnimationDelay = 3800, 1008 barWaiting = barAnimationDelay - 3000, //3000 is the duration of the transition on the loading bar - set in the scss/css file 1009 //letters effect 1010 lettersDelay = 50, 1011 //type effect 1012 typeLettersDelay = 150, 1013 selectionDuration = 500, 1014 typeAnimationDelay = selectionDuration + 800, 1015 //clip effect 1016 revealDuration = 600, 1017 revealAnimationDelay = 1500; 1018 1019 initHeadline(); 1020 1021 1022 function initHeadline() { 1023 //insert <i> element for each letter of a changing word 1024 singleLetters($('.cd-headline.letters').find('b')); 1025 //initialise headline animation 1026 animateHeadline($('.cd-headline')); 1027 } 1028 1029 function singleLetters($words) { 1030 $words.each(function(){ 1031 var word = $(this),
1032 letters = word.text().split(''), 1033 selected = word.hasClass('is-visible'); 1034 for (i in letters) { 1035 if(word.parents('.rotate-2').length > 0) letters[i] = '<em>' + letters[i] + '</em>'; 1036 letters[i] = (selected) ? '<i class="in">' + letters[i] + '</i>': '<i>' + letters[i] + '</i>'; 1037 } 1038 var newLetters = letters.join(''); 1039 word.html(newLetters).css('opacity', 1); 1040 }); 1041 } 1042 1043 function animateHeadline($headlines) { 1044 var duration = animationDelay; 1045 $headlines.each(function(){ 1046 var headline = $(this); 1047 1048 if(headline.hasClass('loading-bar')) { 1049 duration = barAnimationDelay; 1050 setTimeout(function(){ headline.find('.cd-words-wrapper').addClass('is-loading') }, barWaiting); 1051 } else if (headline.hasClass('clip')){ 1052 var spanWrapper = headline.find('.cd-words-wrapper'), 1053 newWidth = spanWrapper.width() + 10 1054 spanWrapper.css('width', newWidth); 1055 } else if (!headline.hasClass('type') ) { 1056 //assign to .cd-words-wrapper the width of its longest word 1057 var words = headline.find('.cd-words-wrapper b'), 1058 width = 0; 1059 words.each(function(){ 1060 var wordWidth = $(this).width(); 1061 if (wordWidth > width) width = wordWidth; 1062 }); 1063 headline.find('.cd-words-wrapper').css('width', width); 1064 }; 1065 1066 //trigger animation 1067 setTimeout(function(){ hideWord( headline.find('.is-visible').eq(0) ) }, duration); 1068 }); 1069 } 1070 1071 function hideWord($word) { 1072 var nextWord = takeNext($word); 1073 1074 if($word.parents('.cd-headline').hasClass('type')) { 1075 var parentSpan = $word.parent('.cd-words-wrapper'); 1076 parentSpan.addClass('selected').removeClass('waiting'); 1077 setTimeout(function(){ 1078 parentSpan.removeClass('selected'); 1079 $word.removeClass('is-visible').addClass('is-hidden').children('i').removeClass('in').addClass('out'); 1080 }, selectionDuration); 1081 setTimeout(function(){ showWord(nextWord, typeLettersDelay) }, typeAnimationDelay); 1082 1083 } else if($word.parents('.cd-headline').hasClass('letters')) { 1084 var bool = ($word.children('i').length >= nextWord.children('i').length) ? true : false; 1085 hideLetter($word.find('i').eq(0), $word, bool, lettersDelay); 1086 showLetter(nextWord.find('i').eq(0), nextWord, bool, lettersDelay); 1087 1088 } else if($word.parents('.cd-headline').hasClass('clip')) { 1089 $word.parents('.cd-words-wrapper').animate({ width : '2px' }, revealDuration, function(){ 1090 switchWord($word, nextWord); 1091 showWord(nextWord); 1092 }); 1093 1094 } else if ($word.parents('.cd-headline').hasClass('loading-bar')){ 1095 $word.parents('.cd-words-wrapper').removeClass('is-loading'); 1096 switchWord($word, nextWord); 1097 setTimeout(function(){ hideWord(nextWord) }, barAnimationDelay); 1098 setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('is-loading') }, barWaiting); 1099 1100 } else { 1101 switchWord($word, nextWord); 1102 setTimeout(function(){ hideWord(nextWord) }, animationDelay); 1103 } 1104 } 1105 1106 function showWord($word, $duration) { 1107 if($word.parents('.cd-headline').hasClass('type')) { 1108 showLetter($word.find('i').eq(0), $word, false, $duration); 1109 $word.addClass('is-visible').removeClass('is-hidden'); 1110 1111 } else if($word.parents('.cd-headline').hasClass('clip')) { 1112 $word.parents('.cd-words-wrapper').animate({ 'width' : $word.width() + 10 }, revealDuration, function(){ 1113 setTimeout(function(){ hideWord($word) }, revealAnimationDelay); 1114 }); 1115 } 1116 } 1117 1118 function hideLetter($letter, $word, $bool, $duration) { 1119 $letter.removeClass('in').addClass('out'); 1120 1121 if(!$letter.is(':last-child')) { 1122 setTimeout(function(){ hideLetter($letter.next(), $word, $bool, $duration); }, $duration); 1123 } else if($bool) { 1124 setTimeout(function(){ hideWord(takeNext($word)) }, animationDelay); 1125 } 1126 1127 if($letter.is(':last-child') && $('html').hasClass('no-csstransitions')) { 1128 var nextWord = takeNext($word); 1129 switchWord($word, nextWord); 1130 } 1131 } 1132 1133 function showLetter($letter, $word, $bool, $duration) { 1134 $letter.addClass('in').removeClass('out'); 1135 1136 if(!$letter.is(':last-child')) { 1137 setTimeout(function(){ showLetter($letter.next(), $word, $bool, $duration); }, $duration); 1138 } else { 1139 if($word.parents('.cd-headline').hasClass('type')) { setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('waiting'); }, 200);} 1140 if(!$bool) { setTimeout(function(){ hideWord($word) }, animationDelay) } 1141 } 1142 } 1143 1144 function takeNext($word) { 1145 return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0); 1146 } 1147 1148 function takePrev($word) { 1149 return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last(
1149); 1150 } 1151 1152 function switchWord($oldWord, $newWord) { 1153 $oldWord.removeClass('is-visible').addClass('is-hidden'); 1154 $newWord.removeClass('is-hidden').addClass('is-visible'); 1155 } 1156}); 1157 1158 1159 1160//<!--Global site tag (gtag.js) - Google Analytics -- > 1161//
vendor: 67 bytes, line 1161
1161 <script async src="https://www.googletagmanager.com/gtag/js?id=
1161UA-127166265-1
vendor: 13 bytes, line 1161
1161"></script>
1162// <script> 1163// window.dataLayer = window.dataLayer || []; 1164// function gtag(){dataLayer.push(arguments);} 1165// gtag('js', new Date()); 1166 1167// gtag('config', 'UA-127166265-1'); 1168//</script> 1169 1170 1171// (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 1172// (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 1173// m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 1174// })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 1175 1176//ga('create', 'UA-127166265-1', 'auto'); 1177//ga('send', 'pageview');
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.