1/* 2Name: Portfolio - Examples 3Written by: Okler Themes - (http://www.okler.net) 4Theme Version: 10.2.0 5*/ 6(function($) { 7 8 'use strict'; 9 10 /* 11 Portfolio on Modal 12 */ 13 $('a[data-portfolio-on-modal]').magnificPopup({ 14 mainClass: 'portfolio-modal', 15 type: 'inline', 16 gallery: { 17 enabled: true 18 }, 19 callbacks: { 20 open: function() { 21 $('.owl-carousel').owlCarousel('refresh'); 22 }, 23 change: function() { 24 setTimeout(function(){ 25 $('.owl-carousel').owlCarousel('refresh'); 26 }, 1); 27 } 28 } 29 }); 30 31 $('a[data-portfolio-close]').on('click', function(e) { 32 e.preventDefault(); 33 $.magnificPopup.instance.close(); 34 return false; 35 }); 36 37 $('a[data-portfolio-prev]').on('click', function(e) { 38 e.preventDefault(); 39 $.magnificPopup.instance.prev(); 40 return false; 41 }); 42 43 $('a[data-portfolio-next]').on('click', function(e) { 44 e.preventDefault(); 45 $.magnificPopup.instance.next(); 46 return false; 47 }); 48 49 /* 50 Carousel 51 */ 52 if ($.isFunction($.fn.revolution)) { 53 $("#revolutionSliderCarousel").show().revolution({ 54 sliderType: "carousel", 55 sliderLayout: "fullwidth", 56 dottedOverlay: "none", 57 delay: 4000, 58 navigation: { 59 keyboardNavigation: "off", 60 keyboard_direction: "horizontal", 61 mouseScrollNavigation: "off", 62 onHoverStop: "off", 63 arrows: { 64 style: "tparrows-carousel", 65 enable: true, 66 hide_onmobile: false, 67 hide_onleave: false, 68 tmp: '', 69 left: { 70 h_align: "left", 71 v_align: "center", 72 h_offset: 30, 73 v_offset: 0 74 }, 75 right: { 76 h_align: "right", 77 v_align: "center", 78 h_offset: 30, 79 v_offset: 0 80 } 81 } 82 }, 83 carousel: { 84 maxRotation: 65, 85 vary_rotation: "on", 86 minScale: 55, 87 vary_scale: "off", 88 horizontal_align: "center", 89 vertical_align: "center", 90 fadeout: "on", 91 vary_fade: "on", 92 maxVisibleItems: 5, 93 infinity: "on", 94 space: -150, 95 stretch: "off" 96 }, 97 gridwidth: 600, 98 gridheight: 600, 99 lazyType: "none", 100 shadow: 0, 101 spinner: "off", 102 stopLoop: "on", 103 stopAfterLoops: 0, 104 stopAtSlide: -1, 105 shuffle: "off", 106 autoHeight: "off", 107 disableProgressBar: "on", 108 hideThumbsOnMobile: "off", 109 hideSliderAtLimit: 0, 110 hideCaptionAtLimit: 0, 111 hideAllCaptionAtLilmit: 0, 112 debugMode: false, 113 fallbacks: { 114 simplifyAll: "off", 115 nextSlideOnWindowFocus: "off", 116 disableFocusListener: false, 117 } 118 }); 119 } 120 121 /* 122 Medias 123 */ 124 if ($.isFunction($.fn.revolution)) { 125 $("#revolutionSliderMedias").show().revolution({ 126 sliderType: "standard", 127 sliderLayout: "auto", 128 dottedOverlay: "none", 129 delay: 9000, 130 navigation: { 131 keyboardNavigation: "off", 132 keyboard_direction: "horizontal", 133 mouseScrollNavigation: "off", 134 onHoverStop: "off", 135 tabs: { 136 style: "hesperiden hesperiden-custom", 137 enable: true, 138 width: 250, 139 height: 80, 140 min_width: 250, 141 wrapper_padding: 20, 142 wrapper_color: "#ffffff", 143 wrapper_opacity: "1", 144 tmp: '<div class="tp-tab-content"> <span class="tp-tab-date">{{param1}}</span> <span class="tp-tab-title">{{title}}</span></div><div class="tp-tab-image"></div>', 145 visibleAmount: 5, 146 hide_onmobile: false, 147 hide_onleave: false, 148 hide_delay: 200, 149 direction: "horizontal", 150 span: false, 151 position: "outer-bottom", 152 space: 0, 153 h_align: "left", 154 v_align: "bottom", 155 h_offset: 0, 156 v_offset: 0 157 } 158 }, 159 gridwidth: 1230, 160 gridheight: 692, 161 lazyType: "smart", 162 shadow: 0, 163 spinner: "off", 164 stopLoop: "on", 165 stopAfterLoops: 0, 166 stopAtSlide: 1, 167 shuffle: "off", 168 autoHeight: "off", 169 disableProgressBar: "on", 170 hideThumbsOnMobile: "off", 171 hideSliderAtLimit: 0, 172 hideCaptionAtLimit: 0, 173 hideAllCaptionAtLilmit: 0, 174 debugMode: false, 175 fallbacks: { 176 simplifyAll: "off", 177 nextSlideOnWindowFocus: "off", 178 disableFocusListener: false, 179 } 180 }); 181 } 182 183 /* 184 Ajax on Page 185 */ 186 var ajaxOnPage = { 187 188 pages: [], 189 currentPage: 0, 190 total: 0, 191 $ajaxBox: $('#porfolioAjaxBox'), 192 $ajaxBoxContent: $('#porfolioAjaxBoxContent'), 193 194 build: function() { 195 196 var self = this; 197 198 $('a[data-ajax-on-page]').each(function() { 199 self.add($(this)); 200 }); 201 202 $(document).on('mousedown', 'a[data-ajax-on-page]', function (ev) { 203 if (ev.which == 2) { 204 ev.preventDefault(); 205 return false; 206 } 207 }); 208 209 // Key Press 210 $(document.documentElement).on('keyup', function(e) { 211 212 if( !$('.mfp-wrap').get(0) ) { 213 214 // Next 215 if (e.keyCode == 39) { 216 self.next(); 217 } 218 219 // Prev 220 if (e.keyCode == 37) { 221 self.prev(); 222 } 223 224 } 225 226 }); 227 228 }, 229 230 add: function($el) { 231 232 var self = this, 233 href = $el.attr('data-href'); 234 235 self.pages.push(href); 236 self.total++; 237 238 $el.on('click', function(e) { 239 e.preventDefault(); 240 self.show(self.pages.indexOf(href)); 241 }); 242 243 }, 244 245 events: function() { 246 247 var self = this; 248 249 // Close 250 $('a[data-ajax-portfolio-close]').on('click', function(e) { 251 e.preventDefault(); 252 self.close(); 253 }); 254 255 if (self.total <= 1) { 256 257 $('a[data-ajax-portfolio-prev], a[data-ajax-portfolio-next]').remove(); 258 259 } else { 260 261 // Prev 262 $('a[data-ajax-portfolio-prev]').on('click', function(e) { 263 e.preventDefault(); 264 self.prev(); 265 }); 266 267 // Next 268 $('a[data-ajax-portfolio-next]').on('click', function(e) { 269 e.preventDefault(); 270 self.next(); 271 }); 272 273 } 274 275 // Carousel 276 if ($.isFunction($.fn['themePluginCarousel'])) { 277 278 $(function() { 279 $('[data-plugin-carousel]:not(.manual), .owl-carousel:not(.manual)').each(function() { 280 var $this = $(this), 281 opts; 282 283 var pluginOptions = theme.fn.getOptions($this.data('plugin-options')); 284 if (pluginOptions) 285 opts = pluginOptions; 286 287 $this.themePluginCarousel(opts); 288 });
289 }); 290 291 } 292 293 }, 294 295 close: function() { 296 297 var self = this; 298 299 self.$ajaxBoxContent.empty(); 300 self.$ajaxBox.removeClass('ajax-box-init').removeClass('ajax-box-loading'); 301 302 }, 303 304 next: function() { 305 306 var self = this; 307 308 if(self.currentPage + 1 < self.total) { 309 self.show(self.currentPage + 1); 310 } else { 311 self.show(0); 312 } 313 }, 314 315 prev: function() { 316 317 var self = this; 318 319 if((self.currentPage - 1) >= 0) { 320 self.show(self.currentPage - 1); 321 } else { 322 self.show(self.total - 1); 323 } 324 }, 325 326 show: function(i) { 327 328 var self = this; 329 330 self.$ajaxBoxContent.empty(); 331 self.$ajaxBox.removeClass('ajax-box-init').addClass('ajax-box-loading'); 332 333 $('html, body').animate({ 334 scrollTop: self.$ajaxBox.offset().top - 100 335 }, 300, 'easeOutQuad'); 336 337 self.currentPage = i; 338 339 if (i < 0 || i > (self.total-1)) { 340 self.close(); 341 return false; 342 } 343 344 // Ajax 345 $.ajax({ 346 url: self.pages[i], 347 cache: false, 348 complete: function(data) { 349 350 setTimeout(function() { 351 352 self.$ajaxBoxContent.html(data.responseText).append('<div class="row"><div class="col-md-12"><hr class="tall mt-4"></div></div>'); 353 self.$ajaxBox.removeClass('ajax-box-loading'); 354 355 self.events(); 356 357 }, 1000); 358 359 } 360 }); 361 362 } 363 364 } 365 366 if($('#porfolioAjaxBox').get(0)) { 367 ajaxOnPage.build(); 368 } 369 370 /* 371 Ajax on Modal 372 */ 373 theme.fn.execOnceTroughEvent( 'a[data-ajax-on-modal]', 'mouseover.trigger.ajax.on.modal', function(){ 374 $('a[data-ajax-on-modal]').magnificPopup({ 375 type: 'ajax', 376 tLoading: '<div class="bounce-loader"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>', 377 mainClass: 'portfolio-ajax-modal', 378 closeBtnInside: true, 379 gallery: { 380 enabled: true 381 }, 382 callbacks: { 383 ajaxContentAdded: function() { 384 385 // Wrapper 386 var $wrapper = $('.portfolio-ajax-modal'); 387 388 // Close 389 $wrapper.find('a[data-ajax-portfolio-close]').on('click', function(e) { 390 e.preventDefault(); 391 $.magnificPopup.close(); 392 }); 393 394 // Remove Next and Close 395 if($('a[data-ajax-on-modal]').length <= 1) { 396 397 $wrapper.find('a[data-ajax-portfolio-prev], a[data-ajax-portfolio-next]').remove(); 398 399 } else { 400 401 // Prev 402 $wrapper.find('a[data-ajax-portfolio-prev]').on('click', function(e) { 403 e.preventDefault(); 404 $('.mfp-arrow-left').trigger('click'); 405 return false; 406 }); 407 408 // Next 409 $wrapper.find('a[data-ajax-portfolio-next]').on('click', function(e) { 410 e.preventDefault(); 411 $('.mfp-arrow-right').trigger('click'); 412 return false; 413 }); 414 415 } 416 417 // Carousel 418 $(function() { 419 $('[data-plugin-carousel]:not(.manual), .owl-carousel:not(.manual)').each(function() { 420 var $this = $(this), 421 opts; 422 423 var pluginOptions = theme.fn.getOptions($this.data('plugin-options')); 424 if (pluginOptions) 425 opts = pluginOptions; 426 427 $this.themePluginCarousel(opts); 428 }); 429 }); 430 431 } 432 } 433 }); 434 }); 435 436 /* 437 Load More 438 */ 439 var portfolioLoadMore = { 440 441 pages: 0, 442 currentPage: 1, 443 $wrapper: $('#portfolioLoadMoreWrapper'), 444 $btn: $('#portfolioLoadMore'), 445 $btnWrapper: $('#portfolioLoadMoreBtnWrapper'), 446 $loader: $('#portfolioLoadMoreLoader'), 447 448 build: function() { 449 450 var self = this 451 452 self.pages = self.$wrapper.data('total-pages'); 453 454 if(self.pages <= 1) { 455 456 self.$btnWrapper.remove(); 457 return; 458 459 } else { 460 461 self.$btn.on('click', function() { 462 self.loadMore(); 463 }); 464 465 // Infinite Scroll 466 if(self.$btn.hasClass('btn-portfolio-infinite-scroll')) { 467 theme.fn.intObs( '#portfolioLoadMore', "$('#portfolioLoadMore').trigger('click');", { 468 rootMargin: '0px 0px 0px 0px' 469 }, true ); 470 } 471 472 } 473 474 }, 475 loadMore: function() { 476 477 var self = this, 478 ajax_url = ( self.$wrapper.data('ajax-url') ) ? self.$wrapper.data('ajax-url') : 'ajax/portfolio-ajax-load-more-'; 479 480 self.$btn.hide(); 481 self.$loader.addClass('portfolio-load-more-loader-showing').show(); 482 483 // Ajax 484 $.ajax({
485 url: ajax_url + (parseInt(self.currentPage)+1) + '.html', 486 complete: function(data) { 487 488 var $items = $(data.responseText); 489 490 setTimeout(function() { 491 492 self.$wrapper.append($items) 493 494 self.$wrapper.isotope('appended', $items); 495 496 self.currentPage++; 497 498 if(self.currentPage < self.pages) { 499 self.$btn.show().blur(); 500 } else { 501 self.$btnWrapper.remove(); 502 } 503 504 // Carousel 505 $(function() { 506 $('[data-plugin-carousel]:not(.manual), .owl-carousel:not(.manual)').each(function() { 507 var $this = $(this), 508 opts; 509 510 var pluginOptions = theme.fn.getOptions($this.data('plugin-options')); 511 if (pluginOptions) 512 opts = pluginOptions; 513 514 $this.themePluginCarousel(opts); 515 }); 516 }); 517 518 self.$loader.removeClass('portfolio-load-more-loader-showing').hide(); 519 520 self.$wrapper.waitForImages(function(){ 521 self.$wrapper.isotope('layout'); 522 }); 523 524 }, 1000); 525 526 } 527 }); 528 529 } 530 531 } 532 533 if($('#portfolioLoadMoreWrapper').get(0)) { 534 portfolioLoadMore.build(); 535 } 536 537 /* 538 Pagination 539 */ 540 var portfolioPagination = { 541 542 pages: 0, 543 $wrapper: $('#portfolioPaginationWrapper'), 544 $filter: $('#portfolioPaginationFilter'), 545 $pager: $('#portfolioPagination'), 546 547 init: function() { 548 549 var self = this; 550 551 self.$filter.on('filtered', function(event, laidOutItems) { 552 self.build(); 553 self.$filter.find('.active').trigger('click'); 554 }); 555 556 }, 557 558 calcPages: function() { 559 560 var self = this, 561 filter = self.$wrapper.attr('data-filter'), 562 itemsPerPage = parseInt(self.$wrapper.attr('data-items-per-page')), 563 $activeItems = self.$wrapper.find(filter + '.isotope-item'); 564 565 self.$wrapper.find('.isotope-item').removeAttr('data-page-rel'); 566 567 $activeItems.each(function(i) { 568 var itemPage = Math.ceil((i+1)/itemsPerPage); 569 570 $(this).attr('data-page-rel', ((itemPage == 0) ? 1 : itemPage)); 571 572 if (itemPage > 1) { 573 $(this).hide(); 574 } 575 }); 576 577 self.$wrapper.isotope('layout'); 578 579 return Math.ceil($activeItems.length/itemsPerPage); 580 }, 581 582 build: function() { 583 584 var self = this; 585 586 self.pages = self.calcPages(); 587 588 self.$wrapper.removeAttr('data-current-page'); 589 590 self.$pager.empty().unbind(); 591 592 if(self.pages <= 1) { 593 594 return; 595 596 } else { 597 598 self.$wrapper.attr('data-current-page', 1); 599 600 self.$pager.bootpag({ 601 total: self.pages, 602 page: 1, 603 next: '<i class="fas fa-angle-right"></i>', 604 prev: '<i class="fas fa-angle-left"></i>' 605 }).on('page', function(event, num) { 606 self.$wrapper.attr('data-current-page', num); 607 self.$filter.find('.active').trigger('click'); 608 }); 609 610 } 611 612 self.$filter.find('.active').trigger('click'); 613 614 self.$pager.find('li').addClass('page-item'); 615 self.$pager.find('a').addClass('page-link'); 616 617 } 618 619 } 620 621 if($('#portfolioPagination').get(0)) { 622 portfolioPagination.init(); 623 } 624 625 /* 626 Combination Filters 627 */ 628 if($('#combinationFilters').get(0)) { 629 630 $(window).on('load', function() { 631 632 setTimeout(function() { 633 634 var $grid = $('.portfolio-list').isotope({ 635 itemSelector: '.isotope-item', 636 layoutMode: 'masonry', 637 filter: '*', 638 hiddenStyle: { 639 opacity: 0 640 }, 641 visibleStyle: { 642 opacity: 1 643 }, 644 stagger: 30, 645 isOriginLeft: ($('html').attr('dir') == 'rtl' ? false : true) 646 }); 647 648 var filters = {}, 649 $loader = $('.sort-destination-loader'); 650 651 $('.filters').on('click', 'a', function(e) { 652 653 e.preventDefault(); 654 655 var $this = $(this); 656 657 var $buttonGroup = $this.parents('.portfolio-filter-group'); 658 var filterGroup = $buttonGroup.attr('data-filter-group'); 659 660 filters[filterGroup] = $this.parent().attr('data-option-value'); 661 662 var filterValue = concatValues(filters); 663 664 $grid.isotope({ 665 filter: filterValue 666 }); 667 }); 668 669 $('.portfolio-filter-group').each(function(i, buttonGroup) { 670 var $buttonGroup = $(buttonGroup); 671 $buttonGroup.on('click', 'a', function() { 672 $buttonGroup.find('.active').removeClass('active'); 673 $(this).parent().addClass('active'); 674 $(this).addClass('active'); 675 });
676 }); 677 678 var concatValues = function(obj) { 679 var value = ''; 680 for (var prop in obj) { 681 value += obj[prop]; 682 } 683 return value; 684 } 685 686 $(window).on('resize', function() { 687 setTimeout(function() { 688 $grid.isotope('layout'); 689 }, 300); 690 }); 691 692 if ($loader) { 693 $loader.removeClass('sort-destination-loader-showing'); 694 695 setTimeout(function() { 696 $loader.addClass('sort-destination-loader-loaded'); 697 }, 500); 698 } 699 700 }, 1000); 701 702 }); 703 704 } 705 706 /* 707 Lazy Load Masonry 708 */ 709 if($('#portfolioLazyLoadMasonry').get(0)) { 710 711 var $window = $(window); 712 713 $window.on('load', function() { 714 715 var $grid = $('#portfolioLazyLoadMasonry .portfolio-list').isotope({ 716 itemSelector: '.isotope-item', 717 layoutMode: 'masonry', 718 filter: '*', 719 hiddenStyle: { 720 opacity: 0 721 }, 722 visibleStyle: { 723 opacity: 1 724 }, 725 stagger: 30, 726 isOriginLeft: ($('html').attr('dir') == 'rtl' ? false : true) 727 }); 728 729 var runningIsotope = false; 730 731 function reLayouIsotope() { 732 733 if(!runningIsotope) { 734 735 $grid.isotope('layout'); 736 runningIsotope = true; 737 738 setTimeout(function() { 739 runningIsotope = false; 740 }, 1000); 741 742 } 743 744 } 745 746 $grid.isotope('on', 'layoutComplete', function () { 747 reLayouIsotope(); 748 }); 749 750 $window.on('scroll', function () { 751 reLayouIsotope(); 752 }); 753 754 $window.on('resize', function() { 755 setTimeout(function() { 756 reLayouIsotope(); 757 }, 300); 758 }); 759 760 }); 761 762 } 763 764}).apply(this, [jQuery]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.