├── .gitattributes ├── .DS_Store ├── images ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png └── 8.png ├── admin ├── .DS_Store └── base.png ├── README.md ├── index.html └── js ├── scripts.js ├── jquery.smoothState.js ├── page-transitions.js └── jquery.min.js /.gitattributes: -------------------------------------------------------------------------------- 1 | *.md linguist-language=js 2 | *.html linguist-language=js 3 | *.css linguist-language=css -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/.DS_Store -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/1.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/4.png -------------------------------------------------------------------------------- /images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/5.png -------------------------------------------------------------------------------- /images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/6.png -------------------------------------------------------------------------------- /images/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/7.png -------------------------------------------------------------------------------- /images/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/images/8.png -------------------------------------------------------------------------------- /admin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/admin/.DS_Store -------------------------------------------------------------------------------- /admin/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/mouse-hover-animation-with-images-jquery/HEAD/admin/base.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Mouse Hover Animation with images | Crimson 4 | 5 | 6 | 7 | ### by SUBUX 8 | 9 |
-------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mouse Hover Animation with images | Crimson 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 |
25 |
26 | 27 | 34 | 35 |
36 | 41 |
42 | 43 |
44 |
45 | 46 |

03/Emperor

47 | 48 |
49 |
50 | 51 |
52 | 57 |
58 | 59 |
60 | 65 |
66 | 67 |
68 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 |
86 | 87 |
88 |
89 | Colova Portfolio Image 90 |
91 |
92 | 93 |
94 |
95 | Colova Portfolio Image 96 |
97 |
98 | 99 |
100 |
101 | Colova Portfolio Image 102 |
103 |
104 | 105 |
106 |
107 | Colova Portfolio Image 108 |
109 |
110 | 111 |
112 |
113 | Colova Portfolio Image 114 |
115 | 116 |
117 | 118 |
119 |
120 | Colova Portfolio Image 121 |
122 |
123 | 124 |
125 |
126 | Colova Portfolio Image 127 |
128 |
129 | 130 |
131 | 132 |
133 | 134 |
135 | 136 |
137 | 138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /js/scripts.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | "use strict"; 3 | 4 | $(window).on('load', function () { 5 | 6 | 7 | ////////// Site Menu Start ////////// 8 | if ($('.navigation-fs').length > 0) { 9 | 10 | var navHeight = $('.main-navigation').outerHeight(); 11 | 12 | $('.fs-widget-wrapper').css({ 13 | height: navHeight + 'px' 14 | 15 | }); 16 | 17 | $('.fs-menu-toggle').on('click', function () { 18 | 19 | var clicks = $(this).data('clicks'); 20 | if (clicks) { 21 | 22 | $(this).removeClass('is-active'); 23 | $('.menu-item a').each(function (i, element) { 24 | $(element).delay(i * 120).queue(function (next) { 25 | $(this).removeClass('menu-item-comes'); 26 | var beforeLi = $(this).parent('.menu-item'); 27 | beforeLi.removeClass('index-come'); 28 | next(); 29 | }); 30 | }) 31 | 32 | $('.fs-seperator').removeClass('fs-seperator-in'); 33 | $('.fs-widget').removeClass('fs-widget-in'); 34 | 35 | setTimeout(function () { 36 | $('.fs-menu-found').removeClass('found-comes'); 37 | 38 | }, 400); 39 | 40 | } else { 41 | $(this).addClass('is-active'); 42 | 43 | $('.fs-menu-found').addClass('found-comes'); 44 | 45 | 46 | setTimeout(function () { 47 | $('.fs-seperator').addClass('fs-seperator-in'); 48 | $('.fs-widget').addClass('fs-widget-in'); 49 | $('.menu-item a').each(function (i, element) { 50 | $(element).delay(i * 150).queue(function (next) { 51 | $(this).addClass('menu-item-comes'); 52 | var beforeLi = $(this).parent('.menu-item'); 53 | 54 | setTimeout(function () { 55 | beforeLi.addClass('index-come'); 56 | 57 | }, 200); 58 | 59 | next(); 60 | }); 61 | 62 | 63 | }); 64 | 65 | }, 200); 66 | 67 | 68 | } 69 | $(this).data("clicks", !clicks); 70 | 71 | $('.navigation-fs .menu-item a').on('click', function () { 72 | 73 | 74 | $('.menu-item a').each(function (i, element) { 75 | $(element).delay(i * 120).queue(function (next) { 76 | $(this).removeClass('menu-item-comes'); 77 | var beforeLi = $(this).parent('.menu-item'); 78 | beforeLi.removeClass('index-come'); 79 | next(); 80 | }); 81 | }) 82 | 83 | $('.fs-seperator').removeClass('fs-seperator-in'); 84 | $('.fs-widget').removeClass('fs-widget-in'); 85 | 86 | setTimeout(function () { 87 | $('.page-trans-overlay').addClass('overlay-visible'); 88 | 89 | }, 400); 90 | 91 | $('.fs-menu-toggle').data('clicks', false) 92 | }); 93 | 94 | }); 95 | 96 | }; 97 | 98 | if ($(window).width() < 850) { 99 | 100 | $('.site-navigation').removeClass('navigation-classic'); 101 | $('.site-navigation').addClass('navigation-fs'); 102 | 103 | } 104 | 105 | ////////// Site Menu End /////////// 106 | 107 | ////////// C Embed Video Start /////////// 108 | if ($('.c-video').length > 0) { 109 | 110 | const cVideo = new Plyr('.c-video', { 111 | controls: ["play-large", 112 | "play", 113 | "progress", 114 | "duration", 115 | "mute", 116 | "volume", 117 | "fullscreen" 118 | ], 119 | autoplay: true, 120 | muted: true, 121 | volume: 0, 122 | quality: { 123 | default: 1080 124 | }, 125 | loop: { 126 | active: true 127 | }, 128 | 129 | }); 130 | 131 | $('.c-video-play').on('click', function () { 132 | $(this).fadeOut(500); 133 | $('.c-video-overlay').fadeOut(500); 134 | $('.plyr__controls').addClass('controls-in'); 135 | cVideo.restart(); 136 | cVideo.increaseVolume(1); 137 | 138 | }); 139 | 140 | window.cVideo = cVideo; 141 | 142 | }; 143 | 144 | if ($('.c-video-style-2').length > 0) { 145 | 146 | const cVideo2 = new Plyr('.c-video-style-2', { 147 | controls: ["play-large", 148 | "play", 149 | "progress", 150 | "duration", 151 | "mute", 152 | "volume", 153 | "fullscreen" 154 | ], 155 | 156 | }); 157 | 158 | 159 | $('.icon-play').on('click', function () { 160 | 161 | var videoPlay = $(this).parent('.video-control'); 162 | videoPlay.addClass('controls-gone'); 163 | cVideo2.play(); 164 | cVideo2.increaseVolume(1); 165 | }); 166 | 167 | window.cVideo2 = cVideo2; 168 | 169 | }; 170 | ////////// C Embed Video End /////////// 171 | 172 | ////////// Carousel Start ////////// 173 | if ($('.cp-titles').length > 0) { 174 | 175 | var colovaCarousel = new Swiper('.cp-titles', { 176 | slidesPerView: 'auto', 177 | mousewheel: { 178 | invert: false, 179 | 180 | }, 181 | centeredSlides: true, 182 | speed: 1500, 183 | touchRatio: 5, 184 | 185 | }); 186 | 187 | var fsColor = $('.swiper-slide-active').data('color'); 188 | 189 | $('.fullscreen, .portfolio-trans-overlay').css({ 190 | background: fsColor 191 | }); 192 | 193 | var backTitles = $('.cp-titles .swiper-wrapper').clone(); 194 | $('.back-titles').html(backTitles); 195 | 196 | var backTitles = new Swiper('.back-titles', { 197 | slidesPerView: 'auto', 198 | mousewheel: { 199 | invert: false, 200 | 201 | }, 202 | grabCursor: true, 203 | centeredSlides: true, 204 | speed: 1500, 205 | 206 | }); 207 | 208 | colovaCarousel.on('slideChangeTransitionStart', function () { 209 | 210 | var bgColor = $('.swiper-slide-active').data('color'); 211 | $('.fullscreen, .portfolio-trans-overlay').css({ 212 | background: bgColor 213 | }); 214 | 215 | 216 | }); 217 | 218 | 219 | var interleaveOffset = 0.5; 220 | 221 | var imagesSwiper = new Swiper('.images-swiper', { 222 | parallax: true, 223 | mousewheel: { 224 | invert: false, 225 | 226 | }, 227 | watchSlidesProgress: true, 228 | on: { 229 | progress: function () { 230 | let swiper = this; 231 | for (let i = 0; i < swiper.slides.length; i++) { 232 | let slideProgress = swiper.slides[i].progress, 233 | innerOffset = swiper.width * interleaveOffset, 234 | innerTranslate = slideProgress * innerOffset; 235 | 236 | swiper.slides[i].querySelector(".slide-bgimg").style.transform = 237 | "translateX(" + innerTranslate + "px)"; 238 | 239 | 240 | } 241 | }, 242 | setTransition: function (speed) { 243 | let swiper = this; 244 | for (let i = 0; i < swiper.slides.length; i++) { 245 | swiper.slides[i].style.transition = speed + "ms"; 246 | swiper.slides[i].querySelector(".slide-bgimg").style.transition = 247 | speed + "ms"; 248 | } 249 | } 250 | } 251 | 252 | }); 253 | 254 | 255 | colovaCarousel.controller.control = imagesSwiper; 256 | backTitles.controller.control = imagesSwiper; 257 | colovaCarousel.controller.control = backTitles; 258 | 259 | colovaCarousel.on('touchStart', function () { 260 | 261 | $('.cp-titles').addClass('cp-titles-touch'); 262 | 263 | }); 264 | 265 | colovaCarousel.on('touchEnd', function () { 266 | 267 | $('.cp-titles').removeClass('cp-titles-touch'); 268 | 269 | }); 270 | 271 | $('.discover-p-link').on('mouseenter', function () { 272 | 273 | $('.cp-titles').addClass('cp-toggle'); 274 | 275 | }); 276 | 277 | $('.discover-p-link').on('mouseleave', function () { 278 | 279 | $('.cp-titles').removeClass('cp-toggle'); 280 | 281 | }); 282 | 283 | 284 | }; 285 | ////////// Carousel End ////////// 286 | 287 | ////////// Vertical Start ////////// 288 | if ($('.cv-titles').length > 0) { 289 | 290 | var interleaveOffset = 0.5; 291 | 292 | var cvImagesSwiper = new Swiper('.cv-images-swiper', { 293 | slidesPerView: 1, 294 | parallax: true, 295 | mousewheel: { 296 | invert: false, 297 | 298 | }, 299 | watchSlidesProgress: true, 300 | on: { 301 | progress: function () { 302 | let swiper = this; 303 | for (let i = 0; i < swiper.slides.length; i++) { 304 | let slideProgress = swiper.slides[i].progress, 305 | innerOffset = swiper.width * interleaveOffset, 306 | innerTranslate = slideProgress * innerOffset; 307 | 308 | swiper.slides[i].querySelector(".slide-bgimg").style.transform = 309 | "translateX(" + innerTranslate + "px)"; 310 | 311 | 312 | } 313 | }, 314 | setTransition: function (speed) { 315 | let swiper = this; 316 | for (let i = 0; i < swiper.slides.length; i++) { 317 | swiper.slides[i].style.transition = speed + "ms"; 318 | swiper.slides[i].querySelector(".slide-bgimg").style.transition = 319 | speed + "ms"; 320 | } 321 | } 322 | } 323 | 324 | }); 325 | 326 | 327 | 328 | var cvTitles = new Swiper('.cv-titles', { 329 | slidesPerView: 1, 330 | mousewheel: { 331 | invert: false, 332 | 333 | }, 334 | centeredSlides: true, 335 | speed: 1000, 336 | effect: 'fade', 337 | fadeEffect: { 338 | crossFade: true 339 | }, 340 | autoplay: true, 341 | navigation: { 342 | nextEl: '.cv-slide-next', 343 | prevEl: '.cv-slide-prev', 344 | }, 345 | pagination: { 346 | el: '.cv-slide-fraction', 347 | type: 'fraction', 348 | renderFraction: function (currentClass, totalClass) { 349 | return '' + '/' + 350 | ''; 351 | }, 352 | 353 | }, 354 | }); 355 | 356 | cvTitles.controller.control = cvImagesSwiper; 357 | 358 | var cbColor = $('.swiper-slide-active').data('color'); 359 | 360 | $('.cv-images-back, .portfolio-trans-overlay').css({ 361 | backgroundColor: cbColor 362 | }); 363 | 364 | $('.cv-title, .cv-summary, .cv-discover, .cv-slide-pagination i , .cv-slide-fraction span').css({ 365 | color: cbColor 366 | }); 367 | 368 | cvTitles.on('slideChangeTransitionStart', function () { 369 | 370 | var cbColor = $('.swiper-slide-active').data('color'); 371 | $('.cv-images-back, .portfolio-trans-overlay').css({ 372 | background: cbColor 373 | }); 374 | 375 | setTimeout(function () { 376 | 377 | $('.cv-title, .cv-summary, .cv-discover, .cv-slide-pagination i , .cv-slide-fraction span').css({ 378 | color: cbColor 379 | }) 380 | }, 200) 381 | 382 | }); 383 | 384 | 385 | 386 | 387 | 388 | }; 389 | ////////// Vertical End ////////// 390 | 391 | ////////// Fullscreen Start ////////// 392 | if ($('.cf-titles').length > 0) { 393 | 394 | var cfTitles = new Swiper('.cf-titles', { 395 | slidesPerView: 'auto', 396 | mousewheel: { 397 | invert: false, 398 | 399 | }, 400 | centeredSlides: true, 401 | speed: 1300, 402 | direction: 'vertical', 403 | touchRatio: 0.1, 404 | autoplay: true 405 | 406 | }); 407 | 408 | 409 | var fsColor = $('.swiper-slide-active').data('color'); 410 | 411 | $('.fullscreen, .portfolio-trans-overlay').css({ 412 | background: fsColor 413 | }); 414 | 415 | cfTitles.on('slideChangeTransitionStart', function () { 416 | 417 | var bgColor = $('.swiper-slide-active').data('color'); 418 | $('.fullscreen, .portfolio-trans-overlay').css({ 419 | background: bgColor 420 | }); 421 | 422 | 423 | }); 424 | 425 | 426 | var interleaveOffset = 0.3; 427 | 428 | var cfImagesSwiper = new Swiper('.cf-images-swiper', { 429 | slidesPerView: 'auto', 430 | parallax: true, 431 | mousewheel: { 432 | invert: false, 433 | 434 | }, 435 | direction: 'vertical', 436 | watchSlidesProgress: true, 437 | speed: 1300, 438 | 439 | on: { 440 | progress: function () { 441 | let swiper = this; 442 | for (let i = 0; i < swiper.slides.length; i++) { 443 | let slideProgress = swiper.slides[i].progress, 444 | innerOffset = swiper.width * interleaveOffset, 445 | innerTranslate = slideProgress * innerOffset; 446 | 447 | swiper.slides[i].querySelector(".slide-bgimg").style.transform = 448 | "translateY(" + innerTranslate + "px)"; 449 | 450 | 451 | } 452 | }, 453 | setTransition: function (speed) { 454 | let swiper = this; 455 | for (let i = 0; i < swiper.slides.length; i++) { 456 | swiper.slides[i].style.transition = speed + "ms"; 457 | swiper.slides[i].querySelector(".slide-bgimg").style.transition = 458 | speed + "ms"; 459 | } 460 | } 461 | } 462 | 463 | }); 464 | 465 | 466 | 467 | cfTitles.controller.control = cfImagesSwiper; 468 | 469 | 470 | 471 | 472 | }; 473 | ////////// Fullscreen End ////////// 474 | 475 | ////////// List Start ////////// 476 | if ($('.cl-portfolios').length > 0) { 477 | 478 | var bgColor = $('.cl-portfolio').data('color'); 479 | $('.fullscreen, .portfolio-trans-overlay').css({ 480 | background: bgColor 481 | }); 482 | 483 | $('.cl-title-h1').on('mouseenter', function () { 484 | 485 | var clTitle = $(this).parents('.cl-title'); 486 | 487 | var clPort = clTitle.parents('.cl-portfolio'); 488 | 489 | var bgColor = clPort.data('color'); 490 | 491 | $('.fullscreen, .portfolio-trans-overlay').css({ 492 | background: bgColor 493 | }); 494 | 495 | 496 | 497 | }); 498 | 499 | $('.cl-title-h1').on('mouseenter', function () { 500 | 501 | var clTitle = $(this).parents('.cl-title'); 502 | 503 | var clPort = clTitle.parents('.cl-portfolio'); 504 | 505 | var sImage = clPort.data('image'); 506 | 507 | $('.cl-image-base').removeClass('cl-image-active'); 508 | $(sImage).addClass('cl-image-active'); 509 | 510 | }); 511 | 512 | $('.cl-title-h1').on('mouseleave', function () { 513 | $('.cl-image-base').removeClass('cl-image-active'); 514 | 515 | }); 516 | 517 | 518 | 519 | var Scrollbar = window.Scrollbar; 520 | 521 | Scrollbar.init(document.querySelector('.cl-portfolios')); 522 | 523 | } 524 | ////////// List End ////////// 525 | 526 | ////////// Title Wall Start ////////// 527 | if ($('.ct-portfolio').length > 0) { 528 | 529 | var bgColor = $('.ct-portfolio:first-child').data('color'); 530 | $('.fullscreen, .portfolio-trans-overlay').css({ 531 | background: bgColor 532 | }); 533 | 534 | $('.ct-portfolio a').on('mouseenter', function () { 535 | 536 | var activeParent = $(this).parents('.ct-portfolio'); 537 | 538 | var bgColor = activeParent.data('color'); 539 | 540 | $('.fullscreen, .portfolio-trans-overlay').css({ 541 | background: bgColor 542 | }); 543 | 544 | var sImage = activeParent.data('image'); 545 | var wrapper = $('.' + sImage).children('.ct-image-wrapper'); 546 | 547 | $(wrapper).addClass('ct-wrapper-height'); 548 | 549 | }); 550 | 551 | 552 | $('.ct-portfolio').on('mouseleave', function () { 553 | 554 | $('.ct-image-wrapper').removeClass('ct-wrapper-height'); 555 | 556 | }); 557 | 558 | $(document).on('mousemove', function (e) { 559 | $('.ct-images').css({ 560 | left: e.pageX + 20, 561 | top: e.pageY + 20 562 | }); 563 | }); 564 | 565 | 566 | 567 | }; 568 | ////////// Title Wall End ////////// 569 | 570 | ////////// List V2 Start ////////// 571 | if ($('.cl2-portfolio').length > 0) { 572 | 573 | var bgColor = $('.cl2-portfolio:first-child').data('color'); 574 | $('.fullscreen, .portfolio-trans-overlay').css({ 575 | background: bgColor 576 | }); 577 | 578 | $('.cl2-portfolio').on('mouseenter', function () { 579 | var bgColor = $(this).data('color'); 580 | 581 | $('.fullscreen, .portfolio-trans-overlay').css({ 582 | background: bgColor 583 | }); 584 | 585 | 586 | 587 | }); 588 | 589 | $('.cl2-title-h1').each(function () { 590 | var dataHover = $(this).text(); 591 | $(this).attr('data-hover', dataHover); 592 | 593 | }); 594 | 595 | $('.cl2-portfolio:first-child').addClass('cl2-portfolio-first'); 596 | 597 | $('.cl2-image-base:first-child').addClass('cl2-wrapper-height'); 598 | 599 | 600 | $('.cl2-portfolio').on('mouseenter', function () { 601 | 602 | $('.cl2-image-base').removeClass('cl2-wrapper-height'); 603 | 604 | 605 | $('.cl2-portfolio').removeClass('cl2-portfolio-first'); 606 | 607 | var sImage = $(this).data('image'); 608 | 609 | $(this).addClass('cl2-portfolio-first'); 610 | 611 | $(sImage).addClass('cl2-wrapper-height'); 612 | 613 | }); 614 | 615 | 616 | }; 617 | ////////// List V2 End ////////// 618 | 619 | ////////// Image Carousel Start ////////// 620 | if ($('.c-image-carousel').length > 0) { 621 | 622 | var cImageCarousel = new Swiper('.c-image-carousel', { 623 | slidesPerView: 'auto', 624 | spaceBetween: 30, 625 | 626 | grabCursor: true, 627 | breakpoints: { 628 | 850: { 629 | slidesPerView: 1, 630 | allowTouchMove: true, 631 | 632 | } 633 | 634 | }, 635 | 636 | 637 | }); 638 | 639 | 640 | }; 641 | ////////// Image Carousel End ////////// 642 | 643 | ////////// Parallax Image Start ////////// 644 | if ($('.c-parallax-image').length > 0) { 645 | var hasParallax = $('.c-parallax-image img'); 646 | 647 | hasParallax.addClass('has-parallax-image'); 648 | 649 | var cParallaxImage = document.getElementsByClassName('has-parallax-image'); 650 | new simpleParallax(cParallaxImage, { 651 | overflow: false, 652 | delay: 2, 653 | scale: 1.3 654 | }); 655 | 656 | 657 | }; 658 | ////////// Parallax Image End ////////// 659 | 660 | ////////// Image Lightbox Start ////////// 661 | if ($('.c-image-lightbox').length > 0) { 662 | $('.c-image-lightbox').magnificPopup({ 663 | delegate: 'img', // child items selector, by clicking on it popup will open 664 | type: 'image', 665 | closeOnContentClick: true, 666 | closeBtnInside: false, 667 | mainClass: 'image-lightbox', // class to remove default margin from left and right side 668 | image: { 669 | verticalFit: true 670 | }, 671 | zoom: { 672 | enabled: true, 673 | duration: 300 // don't foget to change the duration also in CSS 674 | }, 675 | 676 | // other options 677 | }); 678 | } 679 | ////////// Image Lightbox End ////////// 680 | 681 | 682 | $('.colova-project-button').on('click', function () { 683 | 684 | var targetProject = $(this).parents('.cf-title-slide'); 685 | var clickedTitle = $('.cf-title-slide').find('.colova-project-title'); 686 | 687 | window.clickedTitle = clickedTitle; 688 | if ($('.cf-titles').length > 0) { 689 | cfTitles.autoplay.stop(); 690 | } 691 | 692 | if ($('.cv-titles').length > 0) { 693 | cvTitles.autoplay.stop(); 694 | } 695 | }); 696 | 697 | 698 | $('.colova-portfolio-title').on('click', function () { 699 | 700 | var clickedTitle = $(this); 701 | window.clickedTitle = clickedTitle; 702 | }); 703 | 704 | }); 705 | })(jQuery); 706 | -------------------------------------------------------------------------------- /js/jquery.smoothState.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * smoothState.js is jQuery plugin that progressively enhances 3 | * page loads to behave more like a single-page application. 4 | * 5 | * @author Miguel Ángel Pérez reachme@miguel-perez.com 6 | * @see http://smoothstate.com 7 | * 8 | */ 9 | 10 | (function (factory) { 11 | 'use strict'; 12 | 13 | if(typeof module === 'object' && typeof module.exports === 'object') { 14 | factory(require('jquery'), window, document); 15 | } else { 16 | factory(jQuery, window, document); 17 | } 18 | }(function ( $, window, document, undefined ) { 19 | 'use strict'; 20 | 21 | /** Abort if browser does not support pushState */ 22 | if(!window.history.pushState) { 23 | // setup a dummy fn, but don't intercept on link clicks 24 | $.fn.smoothState = function() { return this; }; 25 | $.fn.smoothState.options = {}; 26 | return; 27 | } 28 | 29 | /** Abort if smoothState is already present **/ 30 | if($.fn.smoothState) { return; } 31 | 32 | var 33 | /** Used later to scroll page to the top */ 34 | $body = $('html, body'), 35 | 36 | /** Used in debug mode to console out useful warnings */ 37 | consl = window.console, 38 | 39 | /** Plugin default options, will be exposed as $fn.smoothState.options */ 40 | defaults = { 41 | 42 | /** If set to true, smoothState will log useful debug information instead of aborting */ 43 | debug: false, 44 | 45 | /** jQuery selector to specify which anchors smoothState should bind to */ 46 | anchors: 'a', 47 | 48 | /** Regex to specify which href smoothState should load. If empty, every href will be permitted. */ 49 | hrefRegex: '', 50 | 51 | /** jQuery selector to specify which forms smoothState should bind to */ 52 | forms: 'form', 53 | 54 | /** If set to true, smoothState will store form responses in the cache. */ 55 | allowFormCaching: false, 56 | 57 | /** Minimum number of milliseconds between click/submit events. Events ignored beyond this rate are ignored. */ 58 | repeatDelay: 500, 59 | 60 | /** A selector that defines what should be ignored by smoothState */ 61 | blacklist: '.no-smoothState', 62 | 63 | /** If set to true, smoothState will prefetch a link's contents on hover */ 64 | prefetch: false, 65 | 66 | /** The name of the event we will listen to from anchors if we're prefetching */ 67 | prefetchOn: 'mouseover touchstart', 68 | 69 | /** jQuery selector to specify elements which should not be prefetched */ 70 | prefetchBlacklist: '.no-prefetch', 71 | 72 | /** The response header field name defining the request's final URI. Useful for resolving redirections. */ 73 | locationHeader: 'X-SmoothState-Location', 74 | 75 | /** The number of pages smoothState will try to store in memory */ 76 | cacheLength: 0, 77 | 78 | /** Class that will be applied to the body while the page is loading */ 79 | loadingClass: 'is-loading', 80 | 81 | /** Scroll to top after onStart and scroll to hash after onReady */ 82 | scroll: true, 83 | 84 | /** 85 | * A function that can be used to alter the ajax request settings before it is called 86 | * @param {Object} request - jQuery.ajax settings object that will be used to make the request 87 | * @return {Object} Altered request object 88 | */ 89 | alterRequest: function (request) { 90 | return request; 91 | }, 92 | 93 | /** 94 | * A function that can be used to alter the state object before it is updated or added to the browsers history 95 | * @param {Object} state - An object that will be assigned to history entry 96 | * @param {string} title - The history entry's title. For reference only 97 | * @param {string} url - The history entry's URL. For reference only 98 | * @return {Object} Altered state object 99 | */ 100 | alterChangeState: function (state, title, url) { 101 | return state; 102 | }, 103 | 104 | /** Run before a page load has been activated */ 105 | onBefore: function ($currentTarget, $container) {}, 106 | 107 | /** Run when a page load has been activated */ 108 | onStart: { 109 | duration: 0, 110 | render: function ($container) {} 111 | }, 112 | 113 | /** Run if the page request is still pending and onStart has finished animating */ 114 | onProgress: { 115 | duration: 0, 116 | render: function ($container) {} 117 | }, 118 | 119 | /** Run when requested content is ready to be injected into the page */ 120 | onReady: { 121 | duration: 0, 122 | render: function ($container, $newContent) { 123 | $container.html($newContent); 124 | } 125 | }, 126 | 127 | /** Run when content has been injected and all animations are complete */ 128 | onAfter: function($container, $newContent) {} 129 | }, 130 | 131 | /** Utility functions that are decoupled from smoothState */ 132 | utility = { 133 | 134 | /** 135 | * Checks to see if the url is external 136 | * @param {string} url - url being evaluated 137 | * @see http://stackoverflow.com/questions/6238351/fastest-way-to-detect-external-urls 138 | * 139 | */ 140 | isExternal: function (url) { 141 | var match = url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/); 142 | if (typeof match[1] === 'string' && match[1].length > 0 && match[1].toLowerCase() !== window.location.protocol) { 143 | return true; 144 | } 145 | if (typeof match[2] === 'string' && 146 | match[2].length > 0 && 147 | match[2].replace(new RegExp(':(' + {'http:': 80, 'https:': 443}[window.location.protocol] + 148 | ')?$'), '') !== window.location.host) { 149 | return true; 150 | } 151 | return false; 152 | }, 153 | 154 | /** 155 | * Strips the hash from a url and returns the new href 156 | * @param {string} href - url being evaluated 157 | * 158 | */ 159 | stripHash: function(href) { 160 | return href.replace(/#.*/, ''); 161 | }, 162 | 163 | /** 164 | * Checks to see if the url is an internal hash 165 | * @param {string} href - url being evaluated 166 | * @param {string} prev - previous url (optional) 167 | * 168 | */ 169 | isHash: function (href, prev) { 170 | prev = prev || window.location.href; 171 | 172 | var hasHash = (href.indexOf('#') > -1) ? true : false, 173 | samePath = (utility.stripHash(href) === utility.stripHash(prev)) ? true : false; 174 | 175 | return (hasHash && samePath); 176 | }, 177 | 178 | /** 179 | * Translates a url string into a $.ajax settings obj 180 | * @param {Object|String} request url or settings obj 181 | * @return {Object} settings object 182 | */ 183 | translate: function(request) { 184 | var defaults = { 185 | dataType: 'html', 186 | type: 'GET' 187 | }; 188 | if(typeof request === 'string') { 189 | request = $.extend({}, defaults, { url: request }); 190 | } else { 191 | request = $.extend({}, defaults, request); 192 | } 193 | return request; 194 | }, 195 | 196 | /** 197 | * Checks to see if we should be loading this URL 198 | * @param {string} url - url being evaluated 199 | * @param {string} blacklist - jquery selector 200 | * 201 | */ 202 | shouldLoadAnchor: function ($anchor, blacklist, hrefRegex) { 203 | var href = $anchor.prop('href'); 204 | // URL will only be loaded if it's not an external link, hash, or 205 | // blacklisted 206 | return ( 207 | !utility.isExternal(href) && 208 | !utility.isHash(href) && 209 | !$anchor.is(blacklist) && 210 | !$anchor.prop('target')) && 211 | ( 212 | typeof hrefRegex === undefined || 213 | hrefRegex === '' || 214 | $anchor.prop('href').search(hrefRegex) !== -1 215 | ); 216 | }, 217 | 218 | /** 219 | * Resets an object if it has too many properties 220 | * 221 | * This is used to clear the 'cache' object that stores 222 | * all of the html. This would prevent the client from 223 | * running out of memory and allow the user to hit the 224 | * server for a fresh copy of the content. 225 | * 226 | * @param {object} obj 227 | * @param {number} cap 228 | * 229 | */ 230 | clearIfOverCapacity: function (cache, cap) { 231 | // Polyfill Object.keys if it doesn't exist 232 | if (!Object.keys) { 233 | Object.keys = function (obj) { 234 | var keys = [], 235 | k; 236 | for (k in obj) { 237 | if (Object.prototype.hasOwnProperty.call(obj, k)) { 238 | keys.push(k); 239 | } 240 | } 241 | return keys; 242 | }; 243 | } 244 | 245 | if (Object.keys(cache).length > cap) { 246 | cache = {}; 247 | } 248 | 249 | return cache; 250 | }, 251 | 252 | /** 253 | * Stores a document fragment into an object 254 | * @param {object} object - object where it will be stored 255 | * @param {string} url - name of the entry 256 | * @param {string|document} doc - entire html 257 | * @param {string} id - the id of the fragment 258 | * @param {object} [state] - the history entry's object 259 | * @param {string} [destUrl] - the destination url 260 | * @return {object} updated object store 261 | */ 262 | storePageIn: function (object, url, doc, id, state, destUrl) { 263 | var $html = $( '' ).append( $(doc) ); 264 | if (typeof state === 'undefined') { 265 | state = {}; 266 | } 267 | if (typeof destUrl === 'undefined') { 268 | destUrl = url; 269 | } 270 | object[url] = { // Content is indexed by the url 271 | status: 'loaded', 272 | // Stores the title of the page, .first() prevents getting svg titles 273 | title: $html.find('title').first().text(), 274 | html: $html.find('#' + id), // Stores the contents of the page 275 | doc: doc, // Stores the whole page document 276 | state: state, // Stores the history entry for comparisons, 277 | destUrl: destUrl // URL, which will be pushed to history stack 278 | }; 279 | return object; 280 | }, 281 | 282 | /** 283 | * Triggers an 'allanimationend' event when all animations are complete 284 | * @param {object} $element - jQuery object that should trigger event 285 | * @param {string} resetOn - which other events to trigger allanimationend on 286 | * 287 | */ 288 | triggerAllAnimationEndEvent: function ($element, resetOn) { 289 | 290 | resetOn = ' ' + resetOn || ''; 291 | 292 | var animationCount = 0, 293 | animationstart = 'animationstart webkitAnimationStart oanimationstart MSAnimationStart', 294 | animationend = 'animationend webkitAnimationEnd oanimationend MSAnimationEnd', 295 | eventname = 'allanimationend', 296 | onAnimationStart = function (e) { 297 | if ($(e.delegateTarget).is($element)) { 298 | e.stopPropagation(); 299 | animationCount++; 300 | } 301 | }, 302 | onAnimationEnd = function (e) { 303 | if ($(e.delegateTarget).is($element)) { 304 | e.stopPropagation(); 305 | animationCount--; 306 | if(animationCount === 0) { 307 | $element.trigger(eventname); 308 | } 309 | } 310 | }; 311 | 312 | $element.on(animationstart, onAnimationStart); 313 | $element.on(animationend, onAnimationEnd); 314 | 315 | $element.on('allanimationend' + resetOn, function(){ 316 | animationCount = 0; 317 | utility.redraw($element); 318 | }); 319 | }, 320 | 321 | /** Forces browser to redraw elements */ 322 | redraw: function ($element) { 323 | $element.height(); 324 | } 325 | }, 326 | 327 | /** Handles the popstate event, like when the user hits 'back' */ 328 | onPopState = function ( e ) { 329 | if(e.state !== null) { 330 | var url = window.location.href, 331 | $page = $('#' + e.state.id), 332 | page = $page.data('smoothState'), 333 | diffUrl = (page.href !== url && !utility.isHash(url, page.href)), 334 | diffState = (e.state !== page.cache[page.href].state); 335 | 336 | if(diffUrl || diffState) { 337 | if (diffState) { 338 | page.clear(page.href); 339 | } 340 | page.load(url, false); 341 | } 342 | } 343 | }, 344 | 345 | /** Constructor function */ 346 | Smoothstate = function ( element, options ) { 347 | var 348 | /** Container element smoothState is run on */ 349 | $container = $(element), 350 | 351 | /** ID of the main container */ 352 | elementId = $container.prop('id'), 353 | 354 | /** If a hash was clicked, we'll store it here so we 355 | * can scroll to it once the new page has been fully 356 | * loaded. 357 | */ 358 | targetHash = null, 359 | 360 | /** Used to prevent fetching while we transition so 361 | * that we don't mistakenly override a cache entry 362 | * we need. 363 | */ 364 | isTransitioning = false, 365 | 366 | /** Variable that stores pages after they are requested */ 367 | cache = {}, 368 | 369 | /** Variable that stores data for a history entry */ 370 | state = {}, 371 | 372 | /** Url of the content that is currently displayed */ 373 | currentHref = window.location.href, 374 | 375 | /** 376 | * Clears a given page from the cache, if no url is provided 377 | * it will clear the entire cache. 378 | * @param {String} url entry that is to be deleted. 379 | */ 380 | clear = function(url) { 381 | url = url || false; 382 | if(url && cache.hasOwnProperty(url)) { 383 | delete cache[url]; 384 | } else { 385 | cache = {}; 386 | } 387 | $container.data('smoothState').cache = cache; 388 | }, 389 | 390 | /** 391 | * Fetches the contents of a url and stores it in the 'cache' variable 392 | * @param {String|Object} request - url or request settings object 393 | * @param {Function} callback - function that will run as soon as it finishes 394 | */ 395 | fetch = function (request, callback) { 396 | 397 | // Sets a default in case a callback is not defined 398 | callback = callback || $.noop; 399 | 400 | // Allows us to accept a url string or object as the ajax settings 401 | var settings = utility.translate(request); 402 | 403 | // Check the length of the cache and clear it if needed 404 | cache = utility.clearIfOverCapacity(cache, options.cacheLength); 405 | 406 | // Don't prefetch if we have the content already or if it's a form 407 | if(cache.hasOwnProperty(settings.url) && typeof settings.data === 'undefined') { 408 | return; 409 | } 410 | 411 | // Let other parts of the code know we're working on getting the content 412 | cache[settings.url] = { status: 'fetching' }; 413 | 414 | // Make the ajax request 415 | var ajaxRequest = $.ajax(settings); 416 | 417 | // Store contents in cache variable if successful 418 | ajaxRequest.done(function (html) { 419 | utility.storePageIn(cache, settings.url, html, elementId); 420 | $container.data('smoothState').cache = cache; 421 | }); 422 | 423 | // Mark as error to be acted on later 424 | ajaxRequest.fail(function () { 425 | cache[settings.url].status = 'error'; 426 | }); 427 | 428 | if (options.locationHeader) { 429 | ajaxRequest.always(function(htmlOrXhr, status, errorOrXhr){ 430 | // Resolve where the XHR is based on done() or fail() argument positions 431 | var xhr = (htmlOrXhr.statusCode ? htmlOrXhr : errorOrXhr), 432 | redirectedLocation = xhr.getResponseHeader(options.locationHeader); 433 | 434 | if (redirectedLocation) { 435 | cache[settings.url].destUrl = redirectedLocation; 436 | } 437 | }); 438 | } 439 | 440 | // Call fetch callback 441 | if(callback) { 442 | ajaxRequest.always(callback); 443 | } 444 | }, 445 | 446 | repositionWindow = function(){ 447 | // Scroll to a hash anchor on destination page 448 | if(targetHash) { 449 | var $targetHashEl = $(targetHash, $container); 450 | if($targetHashEl.length){ 451 | var newPosition = $targetHashEl.offset().top; 452 | $body.scrollTop(newPosition); 453 | } 454 | targetHash = null; 455 | } 456 | }, 457 | 458 | /** Updates the contents from cache[url] */ 459 | updateContent = function (url) { 460 | // If the content has been requested and is done: 461 | var containerId = '#' + elementId, 462 | $newContent = cache[url] ? $(cache[url].html.html()) : null; 463 | 464 | if($newContent.length) { 465 | 466 | // Update the title 467 | document.title = cache[url].title; 468 | 469 | // Update current url 470 | $container.data('smoothState').href = url; 471 | 472 | // Remove loading class 473 | if(options.loadingClass) { 474 | $body.removeClass(options.loadingClass); 475 | } 476 | 477 | // Call the onReady callback and set delay 478 | options.onReady.render($container, $newContent); 479 | 480 | $container.one('ss.onReadyEnd', function(){ 481 | 482 | // Allow prefetches to be made again 483 | isTransitioning = false; 484 | 485 | // Run callback 486 | options.onAfter($container, $newContent); 487 | 488 | if (options.scroll) { 489 | repositionWindow(); 490 | } 491 | 492 | bindPrefetchHandlers($container); 493 | 494 | }); 495 | 496 | window.setTimeout(function(){ 497 | $container.trigger('ss.onReadyEnd'); 498 | }, options.onReady.duration); 499 | 500 | } else if (!$newContent && options.debug && consl) { 501 | // Throw warning to help debug in debug mode 502 | consl.warn('No element with an id of ' + containerId + ' in response from ' + url + ' in ' + cache); 503 | } else { 504 | // No content availble to update with, aborting... 505 | window.location = url; 506 | } 507 | }, 508 | 509 | /** 510 | * Loads the contents of a url into our container 511 | * @param {string} url 512 | * @param {bool} push - used to determine if we should 513 | * add a new item into the history object 514 | * @param {bool} cacheResponse - used to determine if 515 | * we should allow the cache to forget this 516 | * page after thid load completes. 517 | */ 518 | load = function (request, push, cacheResponse) { 519 | 520 | var settings = utility.translate(request); 521 | 522 | /** Makes these optional variables by setting defaults. */ 523 | if (typeof push === 'undefined') { 524 | push = true; 525 | } 526 | if (typeof cacheResponse === 'undefined') { 527 | cacheResponse = true; 528 | } 529 | 530 | var 531 | /** Used to check if the onProgress function has been run */ 532 | hasRunCallback = false, 533 | 534 | callbBackEnded = false, 535 | 536 | /** List of responses for the states of the page request */ 537 | responses = { 538 | 539 | /** Page is ready, update the content */ 540 | loaded: function () { 541 | var eventName = hasRunCallback ? 'ss.onProgressEnd' : 'ss.onStartEnd'; 542 | 543 | if (!callbBackEnded || !hasRunCallback) { 544 | $container.one(eventName, function(){ 545 | updateContent(settings.url); 546 | if (!cacheResponse) { 547 | clear(settings.url); 548 | } 549 | }); 550 | } 551 | else if (callbBackEnded) { 552 | updateContent(settings.url); 553 | } 554 | 555 | if (push) { 556 | var destUrl = cache[settings.url].destUrl; 557 | 558 | /** Prepare a history entry */ 559 | state = options.alterChangeState({ id: elementId }, cache[settings.url].title, destUrl); 560 | 561 | /** Update the cache to include the history entry for future comparisons */ 562 | cache[settings.url].state = state; 563 | 564 | /** Add history entry */ 565 | window.history.pushState(state, cache[settings.url].title, destUrl); 566 | } 567 | 568 | if (callbBackEnded && !cacheResponse) { 569 | clear(settings.url); 570 | } 571 | }, 572 | 573 | /** Loading, wait 10 ms and check again */ 574 | fetching: function () { 575 | 576 | if (!hasRunCallback) { 577 | 578 | hasRunCallback = true; 579 | 580 | // Run the onProgress callback and set trigger 581 | $container.one('ss.onStartEnd', function(){ 582 | 583 | // Add loading class 584 | if (options.loadingClass) { 585 | $body.addClass(options.loadingClass); 586 | } 587 | 588 | options.onProgress.render($container); 589 | 590 | window.setTimeout(function (){ 591 | $container.trigger('ss.onProgressEnd'); 592 | callbBackEnded = true; 593 | }, options.onProgress.duration); 594 | 595 | }); 596 | } 597 | 598 | window.setTimeout(function () { 599 | // Might of been canceled, better check! 600 | if (cache.hasOwnProperty(settings.url)){ 601 | responses[cache[settings.url].status](); 602 | } 603 | }, 10); 604 | }, 605 | 606 | /** Error, abort and redirect */ 607 | error: function (){ 608 | if(options.debug && consl) { 609 | consl.log('There was an error loading: ' + settings.url); 610 | } else { 611 | window.location = settings.url; 612 | } 613 | } 614 | }; 615 | 616 | if (!cache.hasOwnProperty(settings.url)) { 617 | fetch(settings); 618 | } 619 | 620 | // Run the onStart callback and set trigger 621 | options.onStart.render($container); 622 | 623 | window.setTimeout(function(){ 624 | if (options.scroll) { 625 | $body.scrollTop(0); 626 | } 627 | $container.trigger('ss.onStartEnd'); 628 | }, options.onStart.duration); 629 | 630 | // Start checking for the status of content 631 | responses[cache[settings.url].status](); 632 | }, 633 | 634 | /** 635 | * Binds to the hover event of a link, used for prefetching content 636 | * @param {object} event 637 | */ 638 | hoverAnchor = function (event) { 639 | var request, 640 | $anchor = $(event.currentTarget); 641 | 642 | if (utility.shouldLoadAnchor($anchor, options.blacklist, options.hrefRegex) && !isTransitioning) { 643 | event.stopPropagation(); 644 | request = utility.translate($anchor.prop('href')); 645 | request = options.alterRequest(request); 646 | fetch(request); 647 | } 648 | }, 649 | 650 | /** 651 | * Binds to the click event of a link, used to show the content 652 | * @param {object} event 653 | */ 654 | clickAnchor = function (event) { 655 | 656 | // Ctrl (or Cmd) + click must open a new tab 657 | var $anchor = $(event.currentTarget); 658 | if (!event.metaKey && !event.ctrlKey && utility.shouldLoadAnchor($anchor, options.blacklist, options.hrefRegex)) { 659 | 660 | // stopPropagation so that event doesn't fire on parent containers. 661 | event.stopPropagation(); 662 | event.preventDefault(); 663 | 664 | // Apply rate limiting. 665 | if (!isRateLimited()) { 666 | 667 | // Set the delay timeout until the next event is allowed. 668 | setRateLimitRepeatTime(); 669 | 670 | var request = utility.translate($anchor.prop('href')); 671 | isTransitioning = true; 672 | targetHash = $anchor.prop('hash'); 673 | 674 | // Allows modifications to the request 675 | request = options.alterRequest(request); 676 | 677 | options.onBefore($anchor, $container); 678 | 679 | load(request); 680 | } 681 | } 682 | }, 683 | 684 | /** 685 | * Binds to form submissions 686 | * @param {Event} event 687 | */ 688 | submitForm = function (event) { 689 | var $form = $(event.currentTarget); 690 | 691 | if (!$form.is(options.blacklist)) { 692 | 693 | event.preventDefault(); 694 | event.stopPropagation(); 695 | 696 | // Apply rate limiting. 697 | if (!isRateLimited()) { 698 | 699 | // Set the delay timeout until the next event is allowed. 700 | setRateLimitRepeatTime(); 701 | 702 | var request = { 703 | url: $form.prop('action'), 704 | data: $form.serialize(), 705 | type: $form.prop('method') 706 | }; 707 | 708 | isTransitioning = true; 709 | request = options.alterRequest(request); 710 | 711 | if (request.type.toLowerCase() === 'get') { 712 | request.url = request.url + '?' + request.data; 713 | } 714 | 715 | // Call the onReady callback and set delay 716 | options.onBefore($form, $container); 717 | 718 | load(request, undefined, options.allowFormCaching); 719 | } 720 | } 721 | }, 722 | 723 | /** 724 | * DigitalMachinist (Jeff Rose) 725 | * I figured to keep these together with this above functions since they're all related. 726 | * Feel free to move these somewhere more appropriate if you have such places. 727 | */ 728 | rateLimitRepeatTime = 0, 729 | isRateLimited = function () { 730 | var isFirstClick = (options.repeatDelay === null); 731 | var isDelayOver = (parseInt(Date.now()) > rateLimitRepeatTime); 732 | return !(isFirstClick || isDelayOver); 733 | }, 734 | setRateLimitRepeatTime = function () { 735 | rateLimitRepeatTime = parseInt(Date.now()) + parseInt(options.repeatDelay); 736 | }, 737 | 738 | /** 739 | * Binds prefetch events 740 | * @param {object} event 741 | */ 742 | bindPrefetchHandlers = function ($element) { 743 | 744 | if (options.anchors && options.prefetch) { 745 | $element.find(options.anchors).not(options.prefetchBlacklist).on(options.prefetchOn, null, hoverAnchor); 746 | } 747 | }, 748 | 749 | /** 750 | * Binds all events and inits functionality 751 | * @param {object} event 752 | */ 753 | bindEventHandlers = function ($element) { 754 | 755 | if (options.anchors) { 756 | $element.on('click', options.anchors, clickAnchor); 757 | 758 | bindPrefetchHandlers($element); 759 | } 760 | 761 | if (options.forms) { 762 | $element.on('submit', options.forms, submitForm); 763 | } 764 | }, 765 | 766 | /** Restart the container's css animations */ 767 | restartCSSAnimations = function () { 768 | var classes = $container.prop('class'); 769 | $container.removeClass(classes); 770 | utility.redraw($container); 771 | $container.addClass(classes); 772 | }; 773 | 774 | /** Merge defaults and global options into current configuration */ 775 | options = $.extend( {}, $.fn.smoothState.options, options ); 776 | 777 | /** Sets a default state */ 778 | if(window.history.state === null) { 779 | state = options.alterChangeState({ id: elementId }, document.title, currentHref); 780 | 781 | /** Update history entry */ 782 | window.history.replaceState(state, document.title, currentHref); 783 | } else { 784 | state = {}; 785 | } 786 | 787 | /** Stores the current page in cache variable */ 788 | utility.storePageIn(cache, currentHref, document.documentElement.outerHTML, elementId, state); 789 | 790 | /** Bind all of the event handlers on the container, not anchors */ 791 | utility.triggerAllAnimationEndEvent($container, 'ss.onStartEnd ss.onProgressEnd ss.onEndEnd'); 792 | 793 | /** Bind all of the event handlers on the container, not anchors */ 794 | bindEventHandlers($container); 795 | 796 | 797 | /** Public methods */ 798 | return { 799 | href: currentHref, 800 | cache: cache, 801 | clear: clear, 802 | load: load, 803 | fetch: fetch, 804 | restartCSSAnimations: restartCSSAnimations 805 | }; 806 | }, 807 | 808 | /** Returns elements with smoothState attached to it */ 809 | declaresmoothState = function ( options ) { 810 | return this.each(function () { 811 | var tagname = this.tagName.toLowerCase(); 812 | // Checks to make sure the smoothState element has an id and isn't already bound 813 | if(this.id && tagname !== 'body' && tagname !== 'html' && !$.data(this, 'smoothState')) { 814 | // Makes public methods available via $('element').data('smoothState'); 815 | $.data(this, 'smoothState', new Smoothstate(this, options)); 816 | } else if (!this.id && consl) { 817 | // Throw warning if in debug mode 818 | consl.warn('Every smoothState container needs an id but the following one does not have one:', this); 819 | } else if ((tagname === 'body' || tagname === 'html') && consl) { 820 | // We dont support making th html or the body element the smoothstate container 821 | consl.warn('The smoothstate container cannot be the ' + this.tagName + ' tag'); 822 | } 823 | }); 824 | }; 825 | 826 | /** Sets the popstate function */ 827 | window.onpopstate = onPopState; 828 | 829 | /** Makes utility functions public for unit tests */ 830 | $.smoothStateUtility = utility; 831 | 832 | /** Defines the smoothState plugin */ 833 | $.fn.smoothState = declaresmoothState; 834 | 835 | /* expose the default options */ 836 | $.fn.smoothState.options = defaults; 837 | 838 | })); -------------------------------------------------------------------------------- /js/page-transitions.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 'use strict'; 3 | 4 | 5 | 6 | ////////// Colova Scroll Animations Start ////////// 7 | $(window).on('load', function () { 8 | 9 | $('.has-animation').each(function () { 10 | $(this).attr('data-scroll', 'true') 11 | 12 | }); 13 | 14 | if ($(window).width() > 850) { 15 | 16 | 17 | var colovaScroll = new LocomotiveScroll({ 18 | el: document.querySelector('.js-scroll'), 19 | smooth: false, 20 | offset: 150 21 | });; 22 | window.colovaScroll = colovaScroll; 23 | }; 24 | 25 | 26 | if ($(window).width() < 850) { 27 | var colovaScroll = new LocomotiveScroll({ 28 | el: document.querySelector('.js-scroll'), 29 | smooth: false, 30 | offset: 100 31 | }); 32 | window.colovaScroll = colovaScroll; 33 | }; 34 | 35 | }); 36 | 37 | ////////// Colova Scroll Animations End ////////// 38 | 39 | 40 | 41 | 42 | ////////// Page Transitions Start ////////// 43 | 44 | $('.colova-project-button').on('click', function () { 45 | 46 | var targetProject = $(this).parents('.swiper-slide'); 47 | var clickedTitle = targetProject.find('.colova-project-title'); 48 | 49 | window.clickedTitle = clickedTitle; 50 | }); 51 | 52 | 53 | $('.colova-portfolio-title').on('click', function () { 54 | var clickedTitle = $(this); 55 | window.clickedTitle = clickedTitle; 56 | }); 57 | 58 | 59 | 60 | var options = { 61 | blacklist: '.c-image', 62 | prefetch: true, 63 | cacheLength: 2, 64 | onStart: { 65 | duration: 3000, // Duration of our animation 66 | render: function ($container) { 67 | // Add your CSS animation reversing class 68 | 69 | 70 | if ($('.navigation-classic').length > 0) { 71 | 72 | $('.navigation-classic .menu-item a').on('click', function () { 73 | 74 | 75 | setTimeout(function () { 76 | $('.page-trans-overlay').addClass('overlay-visible'); 77 | 78 | }, 400); 79 | 80 | }); 81 | 82 | var clickedTitle = $('a'); 83 | window.clickedTitle = clickedTitle; 84 | 85 | } 86 | 87 | if (($('.colova-portfolio-showcase').length < 1) && (!$(".fs-menu-toggle").hasClass('is-active'))) { 88 | 89 | setTimeout(function () { 90 | $('.page-trans-overlay').addClass('overlay-visible'); 91 | 92 | }, 400); 93 | } 94 | 95 | $('.site-logo').addClass('out-left'); 96 | $('.fs-footer-left').addClass('out-left'); 97 | $('.fs-footer-right').addClass('out-right'); 98 | $('.fs-menu-toggle').addClass('out-right'); 99 | 100 | if ($('.navigation-classic').length > 0) { 101 | $('.site-navigation .site-menu').addClass('out-right'); 102 | }; 103 | 104 | if ($('.cv-titles').length > 0) { 105 | $('.cv-slide-control').addClass('opacity-0') 106 | 107 | } 108 | 109 | 110 | if (($('.colova-portfolio-showcase').length > 0) && (!$(".fs-menu-toggle").hasClass('is-active'))) { 111 | 112 | 113 | if ($('.cl2-date').length > 0) { 114 | $('.cl2-date').addClass('opacity-0'); 115 | } 116 | $('.colova-portfolio-title').addClass('opacity-0'); 117 | window.clickedTitle.removeClass('opacity-0'); 118 | $('.colova-portfolio-image').addClass('scale-down') 119 | $('.colova-portfolio-video').addClass('scale-down') 120 | 121 | setTimeout(function () { 122 | $('.colova-portfolio-title').addClass('title-out'); 123 | }, 500); 124 | 125 | setTimeout(function () { 126 | $('.colova-portfolio-image').addClass('opacity-0') 127 | $('.colova-portfolio-video').addClass('opacity-0') 128 | }, 1250); 129 | 130 | setTimeout(function () { 131 | $('.portfolio-trans-overlay').addClass('overlay-visible'); 132 | }, 2000); 133 | 134 | 135 | }; 136 | 137 | if ($('.fs-menu-toggle').hasClass('is-active')) { 138 | 139 | setTimeout(function () { 140 | $('.page-trans-overlay').addClass('overlay-visible'); 141 | }, 1000); 142 | 143 | 144 | }; 145 | 146 | 147 | // Restart your animation 148 | smoothState.restartCSSAnimations(); 149 | } 150 | }, 151 | onReady: { 152 | duration: 0, 153 | render: function ($container, $newContent) { 154 | 155 | // Inject the new content 156 | $container.html($newContent); 157 | 158 | ////////// Site Menu Start ////////// 159 | if ($('.navigation-fs').length > 0) { 160 | 161 | var navHeight = $('.main-navigation').outerHeight(); 162 | 163 | 164 | 165 | $('.fs-widget-wrapper').css({ 166 | height: navHeight + 'px' 167 | 168 | }); 169 | 170 | $('.fs-menu-toggle').on('click', function () { 171 | 172 | var clicks = $(this).data('clicks'); 173 | if (clicks) { 174 | 175 | $(this).removeClass('is-active'); 176 | 177 | $('.menu-item a').each(function (i, element) { 178 | $(element).delay(i * 120).queue(function (next) { 179 | $(this).removeClass('menu-item-comes'); 180 | var beforeLi = $(this).parent('.menu-item'); 181 | beforeLi.removeClass('index-come'); 182 | next(); 183 | }); 184 | }) 185 | 186 | $('.fs-seperator').removeClass('fs-seperator-in'); 187 | $('.fs-widget').removeClass('fs-widget-in'); 188 | 189 | setTimeout(function () { 190 | $('.fs-menu-found').removeClass('found-comes'); 191 | }, 400); 192 | 193 | } else { 194 | $(this).addClass('is-active'); 195 | 196 | $('.fs-menu-found').addClass('found-comes'); 197 | 198 | 199 | setTimeout(function () { 200 | $('.fs-seperator').addClass('fs-seperator-in'); 201 | $('.fs-widget').addClass('fs-widget-in'); 202 | $('.menu-item a').each(function (i, element) { 203 | $(element).delay(i * 150).queue(function (next) { 204 | $(this).addClass('menu-item-comes'); 205 | var beforeLi = $(this).parent('.menu-item'); 206 | 207 | setTimeout(function () { 208 | beforeLi.addClass('index-come'); 209 | 210 | }, 200); 211 | 212 | next(); 213 | }); 214 | 215 | 216 | }); 217 | 218 | }, 200); 219 | 220 | 221 | } 222 | $(this).data("clicks", !clicks); 223 | 224 | $('.navigation-fs .menu-item a').on('click', function () { 225 | 226 | 227 | $('.menu-item a').each(function (i, element) { 228 | $(element).delay(i * 120).queue(function (next) { 229 | $(this).removeClass('menu-item-comes'); 230 | var beforeLi = $(this).parent('.menu-item'); 231 | beforeLi.removeClass('index-come'); 232 | next(); 233 | }); 234 | }) 235 | 236 | $('.fs-seperator').removeClass('fs-seperator-in'); 237 | $('.fs-widget').removeClass('fs-widget-in'); 238 | 239 | $('.fs-menu-toggle').data('clicks', false) 240 | }); 241 | 242 | }); 243 | 244 | }; 245 | 246 | if ($(window).width() < 850) { 247 | 248 | $('.site-navigation').removeClass('navigation-classic'); 249 | $('.site-navigation').addClass('navigation-fs'); 250 | 251 | } 252 | 253 | ////////// Site Menu End /////////// 254 | 255 | ////////// C Embed Video Start /////////// 256 | if ($('.c-video').length > 0) { 257 | 258 | const cVideo = new Plyr('.c-video', { 259 | controls: ["play-large", 260 | "play", 261 | "progress", 262 | "duration", 263 | "mute", 264 | "volume", 265 | "fullscreen" 266 | ], 267 | autoplay: true, 268 | muted: true, 269 | volume: 0, 270 | quality: { 271 | default: 1080 272 | }, 273 | loop: { 274 | active: true 275 | }, 276 | 277 | }); 278 | 279 | $('.c-video-play').on('click', function () { 280 | $(this).fadeOut(500); 281 | $('.c-video-overlay').fadeOut(500); 282 | $('.plyr__controls').addClass('controls-in'); 283 | cVideo.restart(); 284 | cVideo.increaseVolume(1); 285 | 286 | }); 287 | 288 | window.cVideo = cVideo; 289 | 290 | }; 291 | 292 | if ($('.c-video-style-2').length > 0) { 293 | 294 | const cVideo2 = new Plyr('.c-video-style-2', { 295 | controls: ["play-large", 296 | "play", 297 | "progress", 298 | "duration", 299 | "mute", 300 | "volume", 301 | "fullscreen" 302 | ], 303 | 304 | }); 305 | 306 | 307 | $('.icon-play').on('click', function () { 308 | 309 | var videoPlay = $(this).parent('.video-control'); 310 | videoPlay.addClass('controls-gone'); 311 | cVideo2.play(); 312 | cVideo2.increaseVolume(1); 313 | }); 314 | 315 | window.cVideo2 = cVideo2; 316 | 317 | }; 318 | ////////// C Embed Video End /////////// 319 | 320 | ////////// Carousel Start ////////// 321 | if ($('.cp-titles').length > 0) { 322 | 323 | var colovaCarousel = new Swiper('.cp-titles', { 324 | slidesPerView: 'auto', 325 | mousewheel: { 326 | invert: false, 327 | 328 | }, 329 | centeredSlides: true, 330 | speed: 1500, 331 | touchRatio: 5, 332 | 333 | }); 334 | 335 | var fsColor = $('.swiper-slide-active').data('color'); 336 | 337 | $('.fullscreen, .portfolio-trans-overlay').css({ 338 | background: fsColor 339 | }); 340 | 341 | var backTitles = $('.cp-titles .swiper-wrapper').clone(); 342 | $('.back-titles').html(backTitles); 343 | 344 | var backTitles = new Swiper('.back-titles', { 345 | slidesPerView: 'auto', 346 | mousewheel: { 347 | invert: false, 348 | 349 | }, 350 | grabCursor: true, 351 | centeredSlides: true, 352 | speed: 1500, 353 | 354 | }); 355 | 356 | colovaCarousel.on('slideChangeTransitionStart', function () { 357 | 358 | var bgColor = $('.swiper-slide-active').data('color'); 359 | $('.fullscreen, .portfolio-trans-overlay').css({ 360 | background: bgColor 361 | }); 362 | 363 | 364 | }); 365 | 366 | 367 | var interleaveOffset = 0.5; 368 | 369 | var imagesSwiper = new Swiper('.images-swiper', { 370 | parallax: true, 371 | mousewheel: { 372 | invert: false, 373 | 374 | }, 375 | watchSlidesProgress: true, 376 | on: { 377 | progress: function () { 378 | let swiper = this; 379 | for (let i = 0; i < swiper.slides.length; i++) { 380 | let slideProgress = swiper.slides[i].progress, 381 | innerOffset = swiper.width * interleaveOffset, 382 | innerTranslate = slideProgress * innerOffset; 383 | 384 | swiper.slides[i].querySelector(".slide-bgimg").style.transform = 385 | "translateX(" + innerTranslate + "px)"; 386 | 387 | 388 | } 389 | }, 390 | setTransition: function (speed) { 391 | let swiper = this; 392 | for (let i = 0; i < swiper.slides.length; i++) { 393 | swiper.slides[i].style.transition = speed + "ms"; 394 | swiper.slides[i].querySelector(".slide-bgimg").style.transition = 395 | speed + "ms"; 396 | } 397 | } 398 | } 399 | 400 | }); 401 | 402 | 403 | colovaCarousel.controller.control = imagesSwiper; 404 | backTitles.controller.control = imagesSwiper; 405 | colovaCarousel.controller.control = backTitles; 406 | 407 | colovaCarousel.on('touchStart', function () { 408 | 409 | $('.cp-titles').addClass('cp-titles-touch'); 410 | 411 | }); 412 | 413 | colovaCarousel.on('touchEnd', function () { 414 | 415 | $('.cp-titles').removeClass('cp-titles-touch'); 416 | 417 | }); 418 | 419 | $('.discover-p-link').on('mouseenter', function () { 420 | 421 | $('.cp-titles').addClass('cp-toggle'); 422 | 423 | }); 424 | 425 | $('.discover-p-link').on('mouseleave', function () { 426 | 427 | $('.cp-titles').removeClass('cp-toggle'); 428 | 429 | }); 430 | 431 | 432 | }; 433 | ////////// Carousel End ////////// 434 | 435 | ////////// Vertical Start ////////// 436 | if ($('.cv-titles').length > 0) { 437 | 438 | var interleaveOffset = 0.5; 439 | 440 | var cvImagesSwiper = new Swiper('.cv-images-swiper', { 441 | slidesPerView: 1, 442 | parallax: true, 443 | mousewheel: { 444 | invert: false, 445 | 446 | }, 447 | watchSlidesProgress: true, 448 | on: { 449 | progress: function () { 450 | let swiper = this; 451 | for (let i = 0; i < swiper.slides.length; i++) { 452 | let slideProgress = swiper.slides[i].progress, 453 | innerOffset = swiper.width * interleaveOffset, 454 | innerTranslate = slideProgress * innerOffset; 455 | 456 | swiper.slides[i].querySelector(".slide-bgimg").style.transform = 457 | "translateX(" + innerTranslate + "px)"; 458 | 459 | 460 | } 461 | }, 462 | setTransition: function (speed) { 463 | let swiper = this; 464 | for (let i = 0; i < swiper.slides.length; i++) { 465 | swiper.slides[i].style.transition = speed + "ms"; 466 | swiper.slides[i].querySelector(".slide-bgimg").style.transition = 467 | speed + "ms"; 468 | } 469 | } 470 | } 471 | 472 | }); 473 | 474 | 475 | 476 | var cvTitles = new Swiper('.cv-titles', { 477 | slidesPerView: 1, 478 | mousewheel: { 479 | invert: false, 480 | 481 | }, 482 | centeredSlides: true, 483 | speed: 1000, 484 | effect: 'fade', 485 | fadeEffect: { 486 | crossFade: true 487 | }, 488 | autoplay: true, 489 | navigation: { 490 | nextEl: '.cv-slide-next', 491 | prevEl: '.cv-slide-prev', 492 | }, 493 | pagination: { 494 | el: '.cv-slide-fraction', 495 | type: 'fraction', 496 | renderFraction: function (currentClass, totalClass) { 497 | return '' + '/' + 498 | ''; 499 | }, 500 | 501 | }, 502 | }); 503 | 504 | cvTitles.controller.control = cvImagesSwiper; 505 | 506 | var cbColor = $('.swiper-slide-active').data('color'); 507 | 508 | $('.cv-images-back, .portfolio-trans-overlay').css({ 509 | backgroundColor: cbColor 510 | }); 511 | 512 | $('.cv-title, .cv-summary, .cv-discover, .cv-slide-pagination i , .cv-slide-fraction span').css({ 513 | color: cbColor 514 | }); 515 | 516 | cvTitles.on('slideChangeTransitionStart', function () { 517 | 518 | var cbColor = $('.swiper-slide-active').data('color'); 519 | $('.cv-images-back, .portfolio-trans-overlay').css({ 520 | background: cbColor 521 | }); 522 | 523 | setTimeout(function () { 524 | 525 | $('.cv-title, .cv-summary, .cv-discover, .cv-slide-pagination i , .cv-slide-fraction span').css({ 526 | color: cbColor 527 | }) 528 | }, 200) 529 | 530 | }); 531 | 532 | 533 | 534 | 535 | 536 | }; 537 | ////////// Vertical End ////////// 538 | 539 | ////////// Fullscreen Start ////////// 540 | if ($('.cf-titles').length > 0) { 541 | 542 | var cfTitles = new Swiper('.cf-titles', { 543 | slidesPerView: 'auto', 544 | mousewheel: { 545 | invert: false, 546 | 547 | }, 548 | centeredSlides: true, 549 | speed: 1300, 550 | direction: 'vertical', 551 | touchRatio: 0.1, 552 | autoplay: true 553 | 554 | }); 555 | 556 | 557 | var fsColor = $('.swiper-slide-active').data('color'); 558 | 559 | $('.fullscreen, .portfolio-trans-overlay').css({ 560 | background: fsColor 561 | }); 562 | 563 | cfTitles.on('slideChangeTransitionStart', function () { 564 | 565 | var bgColor = $('.swiper-slide-active').data('color'); 566 | $('.fullscreen, .portfolio-trans-overlay').css({ 567 | background: bgColor 568 | }); 569 | 570 | 571 | }); 572 | 573 | 574 | var interleaveOffset = 0.3; 575 | 576 | var cfImagesSwiper = new Swiper('.cf-images-swiper', { 577 | slidesPerView: 'auto', 578 | parallax: true, 579 | mousewheel: { 580 | invert: false, 581 | 582 | }, 583 | direction: 'vertical', 584 | watchSlidesProgress: true, 585 | speed: 1300, 586 | 587 | on: { 588 | progress: function () { 589 | let swiper = this; 590 | for (let i = 0; i < swiper.slides.length; i++) { 591 | let slideProgress = swiper.slides[i].progress, 592 | innerOffset = swiper.width * interleaveOffset, 593 | innerTranslate = slideProgress * innerOffset; 594 | 595 | swiper.slides[i].querySelector(".slide-bgimg").style.transform = 596 | "translateY(" + innerTranslate + "px)"; 597 | 598 | 599 | } 600 | }, 601 | setTransition: function (speed) { 602 | let swiper = this; 603 | for (let i = 0; i < swiper.slides.length; i++) { 604 | swiper.slides[i].style.transition = speed + "ms"; 605 | swiper.slides[i].querySelector(".slide-bgimg").style.transition = 606 | speed + "ms"; 607 | } 608 | } 609 | } 610 | 611 | }); 612 | 613 | 614 | 615 | cfTitles.controller.control = cfImagesSwiper; 616 | 617 | 618 | 619 | 620 | }; 621 | ////////// Fullscreen End ////////// 622 | 623 | ////////// List Start ////////// 624 | if ($('.cl-portfolios').length > 0) { 625 | 626 | var bgColor = $('.cl-portfolio').data('color'); 627 | $('.fullscreen, .portfolio-trans-overlay').css({ 628 | background: bgColor 629 | }); 630 | 631 | $('.cl-title-h1').on('mouseenter', function () { 632 | 633 | var clTitle = $(this).parents('.cl-title'); 634 | 635 | var clPort = clTitle.parents('.cl-portfolio'); 636 | 637 | var bgColor = clPort.data('color'); 638 | 639 | $('.fullscreen, .portfolio-trans-overlay').css({ 640 | background: bgColor 641 | }); 642 | 643 | var sImage = clPort.data('image'); 644 | 645 | $('.cl-image-base').removeClass('cl-image-active'); 646 | $(sImage).addClass('cl-image-active'); 647 | 648 | 649 | 650 | }); 651 | 652 | $('.cl-title-h1').on('mouseenter', function () { 653 | 654 | var clTitle = $(this).parents('.cl-title'); 655 | 656 | var clPort = clTitle.parents('.cl-portfolio'); 657 | 658 | 659 | 660 | }); 661 | 662 | $('.cl-title-h1').on('mouseleave', function () { 663 | $('.cl-image-base').removeClass('cl-image-active'); 664 | 665 | }); 666 | 667 | 668 | 669 | var Scrollbar = window.Scrollbar; 670 | 671 | Scrollbar.init(document.querySelector('.cl-portfolios')); 672 | 673 | } 674 | ////////// List End ////////// 675 | 676 | ////////// Title Wall Start ////////// 677 | if ($('.ct-portfolio').length > 0) { 678 | 679 | var bgColor = $('.ct-portfolio:first-child').data('color'); 680 | $('.fullscreen, .portfolio-trans-overlay').css({ 681 | background: bgColor 682 | }); 683 | 684 | $('.ct-portfolio a').on('mouseenter', function () { 685 | 686 | var activeParent = $(this).parents('.ct-portfolio'); 687 | 688 | var bgColor = activeParent.data('color'); 689 | 690 | $('.fullscreen, .portfolio-trans-overlay').css({ 691 | background: bgColor 692 | }); 693 | 694 | var sImage = activeParent.data('image'); 695 | var wrapper = $('.' + sImage).children('.ct-image-wrapper'); 696 | 697 | $(wrapper).addClass('ct-wrapper-height'); 698 | 699 | }); 700 | 701 | 702 | $('.ct-portfolio').on('mouseleave', function () { 703 | 704 | $('.ct-image-wrapper').removeClass('ct-wrapper-height'); 705 | 706 | }); 707 | 708 | $(document).on('mousemove', function (e) { 709 | $('.ct-images').css({ 710 | left: e.pageX + 20, 711 | top: e.pageY + 20 712 | }); 713 | }); 714 | 715 | 716 | 717 | }; 718 | ////////// Title Wall End ////////// 719 | 720 | ////////// List V2 Start ////////// 721 | if ($('.cl2-portfolio').length > 0) { 722 | 723 | var bgColor = $('.cl2-portfolio:first-child').data('color'); 724 | $('.fullscreen, .portfolio-trans-overlay').css({ 725 | background: bgColor 726 | }); 727 | 728 | $('.cl2-portfolio').on('mouseenter', function () { 729 | var bgColor = $(this).data('color'); 730 | 731 | $('.fullscreen, .portfolio-trans-overlay').css({ 732 | background: bgColor 733 | }); 734 | 735 | 736 | 737 | }); 738 | 739 | $('.cl2-title-h1').each(function () { 740 | var dataHover = $(this).text(); 741 | $(this).attr('data-hover', dataHover); 742 | 743 | }); 744 | 745 | $('.cl2-portfolio:first-child').addClass('cl2-portfolio-first'); 746 | 747 | $('.cl2-image-base:first-child').addClass('cl2-wrapper-height'); 748 | 749 | 750 | $('.cl2-portfolio').on('mouseenter', function () { 751 | 752 | $('.cl2-image-base').removeClass('cl2-wrapper-height'); 753 | 754 | 755 | $('.cl2-portfolio').removeClass('cl2-portfolio-first'); 756 | 757 | var sImage = $(this).data('image'); 758 | 759 | $(this).addClass('cl2-portfolio-first'); 760 | 761 | $(sImage).addClass('cl2-wrapper-height'); 762 | 763 | }); 764 | 765 | 766 | }; 767 | ////////// List V2 End ////////// 768 | 769 | ////////// Image Carousel Start ////////// 770 | if ($('.c-image-carousel').length > 0) { 771 | 772 | var cImageCarousel = new Swiper('.c-image-carousel', { 773 | slidesPerView: 'auto', 774 | spaceBetween: 30, 775 | 776 | grabCursor: true, 777 | breakpoints: { 778 | 850: { 779 | slidesPerView: 1, 780 | allowTouchMove: true, 781 | 782 | } 783 | 784 | }, 785 | 786 | 787 | }); 788 | 789 | 790 | }; 791 | ////////// Image Carousel End ////////// 792 | 793 | ////////// Parallax Image Start ////////// 794 | if ($('.c-parallax-image').length > 0) { 795 | var hasParallax = $('.c-parallax-image img'); 796 | 797 | hasParallax.addClass('has-parallax-image'); 798 | 799 | var cParallaxImage = document.getElementsByClassName('has-parallax-image'); 800 | new simpleParallax(cParallaxImage, { 801 | overflow: false, 802 | delay: 2, 803 | scale: 1.3 804 | }); 805 | 806 | 807 | }; 808 | ////////// Parallax Image End ////////// 809 | 810 | ////////// Image Lightbox Start ////////// 811 | if ($('.c-image-lightbox').length > 0) { 812 | $('.c-image-lightbox').magnificPopup({ 813 | delegate: 'img', // child items selector, by clicking on it popup will open 814 | type: 'image', 815 | closeOnContentClick: true, 816 | closeBtnInside: false, 817 | mainClass: 'image-lightbox', // class to remove default margin from left and right side 818 | image: { 819 | verticalFit: true 820 | }, 821 | zoom: { 822 | enabled: true, 823 | duration: 300 // don't foget to change the duration also in CSS 824 | }, 825 | 826 | // other options 827 | }); 828 | } 829 | ////////// Image Lightbox End ////////// 830 | 831 | $('.colova-project-button').on('click', function () { 832 | 833 | var targetProject = $(this).parents('.swiper-slide'); 834 | var clickedTitle = targetProject.find('.colova-project-title'); 835 | 836 | window.clickedTitle = clickedTitle; 837 | }); 838 | 839 | 840 | $('.colova-portfolio-title').on('click', function () { 841 | 842 | var clickedTitle = $(this); 843 | window.clickedTitle = clickedTitle; 844 | }); 845 | 846 | window.colovaScroll.destroy(); 847 | 848 | 849 | if ($('.has-animation').length > 0) { 850 | $('.has-animation').each(function () { 851 | $(this).attr('data-scroll', 'true') 852 | 853 | }); 854 | }; 855 | 856 | 857 | } 858 | }, 859 | onAfter: function ($container, $newContent) { 860 | 861 | $('.page-trans-overlay').removeClass('overlay-visible'); 862 | 863 | $('.portfolio-trans-overlay').removeClass('overlay-visible'); 864 | 865 | setTimeout(function () { 866 | window.colovaScroll.init(); 867 | 868 | 869 | }, 100) 870 | 871 | } 872 | 873 | 874 | }, 875 | smoothState = $('#main').smoothState(options).data('smoothState'); 876 | }); 877 | -------------------------------------------------------------------------------- /js/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ 2 | !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ 3 | return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("