1/* ======================================================================================= 2 Template : Agroly 3 Create : Sept. 5th 2020 4 ========================================================================================== */ 5 6 7/* =============================================== 8 Function Call - Call Function Ones 9 =============================================== */ 10 11 jQuery(document).ready(function () { 12 "use strict"; 13 14 // here all ready functions 15 16 loader(); 17 scroll_top(); 18 magnific_popup(); 19 accordion(); 20 21 }); 22 23/* =============================================== 24 1. PRELOADER 25 =============================================== */ 26function loader() { 27 "use strict"; 28 setTimeout(function () { 29 $('#loader-wrapper').fadeOut(); 30 }, 1500); 31}; 32 33/* =============================================== 34 2. SCROLL TOP 35 =============================================== */ 36function scroll_top() { 37 "use strict"; 38 var offset = 300, 39 offset_opacity = 1200, 40 scroll_top_duration = 700, 41 $back_to_top = $('.cd-top'); 42 43 $(window).scroll(function () { 44 ($(this).scrollTop() > offset) ? $back_to_top.addClass('cd-is-visible'): $back_to_top.removeClass('cd-is-visible cd-fade-out'); 45 if ($(this).scrollTop() > offset_opacity) { 46 $back_to_top.addClass('cd-fade-out'); 47 } 48 }); 49 50 $back_to_top.on('click', function (event) { 51 event.preventDefault(); 52 $('body,html').animate({ 53 scrollTop: 0, 54 }, scroll_top_duration); 55 }); 56 57}; 58 59/* =============================================== 60 3. COUNTER 61 =============================================== */ 62 $('.counter').each(function () { 63 var $this = $(this), 64 countTo = $this.attr('data-count'); 65 $({ 66 countNum: $this.text() 67 }).animate({ 68 countNum: countTo 69 }, 70 71 { 72 duration: 8000, 73 easing: 'linear', 74 step: function () { 75 $this.text(Math.floor(this.countNum)); 76 }, 77 complete: function () { 78 $this.text(this.countNum); 79 //alert('finished'); 80 } 81 82 }); 83 }); 84 85/* =============================================== 86 4. TEAM CAROUSEL 87 =============================================== */ 88 $('.testimonials-carousel .owl-carousel').owlCarousel({ 89 stagePadding: 0, 90 loop: true, 91 dots: true, 92 margin: 10, 93 nav: true, 94 navText: [ 95 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 96 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 97 ], 98 navContainer: '.testimonials-carousel .custom-nav', 99 responsive: { 100 0: { 101 items: 1 102 }, 103 576: { 104 items: 2 105 }, 106 1200: { 107 items: 3 108 } 109 } 110 }); 111 112/* =============================================== 113 5. CLIENTS CAROUSEL 114 =============================================== */ 115 $('.clients-carousel .owl-carousel').owlCarousel({ 116 stagePadding: 0, 117 loop: true, 118 dots: true, 119 margin: 10, 120 nav: true, 121 navText: [ 122 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 123 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 124 ], 125 navContainer: '.clients-carousel .custom-nav', 126 responsive: { 127 0: { 128 items: 2 129 }, 130 576 : { 131 items: 3 132 }, 133 767 : { 134 items: 4 135 }, 136 1200: { 137 items: 5 138 } 139 } 140 }); 141 142/* =============================================== 143 6. GALLERY CAROUSEL 144 =============================================== */ 145 $('.wide-slider-layer .owl-carousel').owlCarousel({ 146 stagePadding: 0, 147 loop: true, 148 dots: false, 149 margin: 10, 150 nav: true, 151 navText: [ 152 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 153 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 154 ], 155 navContainer: '.wide-slider-layer .custom-nav', 156 responsive: { 157 0: { 158 items: 1 159 }, 160 767: { 161 items: 1 162 }, 163 1000: { 164 items: 1 165 } 166 } 167 }); 168 169/* =============================================== 170 7. GALLERY CAROUSEL 171 =============================================== */ 172 $('.wide-slider-layer-alt-2 .owl-carousel').owlCarousel({ 173 stagePadding: 0, 174 loop: true, 175 dots: false, 176 margin: 10, 177 nav: true, 178 navText: [ 179 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 180 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 181 ], 182 navContainer: '.wide-slider-layer-alt-2 .custom-nav', 183 responsive: { 184 0: { 185 items: 1 186 }, 187 767: { 188 items: 1 189 }, 190 1000: { 191 items: 1 192 } 193 } 194 }); 195 196/* =============================================== 197 8. GALLERY CAROUSEL 198 =============================================== */ 199 $('.testimonial-carousel-alt .owl-carousel').owlCarousel({ 200 stagePadding: 0, 201 loop: true, 202 dots: true, 203 margin: 0, 204 nav: true, 205 navText: [ 206 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 207 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 208 ], 209 navContainer: '.testimonial-carousel-alt .custom-nav', 210 responsive: { 211 0: { 212 items: 1 213 }, 214 767: { 215 items: 1 216 }, 217 1000: { 218 items: 1 219 } 220 } 221 }); 222 223/* =============================================== 224 9. NEWS CAROUSEL 225 =============================================== */
226 $('.news-carousel .owl-carousel').owlCarousel({ 227 stagePadding: 0, 228 loop: true, 229 dots: false, 230 margin: 10, 231 nav: true, 232 navText: [ 233 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 234 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 235 ], 236 navContainer: '.news-carousel .custom-nav', 237 responsive: { 238 0: { 239 items: 1 240 }, 241 767: { 242 items: 1 243 }, 244 1000: { 245 items: 3 246 } 247 } 248 }); 249 250/* =============================================== 251 10. TEAM CAROUSEL 252 =============================================== */ 253 $('.team-carousel .owl-carousel').owlCarousel({ 254 stagePadding: 0, 255 loop: true, 256 dots: false, 257 margin: 10, 258 nav: true, 259 navText: [ 260 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 261 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 262 ], 263 navContainer: '.team-carousel .custom-nav', 264 responsive: { 265 0: { 266 items: 1 267 }, 268 767: { 269 items: 1 270 }, 271 1000: { 272 items: 3 273 } 274 } 275 }); 276 277/* =============================================== 278 11. parallax-carousel 279 =============================================== */ 280 $('.parallax-carousel .owl-carousel').owlCarousel({ 281 stagePadding: 0, 282 loop: true, 283 dots: true, 284 margin: 10, 285 nav: true, 286 navText: [ 287 '<i class="fa fa-angle-left" aria-hidden="true"></i>', 288 '<i class="fa fa-angle-right" aria-hidden="true"></i>' 289 ], 290 navContainer: '.parallax-carousel .custom-nav', 291 responsive: { 292 0: { 293 items: 1 294 }, 295 576: { 296 items: 2 297 }, 298 1200: { 299 items: 3 300 } 301 } 302 }); 303 304/* =============================================== 305 12. ag-carousel 306 =============================================== */ 307 $('.ag-carousel .owl-carousel').owlCarousel({ 308 stagePadding: 0, 309 loop: true, 310 dots: true, 311 margin: 0, 312 nav: true, 313 navText: [ 314 '<i class="fas fa-arrow-left"></i>', 315 '<i class="fas fa-arrow-right"></i>' 316 ], 317 navContainer: '.ag-carousel .custom-nav', 318 responsive: { 319 0: { 320 items: 1 321 }, 322 767: { 323 items: 1 324 }, 325 1000: { 326 items: 1 327 } 328 } 329 }); 330 331/* =============================================== 332 13. CUSTOM CAROUSEL 333 =============================================== */ 334 $('.custom-carousel2 .owl-carousel').owlCarousel({ 335 stagePadding: 0, 336 loop: true, 337 dots: false, 338 margin: 10, 339 nav: true, 340 navText: [ 341 '<i class="fas fa-chevron-left"></i>', 342 '<i class="fas fa-chevron-right"></i>' 343 ], 344 navContainer: '.custom-carousel2 .custom-nav', 345 responsive: { 346 200: { 347 items: 1 348 }, 349 700: { 350 items: 2 351 }, 352 992: { 353 items: 3 354 } 355 } 356 }); 357 358/* =============================================== 359 14. MAGNIFIC POPUP GALLERY 360 =============================================== */ 361 function magnific_popup() { 362 $('.image-popup-vertical-fit').magnificPopup({ 363 type: 'image', 364 mainClass: 'mfp-with-zoom', 365 gallery: { 366 enabled: true 367 }, 368 zoom: { 369 enabled: true, 370 371 duration: 300, // duration of the effect, in milliseconds 372 easing: 'ease-in-out', // CSS transition easing function 373 374 opener: function (openerElement) { 375 376 return openerElement.is('img') ? openerElement : openerElement.find('img'); 377 } 378 } 379 }); 380 }; 381 382/* =============================================== 383 15. YOUTUBE POPUP 384 =============================================== */ 385 function video_popup() { 386 var $btnLoadMore = $( 387 '<div class="btn-wrapper text-center"><a href="#" class="btn load-more">Load More</a></div>' 388 ); 389 var items = $(".youtube-popup[data-listnum]"); 390 var count = items.length; 391 var slice = 2; 392 var current = 0; 393 394 if (items.length > slice) { 395 //bind load more event 396 $btnLoadMore.on("click", function (e) { 397 e.preventDefault();
398 loadMoreNews(); 399 }); 400 //append load more button 401 items.closest(".salvattore-grid").after($btnLoadMore); 402 } 403 404 function getItem(listnum) { 405 return items 406 .filter(function (index) { 407 if ($(this).attr("data-listnum") == listnum) { 408 return true; 409 } 410 }); 411 } 412 413 function loadMoreNews() { 414 var end = current + slice; 415 if (end >= count) { 416 end = count; 417 $btnLoadMore.hide(); 418 } 419 while (current < end) { 420 var listnum = current + 1; //data-listnum : 1-based 421 var item = getItem(listnum); 422 if (item) { 423 item.fadeIn(); 424 } 425 current++; 426 } 427 } 428 429 //youtube popup 430 $(".popup-youtube").magnificPopup({ 431 type: "iframe", 432 removalDelay: 160, 433 preloader: false, 434 fixedContentPos: false, 435 iframe: { 436 markup: '<div class="mfp-iframe-scaler">' + 437 '<div class="mfp-close"></div>' + 438 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' + 439 "</div>", 440 patterns: { 441 youtube: { 442 index: "youtube.com/", 443 id: "v=", 444 src: "//www.youtube.com/embed/%id%?autoplay=1&rel=0&showinfo=0" 445 } 446 }, 447 srcAction: "iframe_src" 448 } 449 }); 450 451 //init load 452 loadMoreNews(); 453 }; 454 455/* =============================================== 456 16. FILTER GALLERY 457 =============================================== */ 458 $(function () { 459 var $margin = $("#kehl-grid").isotope({ 460 itemSelector: ".grid-box", 461 // Different transition duration 462 transitionDuration: "0.5s" 463 }); 464 465 // on filter button click 466 $(".filter-container li").click(function (e) { 467 var $this = $(this); 468 469 // Prevent default behaviour 470 e.preventDefault(); 471 $('.filter li').removeClass('active'); 472 $this.addClass('active'); 473 474 // Get the filter data attribute from the button 475 var $filter = $this.attr("data-filter"); 476 477 // filter 478 $margin.isotope({ 479 filter: $filter 480 }); 481 }); 482 }); 483 484/* =============================================== 485 17. MASONRY GALLERY 486 =============================================== */ 487 var $grid = $('.grid').imagesLoaded( function() { 488 $grid.masonry({ 489 itemSelector: '.grid-box', 490 percentPosition: true, 491 columnWidth: '.grid-sizer' 492 }); 493 }); 494 495/* =============================================== 496 18. FAQ ACCORDION 497 =============================================== */ 498 function accordion() {}; 499 $('.accordion > li:eq(0) a').addClass('active').next().slideDown(); 500 501 $('.accordion a').click(function (j) { 502 var dropDown = $(this).closest('li').find('p'); 503 504 $(this).closest('.accordion').find('p').not(dropDown).slideUp(); 505 506 if ($(this).hasClass('active')) { 507 $(this).removeClass('active'); 508 } else { 509 $(this).closest('.accordion').find('a.active').removeClass('active'); 510 $(this).addClass('active'); 511 } 512 513 dropDown.stop(false, true).slideToggle(); 514 515 j.preventDefault(); 516 }); 517 (jQuery) 518 519 /* =============================================== 520 19. ANIMATION 521 =============================================== */ 522 AOS.init({ 523 duration: 1200, 524 }) 525 526 /* =============================================== 527 20. VIDEO POPUP 528 =============================================== */ 529 $('.popup-youtube, .popup-vimeo').magnificPopup({ 530 type: 'iframe', 531 disableOn: 700, 532 type: 'iframe', 533 mainClass: 'mfp-fade', 534 removalDelay: 160, 535 preloader: false,
536 fixedContentPos: false, 537 markup: '<div class="mfp-iframe-scaler">' + 538 '<div class="mfp-close"></div>' + 539 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' + 540 '</div>', // HTML markup of popup, `mfp-close` will be replaced by the close button 541 iframe: { 542 patterns: { 543 youtube: { 544 index: 'youtube.com/', 545 id: 'v=', 546 src: 'https://www.youtube.com/embed/%id%?autoplay=1' 547 } 548 } 549 } 550 });
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.