1(function($){ 2 3 "use strict"; 4 5 /* ---------------------------------------------- /* 6 * Preloader 7 /* ---------------------------------------------- */ 8 9 $(window).load(function() { 10 $('.loader').fadeOut(); 11 $('.page-loader').delay(350).fadeOut('slow'); 12 }); 13 14 $(document).ready(function() { 15 16 /* ---------------------------------------------- /* 17 * Initialization general scripts for all pages 18 /* ---------------------------------------------- */ 19 20 var moduleHero = $('#hero'), 21 overlayMenu = $('#overlay-menu'), 22 slider = $('#slides'), 23 navbar = $('.navbar-custom'), 24 filters = $('#filters'), 25 worksgrid = $('#works-grid'), 26 modules = $('.module-hero, .module, .module-small'), 27 windowWidth = Math.max($(window).width(), window.innerWidth), 28 navbatTrans, 29 mobileTest; 30 31 navbarCheck(navbar); 32 33 $(window).resize(function() { 34 buildModuleHero(); 35 windowWidth = Math.max($(window).width(), window.innerWidth); 36 }); 37 38 $(window).scroll(function() { 39 if(windowWidth > 960) { 40 navbarAnimation(navbar, moduleHero); 41 } 42 }).scroll(); 43 44 /* ---------------------------------------------- /* 45 * Mobile detect 46 /* ---------------------------------------------- */ 47 48 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 49 mobileTest = true; 50 } else { 51 mobileTest = false; 52 } 53 54 /* ---------------------------------------------- /* 55 * Intro slider setup 56 /* ---------------------------------------------- */ 57 58 $('#slides').superslides({ 59 play: 10000, 60 animation: 'fade',
61 animation_speed: 800, 62 pagination: true, 63 }); 64 65 /* ---------------------------------------------- /* 66 * Setting background of modules 67 /* ---------------------------------------------- */ 68 69 modules.each(function() { 70 if ($(this).attr('data-background')) { 71 $(this).css('background-image', 'url(' + $(this).attr('data-background') + ')'); 72 } 73 }); 74 75 /* ---------------------------------------------- /* 76 * Parallax 77 /* ---------------------------------------------- */ 78 79 if (mobileTest === true) { 80 $('.module-parallax').css({'background-attachment': 'scroll'}); 81 } else { 82 $('#hero.module-parallax').parallax('50%', 0.2); 83 } 84 85 /* ---------------------------------------------- /* 86 * Full height module 87 /* ---------------------------------------------- */ 88 89 function buildModuleHero() { 90 if (moduleHero.length > 0) { 91 if (moduleHero.hasClass('module-full-height')) { 92 moduleHero.height($(window).height()); 93 } else { 94 moduleHero.height($(window).height() * 0.85); 95 } 96 } 97 } 98 99 /* ---------------------------------------------- /* 100 * Youtube video background 101 /* ---------------------------------------------- */ 102 103 if(mobileTest != true) { 104 $(function() { 105 $(".video-player").mb_YTPlayer(); 106 }); 107 108 $('.video-controls-box a').css('visibility', 'visible'); 109 110 $('#video-play').click(function(event) { 111 event.preventDefault(); 112 if ($(this).hasClass('fa-play')) { 113 $('.video-player').playYTP(); 114 } else { 115 $('.video-player').pauseYTP(); 116 } 117 $(this).toggleClass('fa-play fa-pause'); 118 return false; 119 }); 120 121 $('#video-volume').click(function(event) { 122 event.preventDefault(); 123 $('.video-player').toggleVolume(); 124 $(this).toggleClass('fa-volume-off fa-volume-up'); 125 return false; 126 }); 127 } 128 /* ---------------------------------------------- /* 129 * Transparent navbar animation 130 /* ---------------------------------------------- */ 131 132 function navbarCheck() { 133 if (navbar.length > 0 && navbar.hasClass('navbar-transparent')) { 134 navbatTrans = true; 135 } else { 136 navbatTrans = false; 137 } 138 } 139 140 function navbarAnimation(navbar, moduleHero) { 141 var topScroll = $(window).scrollTop(); 142 if (navbar.length > 0 && navbatTrans !== false) { 143 if (topScroll >= 5) { 144 navbar.removeClass('navbar-transparent'); 145 } else { 146 navbar.addClass('navbar-transparent'); 147 } 148 } 149 } 150 151 /* ---------------------------------------------- /* 152 * Show/Hide overlay menu 153 /* ---------------------------------------------- */ 154 155 $('#toggle-menu').on('click', function() { 156 showMenu(); 157 $('body').addClass('aux-navigation-active'); 158 return false; 159 }); 160 161 $('#overlay-menu-hide').on('click', function() { 162 hideMenu(); 163 $('body').removeClass('aux-navigation-active'); 164 return false; 165 }); 166 167 $(window).keydown(function(e) { 168 if (overlayMenu.hasClass('active')) { 169 if (e.which === 27) { 170 hideMenu(); 171 } 172 } 173 }); 174 175 function showMenu() { 176 navbar.animate({'opacity': 0, 'top': -80}, { 177 duration: 150, 178 easing: 'easeInOutQuart' 179 }); 180 181 overlayMenu.addClass('active'); 182 } 183 184 function hideMenu() { 185 navbar.animate({'opacity': 1, 'top': 0}, { 186 duration: 150, 187 easing: 'easeInOutQuart' 188 }); 189 190 overlayMenu.removeClass('active'); 191 } 192 193 /* ---------------------------------------------- /* 194 * Overlay dropdown menu 195 /* ---------------------------------------------- */ 196 197 $('#nav > li.slidedown > a').on('click', function() { 198 if ($(this).attr('class') != 'active') { 199 $('#nav li ul').slideUp({duration: 300, easing: 'easeInOutQuart'}); 200 $('#nav li a').removeClass('active'); 201 $(this).next().slideToggle({duration: 300, easing: 'easeInOutQuart'}).addClass('open'); 202 $(this).addClass('active'); 203 } else { 204 $('#nav li ul').slideUp({duration: 300, easing: 'easeInOutQuart'}).removeClass('open'); 205 $(this).removeClass('active'); 206 } 207 return false; 208 }); 209 210 /* ---------------------------------------------- /* 211 * Portfolio 212 /* ---------------------------------------------- */ 213 214 $('a', filters).on('click', function() { 215 var selector = $(this).attr('data-filter'); 216 217 $('.current', filters).removeClass('current'); 218 $(this).addClass('current'); 219 220 worksgrid.isotope({ 221 filter: selector 222 }); 223 224 return false; 225 }); 226 227 $(window).on('resize', function() { 228 229 var windowWidth = Math.max($(window).width(), window.innerWidth), 230 itemWidht = $('.grid-sizer').width(), 231 itemHeight = Math.floor(itemWidht * 0.95), 232 itemTallHeight = itemHeight * 2; 233 234 if (windowWidth > 500) { 235 $('.work-item', worksgrid).each(function() { 236 if ($(this).hasClass('tall')) { 237 $(this).css({ 238 height : itemTallHeight 239 });
240 } else if ($(this).hasClass('wide')) { 241 $(this).css({ 242 height : itemHeight 243 }); 244 } else if ($(this).hasClass('wide-tall')) { 245 $(this).css({ 246 height : itemTallHeight 247 }); 248 } else { 249 $(this).css({ 250 height : itemHeight 251 }); 252 } 253 }); 254 } else { 255 $('.work-item', worksgrid).each(function() { 256 if ($(this).hasClass('tall')) { 257 $(this).css({ 258 height : itemTallHeight 259 }); 260 } else if ($(this).hasClass('wide')) { 261 $(this).css({ 262 height : itemHeight / 2 263 }); 264 } else if ($(this).hasClass('wide-tall')) { 265 $(this).css({ 266 height : itemHeight 267 }); 268 } else { 269 $(this).css({ 270 height : itemHeight 271 }); 272 } 273 }); 274 } 275 276 worksgrid.imagesLoaded(function() { 277 worksgrid.isotope({ 278 layoutMode: 'packery', 279 itemSelector: '.work-item', 280 transitionDuration: '0.3s', 281 packery: { 282 columnWidth: '.grid-sizer', 283 }, 284 }); 285 }); 286 287 }).resize(); 288 289 /* ---------------------------------------------- /* 290 * Blog grid 291 /* ---------------------------------------------- */ 292 293 $('#posts-masonry').imagesLoaded(function() { 294 $('#posts-masonry').isotope({ 295 layoutMode: 'masonry', 296 transitionDuration: '0.3s' 297 }); 298 }); 299 300 /* ---------------------------------------------- /* 301 * Google Map 302 /* ---------------------------------------------- */ 303 304 var mapLocation = new google.maps.LatLng(34.031428,-118.2071542,17); 305 306 var $mapis = $('#map'); 307 308 if ($mapis.length > 0) { 309 310 var map; 311 map = new GMaps({ 312 streetViewControl : true, 313 overviewMapControl: true, 314 mapTypeControl: true, 315 zoomControl : true, 316 panControl : true, 317 scrollwheel: false, 318 center: mapLocation, 319 el: '#map', 320 zoom: 16, 321 styles: [{"featureType":"all","elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":40}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#000000"},{"lightness":16}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":17}]}] 322 }); 323 324 var image = new google.maps.MarkerImage('assets/images/map-icon.png', 325 new google.maps.Size(59, 65), 326 new google.maps.Point(0, 0), 327 new google.maps.Point(24, 42) 328 ); 329 330 map.addMarker({ 331 position: mapLocation, 332 icon: image, 333 title: 'Vortex', 334 infoWindow: { 335 content: '<p><strong>Vortex</strong><br/>121 Somewhere Ave, Suite 123<br/>P: (123) 456-7890<br/>Australia</p>' 336 } 337 }); 338 339 } 340 341 /* ---------------------------------------------- /* 342 * Ajax options 343 /* ---------------------------------------------- */ 344 345 var pageNumber = 0, 346 workNumberToload = 5; 347 348 var doneText = 'Done', 349 loadText = 'More works', 350 loadingText = 'Loading...', 351 errorText = 'Error! Check the console for more information.'; 352 353 /* ---------------------------------------------- /* 354 * Ajax portfolio 355 /* ---------------------------------------------- */ 356 357 $('#show-more').on('click', function() { 358 $(this).text(loadingText); 359 360 setTimeout(function() { 361 ajaxLoad(workNumberToload, pageNumber); 362 }, 300); 363 364 pageNumber++; 365 366 return false; 367 }); 368 369 function ajaxLoad(workNumberToload, pageNumber) { 370 var $loadButton = $('#show-more'); 371 var dataString = 'numPosts=' + workNumberToload + '&pageNumber=' + pageNumber; 372 373 $.ajax({
374 type: 'GET', 375 data: dataString, 376 dataType: 'html', 377 url: 'assets/php/ajax-load-more/ajax-load-more.php', 378 success: function(data) { 379 var $data = $(data); 380 var start_index = (pageNumber - 1) * workNumberToload; 381 var end_index = + start_index + workNumberToload; 382 383 if ($data.find('.work-item').slice(start_index).length) { 384 var work = $data.find('.work-item').slice(start_index, end_index); 385 386 worksgrid.append(work).isotope('appended', work).resize(); 387 388 setTimeout(function() { 389 $loadButton.text(loadText); 390 }, 300); 391 392 $('a.gallery').magnificPopup({ 393 type: 'image', 394 gallery: { 395 enabled: true, 396 navigateByImgClick: true, 397 preload: [0,1] 398 }, 399 image: { 400 titleSrc: 'title', 401 tError: 'The image could not be loaded.', 402 } 403 }); 404 405 } else { 406 setTimeout(function() { 407 $loadButton.text(doneText); 408 }, 300); 409 410 setTimeout(function () { 411 $('#show-more').animate({ 412 opacity: 0, 413 }).css('display', 'none'); 414 }, 1500); 415 416 $('a.gallery').magnificPopup({ 417 type: 'image', 418 gallery: { 419 enabled: true, 420 navigateByImgClick: true, 421 preload: [0,1] 422 }, 423 image: { 424 titleSrc: 'title', 425 tError: 'The image could not be loaded.', 426 } 427 }); 428 } 429 }, 430 431 error: function (jqXHR, textStatus, errorThrown) { 432 console.log(jqXHR + " :: " + textStatus + " :: " + errorThrown); 433 434 setTimeout(function() { 435 $loadButton.removeClass('ss-loading'); 436 $loadButton.text(errorText); 437 }, 300); 438 439 } 440 }); 441 } 442 443 /* ---------------------------------------------- /* 444 * Rotate 445 /* ---------------------------------------------- */ 446 447 $(".rotate").textrotator({ 448 animation: "dissolve", 449 separator: "|", 450 speed: 3000 451 }); 452 453 /* ---------------------------------------------- /* 454 * Owl sliders 455 /* ---------------------------------------------- */ 456 457 $('.slider-testimonials').owlCarousel({ 458 stopOnHover: !0, 459 singleItem: !0, 460 autoHeight: !0, 461 slideSpeed: 400, 462 paginationSpeed: 1000, 463 goToFirstSpeed: 2000, 464 autoPlay: 3000, 465 navigationText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'], 466 }); 467 468 $('.slider-images').owlCarousel({ 469 stopOnHover: !0, 470 singleItem: !0, 471 autoHeight: !0, 472 navigation: !0, 473 slideSpeed: 400, 474 paginationSpeed: 1000, 475 goToFirstSpeed: 2000, 476 autoPlay: 3000, 477 transitionStyle : "fade", 478 navigationText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'], 479 }); 480 481 /* ---------------------------------------------- /* 482 * Video popup, Gallery 483 /* ---------------------------------------------- */ 484 485 $('.video-pop-up').magnificPopup({ 486 type: 'iframe', 487 }); 488 489 $('a.gallery').magnificPopup({ 490 type: 'image', 491 gallery: { 492 enabled: true, 493 navigateByImgClick: true, 494 preload: [0,1] 495 }, 496 image: { 497 titleSrc: 'title', 498 tError: 'The image could not be loaded.', 499 } 500 }); 501 502 /* ---------------------------------------------- /* 503 * Progress bars, counters animations 504 /* ---------------------------------------------- */ 505 506 $('.progress-bar').each(function(i) { 507 $(this).appear(function() { 508 var percent = $(this).attr('aria-valuenow'); 509 $(this).animate({'width' : percent + '%'}); 510 $(this).find('span').animate({'opacity' : 1}, 900); 511 $(this).find('span').countTo({from: 0, to: percent, speed: 900, refreshInterval: 30}); 512 }); 513 }); 514 515 $('.counter-item').each(function(i) { 516 $(this).appear(function() { 517 var number = $(this).find('.counter-number').data('number'); 518 $(this).find('.counter-number span').countTo({from: 0, to: number, speed: 1200, refreshInterval: 30}); 519 }); 520 }); 521 522 /* ---------------------------------------------- /* 523 * WOW Animation 524 /* ---------------------------------------------- */ 525 526 var wow = new WOW({ 527 mobile: false 528 }); 529 530 wow.init(); 531 532 /* ---------------------------------------------- /* 533 * A jQuery plugin for fluid width video embeds 534 /* ---------------------------------------------- */ 535 536 $('body').fitVids(); 537 538 /* ---------------------------------------------- /* 539 * Scroll Animation 540 /* ---------------------------------------------- */ 541 542 $('.section-scroll').bind('click', function(e) { 543 var anchor = $(this); 544 545 $('html, body').stop().animate({ 546 scrollTop: $(anchor.attr('href')).offset().top 547 }, 1000); 548 549 e.preventDefault(); 550 }); 551 552 /* ---------------------------------------------- /* 553 * Scroll top 554 /* ---------------------------------------------- */ 555 556 $(window).scroll(function() { 557 if ($(this).scrollTop() > 100) { 558 $('.scroll-up').fadeIn(); 559 } else { 560 $('.scroll-up').fadeOut(); 561 } 562 }); 563 564 $('a[href="#totop"]').click(function() { 565 $('html, body').animate({ scrollTop: 0 }, 'slow'); 566 return false; 567 }); 568 569 }); 570 571})(jQuery); 572 573jQuery(document).ready(function($){ 574 var timelineBlocks = $('.cd-timeline-block'), 575 offset = 0.8; 576 577 //hide timeline blocks which are outside the viewport 578 hideBlocks(timelineBlocks, offset); 579 580 //on scolling, show/animate timeline blocks when enter the viewport 581 $(window).on('scroll', function(){ 582 (!window.requestAnimationFrame) 583 ? setTimeout(function(){ showBlocks(timelineBlocks, offset); }, 100) 584 : window.requestAnimationFrame(function(){ showBlocks(timelineBlocks, offset); }); 585 }); 586 587 function hideBlocks(blocks, offset) { 588 blocks.each(function(){ 589 ( $(this).offset().top > $(window).scrollTop()+$(window).height()*offset ) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden'); 590 }); 591 } 592 593 function showBlocks(blocks, offset) { 594 blocks.each(function(){ 595 ( $(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'); 596 }); 597 } 598}); 599 600$(function(){ 601 $(window).scroll(function(){ 602 $('.year').each(function(){ 603 var year = $(this).find('h2').first().text(); 604 if($(this).offset().top < $(document).scrollTop() +100){ 605 $(this).find('.date').addClass('activeYear'); 606 $('#dataYear').html(year); 607 }else{ 608 $(this).find('.date').removeClass('activeYear'); 609 } 610 });
611 }); 612}); 613$(document).ready(function(){ 614 var year = $('.year').find('cd-timeline-img').first().text(); 615 $('#dataYear').html(year); 616 $('.year').first().find('.date').addClass('activeYear'); 617}); 618 619// Elements Animation 620 if($('.wow').length){ 621 var wow = new WOW( 622 { 623 boxClass: 'wow', // animated element css class (default is wow) 624 animateClass: 'animated', // animation css class (default is animated) 625 offset: 0, // distance to the element when triggering the animation (default is 0) 626 mobile: true, // trigger animations on mobile devices (default is true) 627 live: true // act on asynchronously loaded content (default is true) 628 } 629 ); 630 wow.init(); 631 }
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.