1/* ------------------------------------------------------- 2 3[ Custom settings ] 4 501. ScrollIt 602. Navbar scrolling background 703. Close navbar-collapse when a clicked 804. Sections background image from data background 905. Animations 1006. YouTubePopUp 1107. Testimonials owlCarousel 1208. Rooms 1 owlCarousel 1309. Rooms Page owlCarousel 1410. Pricing owlCarousel 1511. News owlCarousel 1612. Team owlCarousel 1713. Clients owlCarousel 1814. Restaurant Menu owlCarousel 1915. Restaurant Menu Tabs 2016. Accordion Box (for Faqs) 2117. MagnificPopup Gallery 2218. Smooth Scrolling 2319. Scroll back to top 2420. Select2 2521. Datapicker 2622. Slider 2723. Preloader 2824. Contact Form 29 30------------------------------------------------------- */ 31$(function () { 32 "use strict"; 33 var wind = $(window); 34 35 36 // ScrollIt 37 $.scrollIt({ 38 upKey: 38, // key code to navigate to the next section 39 downKey: 40, // key code to navigate to the previous section 40 easing: 'swing', // the easing function for animation 41 scrollTime: 600, // how long (in ms) the animation takes 42 activeClass: 'active', // class given to the active nav element 43 onPageChange: null, // function(pageIndex) that is called when page is changed 44 topOffset: -70 // offste (in px) for fixed top navigation 45 }); 46 47 48 // Navbar scrolling background 49 50 wind.on("scroll", function () { 51 var bodyScroll = wind.scrollTop(), 52 navbar = $(".navbar"), 53 logo = $(".navbar .logo> img"); 54 if (bodyScroll > 100) { 55 navbar.addClass("nav-scroll"); 56 logo.attr('src', 'https://shtheme.com/demosd/thecappawp/wp-content/uploads/2022/05/logo-dark.png'); 57 } else { 58 navbar.removeClass("nav-scroll"); 59 logo.attr('src', 'https://shtheme.com/demosd/thecappawp/wp-content/uploads/2022/05/logo.png'); 60 } 61 }); 62 63 64 65 // Close navbar-collapse when a clicked 66 $(".navbar-nav .dropdown-item a").on('click', function () { 67 $(".navbar-collapse").removeClass("show"); 68 }); 69 70 71 // Sections background image from data background 72 var pageSection = $(".bg-img, section"); 73 pageSection.each(function (indx) { 74 if ($(this).attr("data-background")) { 75 $(this).css("background-image", "url(" + $(this).data("background") + ")"); 76 } 77 }); 78 79 80 // Animations 81 var contentWayPoint = function () { 82 var i = 0; 83 $('.animate-box').waypoint(function (direction) { 84 if (direction === 'down' && !$(this.element).hasClass('animated')) { 85 i++; 86 $(this.element).addClass('item-animate'); 87 setTimeout(function () { 88 $('body .animate-box.item-animate').each(function (k) { 89 var el = $(this); 90 setTimeout(function () { 91 var effect = el.data('animate-effect'); 92 if (effect === 'fadeIn') { 93 el.addClass('fadeIn animated'); 94 } else if (effect === 'fadeInLeft') { 95 el.addClass('fadeInLeft animated'); 96 } else if (effect === 'fadeInRight') { 97 el.addClass('fadeInRight animated'); 98 } else { 99 el.addClass('fadeInUp animated'); 100 } 101 el.removeClass('item-animate'); 102 }, k * 200, 'easeInOutExpo'); 103 }); 104 }, 100); 105 } 106 }, { 107 offset: '85%' 108 }); 109 }; 110 $(function () { 111 contentWayPoint(); 112 }); 113 114 115 // YouTubePopUp 116 $("a.vid").YouTubePopUp(); 117 118 119 // Testimonials owlCarousel * 120 $('.testimonials .owl-carousel').owlCarousel({ 121 loop: true, 122 margin: 30, 123 mouseDrag: true, 124 autoplay: false, 125 dots: true, 126 nav: false, 127 navText: ["<span class='lnr ti-angle-left'></span>", "<span class='lnr ti-angle-right'></span>"], 128 responsiveClass: true, 129 responsive: { 130 0: { 131 items: 1, 132 }, 133 600: { 134 items: 1 135 }, 136 1000: { 137 items: 1 138 } 139 } 140 }); 141 142 // Rooms 1 owlCarousel * 143 $('.rooms1 .owl-carousel').owlCarousel({ 144 loop: true, 145 margin: 30, 146 mouseDrag: true, 147 autoplay: false, 148 dots: true, 149 autoplayHoverPause: true, 150 nav: false, 151 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 152 responsiveClass: true, 153 responsive: { 154 0: { 155 items: 1, 156 }, 157 600: { 158 items: 2 159 }, 160 1000: { 161 items: 3 162 } 163 } 164 }); 165 166 // Rooms 2 owlCarousel * 167 $('.rooms2 .owl-carousel').owlCarousel({ 168 loop: true, 169 margin: 30, 170 mouseDrag: true, 171 autoplay: false, 172 dots: true, 173 autoplayHoverPause: true, 174 nav: false, 175 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 176 responsiveClass: true, 177 responsive: { 178 0: { 179 items: 1, 180 }, 181 600: { 182 items: 1 183 }, 184 1000: { 185 items: 1 186 } 187 } 188 }); 189 190 // Rooms 3 owlCarousel * 191 $('.rooms3 .owl-carousel').owlCarousel({ 192 loop: true, 193 margin: 30, 194 mouseDrag: true, 195 autoplay: false, 196 dots: true, 197 autoplayHoverPause: true, 198 nav: false, 199 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 200 responsiveClass: true, 201 responsive: { 202 0: { 203 items: 1, 204 }, 205 600: { 206 items: 2 207 }, 208 1000: { 209 items: 3 210 } 211 } 212 }); 213 214 // Rooms Page owlCarousel * 215 $('.rooms-page .owl-carousel').owlCarousel({ 216 loop: true, 217 margin: 30, 218 mouseDrag: true, 219 autoplay: true, 220 dots: false, 221 nav: false, 222 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 223 responsiveClass: true, 224 responsive: { 225 0: { 226 items: 1, 227 }, 228 600: { 229 items: 1 230 }, 231 1000: { 232 items: 1 233 } 234 } 235 }); 236 237 // Pricing owlCarousel * 238 $('.pricing .owl-carousel').owlCarousel({ 239 loop: true, 240 margin: 30, 241 mouseDrag: true, 242 autoplay: false, 243 dots: true, 244 autoplayHoverPause: true, 245 nav: false, 246 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 247 responsiveClass: true, 248 responsive: { 249 0: { 250 items: 1 251 }, 252 600: { 253 items: 1 254 }, 255 1000: { 256 items: 2 257 } 258 } 259 }); 260 261 // News owlCarousel * 262 $('.news .owl-carousel').owlCarousel({ 263 loop: true, 264 margin: 30, 265 mouseDrag: true, 266 autoplay: false, 267 dots: false, 268 nav: true, 269 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 270 responsiveClass: true, 271 responsive: { 272 0: { 273 items: 1, 274 dots: true, 275 nav: false 276 }, 277 600: { 278 items: 2, 279 dots: true, 280 nav: false 281 }, 282 1000: { 283 items: 3 284 } 285 } 286 }); 287 288 // Team owlCarousel * 289 $('.team .owl-carousel').owlCarousel({ 290 loop: true, 291 margin: 30, 292 dots: true, 293 mouseDrag: true, 294 autoplay: false, 295 nav: false, 296 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 297 responsiveClass: true, 298 responsive: { 299 0: { 300 items: 1, 301 dots: true 302 }, 303 600: { 304 items: 2 305 }, 306 1000: { 307 items: 3 308 } 309 } 310 }); 311 312 // Clients owlCarousel * 313 $('.clients .owl-carousel').owlCarousel({ 314 loop: true, 315 margin: 30, 316 mouseDrag: true, 317 autoplay: true, 318 dots: false, 319 nav: false, 320 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 321 responsiveClass: true, 322 responsive: { 323 0: { 324 margin: 10, 325 items: 3 326 }, 327 600: { 328 items: 3 329 }, 330 1000: { 331 items: 3 332 } 333 } 334 }); 335 336 // Restaurant Menu owlCarousel
337 $('.restaurant-menu .owl-carousel').owlCarousel({ 338 loop: true, 339 margin: 0, 340 autoplay: false, 341 dots: false, 342 nav: true, 343 navText: ["<span class='lnr ti-angle-left'></span>","<span class='lnr ti-angle-right'></span>"], 344 responsiveClass: true, 345 responsive: { 346 0: { 347 items: 2, 348 nav: false 349 }, 350 600: { 351 items: 3, 352 nav: false 353 }, 354 1000: { 355 items: 4 356 } 357 } 358 }); 359 360 // Restaurant Menu Tabs 361 $(".restaurant-menu .tabs-icon").on("click", ".item", function () { 362 $(".item").removeClass("active"); 363 var myID = $(this).attr("id"); 364 $(".restaurant-menu .cont").hide(); 365 $("#" + myID + "-content").fadeIn(); 366 }); 367 $(".restaurant-menu .tabs-icon").on("click", ".owl-item", function () { 368 $(this).addClass("actived").siblings().removeClass("actived"); 369 }); 370 371 372 373 // Accordion Box (for Faqs) 374 if ($(".accordion-box").length) { 375 $(".accordion-box").on("click", ".acc-btn", function () { 376 var outerBox = $(this).parents(".accordion-box"); 377 var target = $(this).parents(".accordion"); 378 if ($(this).next(".acc-content").is(":visible")) { 379 //return false; 380 $(this).removeClass("active"); 381 $(this).next(".acc-content").slideUp(300); 382 $(outerBox).children(".accordion").removeClass("active-block"); 383 } else { 384 $(outerBox).find(".accordion .acc-btn").removeClass("active"); 385 $(this).addClass("active"); 386 $(outerBox).children(".accordion").removeClass("active-block"); 387 $(outerBox).find(".accordion").children(".acc-content").slideUp(300); 388 target.addClass("active-block"); 389 $(this).next(".acc-content").slideDown(300); 390 } 391 }); 392 } 393 394 395 // MagnificPopup Gallery 396 $('.gallery').magnificPopup({ 397 delegate: '.popimg', 398 type: 'image', 399 gallery: { 400 enabled: true 401 } 402 }); 403 $(".img-zoom").magnificPopup({ 404 type: "image", 405 closeOnContentClick: !0, 406 mainClass: "mfp-fade", 407 gallery: { 408 enabled: !0, 409 navigateByImgClick: !0, 410 preload: [0, 1] 411 } 412 }) 413 $('.magnific-youtube, .magnific-vimeo, .magnific-custom').magnificPopup({ 414 disableOn: 700, 415 type: 'iframe', 416 mainClass: 'mfp-fade', 417 removalDelay: 300, 418 preloader: false, 419 fixedContentPos: false 420 }); 421 422 423 // Smooth Scrolling 424 $('a[href*="#"]') 425 // Remove links that don't actually link to anything 426 .not('[href="#"]').not('[href="#0"]').click(function (event) { 427 // On-page links 428 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 429 // Figure out element to scroll to 430 var target = $(this.hash); 431 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 432 // Does a scroll target exist? 433 if (target.length) { 434 // Only prevent default if animation is actually gonna happen 435 event.preventDefault(); 436 $('html, body').animate({ 437 scrollTop: target.offset().top 438 }, 1000, function () { 439 // Callback after animation 440 // Must change focus! 441 var $target = $(target); 442 $target.focus(); 443 if ($target.is(":focus")) { // Checking if the target was focused 444 return false; 445 } else { 446 $target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable 447 $target.focus(); // Set focus again 448 }; 449 }); 450 } 451 } 452 }); 453 454 // Scroll back to top 455 var progressPath = document.querySelector('.progress-wrap path'); 456 var pathLength = progressPath.getTotalLength(); 457 progressPath.style.transition = progressPath.style.WebkitTransition = '
457none'; 458 progressPath.style.strokeDasharray = pathLength + ' ' + pathLength; 459 progressPath.style.strokeDashoffset = pathLength; 460 progressPath.getBoundingClientRect(); 461 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 462 var updateProgress = function () { 463 var scroll = $(window).scrollTop(); 464 var height = $(document).height() - $(window).height(); 465 var progress = pathLength - (scroll * pathLength / height); 466 progressPath.style.strokeDashoffset = progress; 467 } 468 updateProgress(); 469 $(window).scroll(updateProgress); 470 var offset = 150; 471 var duration = 550; 472 jQuery(window).on('scroll', function () { 473 if (jQuery(this).scrollTop() > offset) { 474 jQuery('.progress-wrap').addClass('active-progress'); 475 } else { 476 jQuery('.progress-wrap').removeClass('active-progress'); 477 } 478 }); 479 jQuery('.progress-wrap').on('click', function (event) { 480 event.preventDefault(); 481 jQuery('html, body').animate({ 482 scrollTop: 0 483 }, duration); 484 return false; 485 }) 486 487 488 // Select2 489 $('.select2').select2({ 490 minimumResultsForSearch: Infinity, 491 }); 492 493 494 // Datapicker 495 $(".datepicker").datepicker({ 496 orientation: "top" 497 }); 498 499}); 500 501 502// Slider 503$(document).ready(function () { 504 var owl = $('.header .owl-carousel'); 505 506 // Slider owlCarousel - (Inner Page Slider) 507 $('.slider .owl-carousel').owlCarousel({ 508 items: 1, 509 loop: true, 510 dots: true, 511 margin: 0, 512 autoplay: true, 513 autoplayTimeout: 5000, 514 nav: false, 515 navText: ['<i class="ti-angle-left" aria-hidden="true"></i>', '<i class="ti-angle-right" aria-hidden="true"></i>'], 516 responsiveClass: true, 517 responsive: { 518 0: { 519 dots: true 520 }, 521 600: { 522 dots: true 523 }, 524 1000: { 525 dots: true 526 } 527 } 528 }); 529 530 // Slider owlCarousel (Homepage Slider) 531 $('.slider-fade .owl-carousel').owlCarousel({ 532 items: 1, 533 loop: true, 534 dots: true, 535 margin: 0, 536 autoplay: true, 537 autoplayTimeout: 5000, 538 animateOut: 'fadeOut', 539 nav: false, 540 navText: ['<i class="ti-angle-left" aria-hidden="true"></i>', '<i class="ti-angle-right" aria-hidden="true"></i>'], 541 responsiveClass: true, 542 responsive: { 543 0: { 544 dots: false 545 }, 546 600: { 547 dots: false 548 }, 549 1000: { 550 dots: true 551 } 552 } 553 }); 554 owl.on('changed.owl.carousel', function (event) { 555 var item = event.item.index - 2; // Position of the current item 556 $('span').removeClass('animated fadeInUp'); 557 $('h4').removeClass('animated fadeInUp'); 558 $('h1').removeClass('animated fadeInUp'); 559 $('p').removeClass('animated fadeInUp'); 560 $('.butn-light').removeClass('animated fadeInUp'); 561 $('.butn-dark').removeClass('animated fadeInUp'); 562 $('.owl-item').not('.cloned').eq(item).find('span').addClass('animated fadeInUp'); 563 $('.owl-item').not('.cloned').eq(item).find('h4').addClass('animated fadeInUp'); 564 $('.owl-item').not('.cloned').eq(item).find('h1').addClass('animated fadeInUp'); 565 $('.owl-item').not('.cloned').eq(item).find('p').addClass('animated fadeInUp'); 566 $('.owl-item').not('.cloned').eq(item).find('.butn-light').addClass('animated fadeInUp'); 567 $('.owl-item').not('.cloned').eq(item).find('.butn-dark').addClass('animated fadeInUp'); 568 }); 569}); 570 571 572// Preloader 573$("#preloader").fadeOut(700); 574 $(".preloader-bg").delay(700).fadeOut(700); 575 var wind = $(window); 576 577 578// Contact Form 579var form = $('.contact__form'), 580 message = $('.contact__msg'), 581 form_data; 582 // success function 583 function done_func(response) { 584 message.fadeIn().removeClass('alert-danger').addClass('alert-success'); 585 message.text(response); 586 setTimeout(function () { 587 message.fadeOut(); 588 }, 2000);
589 form.find('input:not([type="submit"]), textarea').val(''); 590 } 591 // fail function 592 function fail_func(data) { 593 message.fadeIn().removeClass('alert-success').addClass('alert-success'); 594 message.text(data.responseText); 595 setTimeout(function () { 596 message.fadeOut(); 597 }, 2000); 598 } 599 form.submit(function (e) { 600 e.preventDefault(); 601 form_data = $(this).serialize(); 602 $.ajax({ 603 type: 'POST', 604 url: form.attr('action'), 605 data: form_data 606 }).done(done_func).fail(fail_func); 607 });
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.