1(function($) { 2 3 4 var mainwindow = $(window); 5 6 // rev-slider 7 if (jQuery("#slider1").length) { 8 jQuery("#slider1").revolution({ 9 sliderType: "standard", 10 sliderLayout: "fullwidth", 11 delay: 5000, 12 navigation: { 13 keyboardNavigation: "on", 14 keyboard_direction: "horizontal", 15 mouseScrollNavigation: "off", 16 onHoverStop: "on", 17 arrows: { 18 style: 'zeus', 19 tmp: '<div class="tp-title-wrap"><div class="tp-arr-imgholder"></div></div>', 20 enable: true, 21 rtl: false, 22 hide_onmobile: false, 23 hide_onleave: false, 24 hide_delay: 200, 25 hide_delay_mobile: 1200, 26 hide_under: 0, 27 hide_over: 9999, 28 tmp: '' 29 } 30 }, 31 parallax: { 32 type: "scroll", 33 origo: "slidercenter", 34 speed: 1000, 35 levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 100, 55], 36 type: "scroll", 37 }, 38 responsiveLevels: [1240, 1024, 778, 480], 39 visibilityLevels: [1240, 1024, 778, 480], 40 gridwidth: [1170, 1024, 778, 480], 41 gridheight: [850, 768, 960, 720] 42 43 }); 44 }; 45 46 // rev-slider 47 if (jQuery("#slider2").length) { 48 jQuery("#slider2").revolution({ 49 sliderType: "standard", 50 sliderLayout: "fullwidth", 51 delay: 5000, 52 navigation: { 53 keyboardNavigation: "on", 54 keyboard_direction: "horizontal", 55 mouseScrollNavigation: "off", 56 onHoverStop: "on", 57 arrows: { 58 style: 'zeus', 59 tmp: '<div class="tp-title-wrap"><div class="tp-arr-imgholder"></div></div>', 60 enable: true, 61 rtl: false, 62 hide_onmobile: false, 63 hide_onleave: false, 64 hide_delay: 200, 65 hide_delay_mobile: 1200, 66 hide_under: 0, 67 hide_over: 9999, 68 tmp: '' 69 } 70 }, 71 parallax: { 72 type: "scroll", 73 origo: "slidercenter", 74 speed: 1000, 75 levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 100, 55], 76 type: "scroll", 77 }, 78 responsiveLevels: [1240, 1024, 778, 480], 79 visibilityLevels: [1240, 1024, 778, 480], 80 gridwidth: [1170, 1024, 778, 480], 81 gridheight: [650, 768, 960, 720] 82 }); 83 }; 84 85 // rev-slider 86 if (jQuery("#slider3").length) { 87 jQuery("#slider3").revolution({ 88 sliderType: "standard", 89 sliderLayout: "fullwidth", 90 delay: 5000, 91 navigation: { 92 keyboardNavigation: "on", 93 keyboard_direction: "horizontal", 94 mouseScrollNavigation: "off", 95 onHoverStop: "on", 96 arrows: { 97 style: 'zeus', 98 tmp: '<div class="tp-title-wrap"><div class="tp-arr-imgholder"></div></div>', 99 enable: true, 100 rtl: false, 101 hide_onmobile: false, 102 hide_onleave: false, 103 hide_delay: 200, 104 hide_delay_mobile: 1200, 105 hide_under: 0, 106 hide_over: 9999, 107 tmp: '' 108 } 109 }, 110 parallax: { 111 type: "scroll", 112 origo: "slidercenter", 113 speed: 1000, 114 levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 100, 55], 115 type: "scroll", 116 }, 117 responsiveLevels: [1240, 1024, 778, 480], 118 visibilityLevels: [1240, 1024, 778, 480], 119 gridwidth: [1170, 1024, 778, 480], 120 gridheight: [800, 768, 960, 720] 121 }); 122 }; 123 124 //Hide Loading Box (Preloader) 125 function stylePreloader() { 126 if ($('.preloader').length) { 127 $('.preloader').delay(200).fadeOut(500); 128 } 129 } 130 131 132 133 134 135 $(function() { 136 var $grid = $('.list-project').isotope({ 137 itemSelector: '.project', 138 //layoutMode: 'fitRows' 139 //filter: '.project_category-snow-removal', 140 percentPosition: true, 141 masonry: { 142 columnWidth: '.project' 143 } 144 }); 145 // filter items on button click 146 $('.filter').on('click', 'li', function() { 147 var filterValue = $(this).attr('data-filter'); 148 $grid.isotope({ filter: filterValue }); 149 $(this).addClass('active'); 150 }); 151 152 153 }); 154 155 156//new js for nav 157let sections = document.querySelectorAll('section'); 158let navLinks = document.querySelectorAll('#site-navigation a'); 159 160window.onscroll = () => { 161 sections.forEach(sec => { 162 let top = window.scrollY; 163 let offset = sec.offsetTop - 150; 164 let height = sec.offsetHeight; 165 let id = sec.getAttribute('id'); 166 167 if (top >= offset && top < offset + height) { 168 navLinks.forEach(link => { 169 link.classList.remove('active'); 170 }); 171 document.querySelector('#site-navigation a[href*=' + id + ']').classList.add('active'); 172 } 173 }); 174}; 175 176 177 178 179 180 //Accordion Box 181 if ($('.accordion-box').length) { 182 $(".accordion-box").on('click', '.acc-btn', function() { 183 184 var outerBox = $(this).parents('.accordion-box'); 185 var target = $(this).parents('.accordion'); 186 187 if ($(this).hasClass('active') !== true) { 188 $('.accordion .acc-btn').removeClass('active'); 189 190 } 191 192 if ($(this).next('.acc-content').is(':visible')) { 193 return false;
194 } else { 195 $(this).addClass('active'); 196 $(outerBox).children('.accordion').removeClass('active-block'); 197 $(outerBox).children('.accordion').children('.acc-content').slideUp(300); 198 target.addClass('active-block'); 199 $(this).next('.acc-content').slideDown(300); 200 } 201 }); 202 } 203 204 205 if ($('#accordion > .panel').length) { 206 $('#accordion > .panel').on('show.bs.collapse', function(e) { 207 var heading = $(this).find('.panel-heading'); 208 heading.addClass("active-panel"); 209 210 }); 211 $('#accordion > .panel').on('hidden.bs.collapse', function(e) { 212 var heading = $(this).find('.panel-heading'); 213 heading.removeClass("active-panel"); 214 }); 215 } 216 217 218 219 220 221 //--service-list-- 222 if ($('.slide-partener').length) { 223 $('.slide-partener').owlCarousel({ 224 loop: true, 225 margin: 30, 226 nav: true, 227 smartSpeed: 500, 228 autoplay: 4000, 229 items: 1, 230 dots: false, 231 navText: ['<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>'], 232 responsive: { 233 0: { 234 items: 2, 235 margin: 0 236 }, 237 600: { 238 items: 2, 239 }, 240 800: { 241 items: 4 242 }, 243 1024: { 244 items: 5 245 }, 246 1200: { 247 items: 5 248 } 249 } 250 }); 251 } 252 253 254 document.addEventListener('DOMContentLoaded', function () { 255 // Select all links with hashes 256 document.querySelectorAll('a[href^="#"]').forEach(anchor => { 257 // Listen for click event 258 anchor.addEventListener('click', function (e) { 259 // Prevent the default behavior of the anchor link 260 e.preventDefault(); 261 262 // Scroll smoothly to the target section 263 document.querySelector(this.getAttribute('href')).scrollIntoView({ 264 behavior: 'smooth' 265 }); 266 }); 267 }); 268 }); 269 270 271 272 //LightBox / Fancybox 273 if ($('.fancybox').length) { 274 $('.fancybox').fancybox({ 275 openEffect: 'fade', 276 closeEffect: 'fade', 277 helpers: { 278 media: {} 279 } 280 }); 281 } 282 283 284 285 286 287 288 // FAQs 289 if ($('.fp-faq').length) { 290 $('.fp-faq').on('click', 'h2', function() { 291 var $faq = $(this).closest('.fp-faq'); 292 293 $faq.find('.toggle-content').slideToggle(500, function() { 294 $faq.toggleClass('active'); 295 }); 296 }); 297 } 298 if ($('.fp-accordion').length) { 299 300 $('.fp-accordion').on('click', 'h2, .icons', function() { 301 var $faq = $(this).closest('.fp-accordion'); 302 303 $faq.find('.toggle-content').slideToggle(500, function() { 304 $faq.toggleClass('active'); 305 }); 306 }); 307 } 308 309 310 311 312 //Update header style + Scroll to Top 313 function scrolltotop() { 314 if ($('.scroll-to-top').length) { 315 var windowpos = mainwindow.scrollTop(); 316 if (windowpos >= 250) { 317 $('.scroll-to-top').fadeIn(300); 318 } else { 319 $('.scroll-to-top').fadeOut(300); 320 } 321 } 322 } 323 324 // Scroll to a Specific Div 325 if ($('.scroll-to-target').length) { 326 $(".scroll-to-target").on('click', function() { 327 var target = $(this).attr('data-target'); 328 // animate 329 $('html, body').animate({ 330 scrollTop: $(target).offset().top 331 }, 1000); 332 333 }); 334 } 335 336 337 338 339 340 // slider-range 341 if ($('#slider-range').length) { 342 $(function() { 343 $("#slider-range").slider({ 344 range: true, 345 min: 0, 346 max: 500, 347 values: [75, 300], 348 slide: function(event, ui) { 349 $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]); 350 } 351 }); 352 $("#amount").val("$" + $("#slider-range").slider("values", 0) + 353 " - $" + $("#slider-range").slider("values", 1)); 354 }); 355 } 356 357 358 //Input Quantity Up & Down 359 function quantity_changer() { 360 $('#quantity-holder').on('click', '.quantity-plus', function() { 361 var $holder = $(this).parents('.quantity-holder'); 362 var $target = $holder.find('input.quantity-input'); 363 var $quantity = parseInt($target.val(), 10); 364 if ($.isNumeric($quantity) && $quantity > 0) { 365 $quantity = $quantity + 1; 366 $target.val($quantity); 367 } else { 368 $target.val($quantity); 369 } 370 }).on('click', '.quantity-minus', function() { 371 var $holder = $(this).parents('.quantity-holder'); 372 var $target = $holder.find('input.quantity-input'); 373 var $quantity = parseInt($target.val(), 10); 374 if ($.isNumeric($quantity) && $quantity >= 2) { 375 $quantity = $quantity - 1; 376 $target.val($quantity); 377 } else { 378 $target.val(1); 379 } 380 }); 381 382 } 383 384 385 386 //counter number changer 387 function counter_number() { 388 var timer = $('.timer'); 389 if (timer.length) {
390 timer.appear(function() { 391 timer.countTo(); 392 }) 393 } 394 } 395 396 397 398 399 /* ========================================================================== 400 Contact Form Validation and Ajax 401 ========================================================================== */ 402 403 $('#contact-form').validate({ 404 rules: { 405 name: { 406 required: true 407 }, 408 email: { 409 required: true, 410 minlength: 5, 411 email: true 412 }, 413 phone: { 414 required: true 415 }, 416 message: { 417 required: true, 418 minlength: 10 419 } 420 }, 421 messages: { 422 name: "Please specify your name", 423 email: { 424 required: "We need your email address to contact you", 425 email: "Your email address must be in the format of [email protected]" 426 }, 427 phone: "Please specify your phone number", 428 message: { 429 required: "Please specify your message", 430 minlength: jQuery.validator.format("At least {0} characters required!") 431 } 432 }, 433 submitHandler: function(e) { 434 var $t = $(e); 435 $.ajax({ 436 type: 'POST', 437 url: $t.attr('action'), 438 data: $t.serialize(), 439 beforeSend: function() { 440 $("#loading").show(); 441 }, 442 complete: function() { 443 $("#loading").hide(); 444 }, 445 success: function(res) { 446 $('.contact-form-message').show().html(res).delay(10000).fadeOut("slow"); 447 $('input[name=\'name\']').val(''); 448 $('input[name=\'email\']').val(''); 449 $('input[name=\'phone\']').val(''); 450 $('textarea[name=\'message\']').val(''); 451 } 452 }); 453 } 454 }); 455 456 457 458 459 460 //hide all tabs first 461 $('.tab-content').hide(); 462 //show the first tab content 463 $('#tab-1').show(); 464 465 $('#select-box').change(function() { 466 dropdown = $('#select-box').val(); 467 //first hide all tabs again when a new option is selected 468 $('.tab-content').hide(); 469 //then show the tab content of whatever option value was selected 470 $('#' + "tab-" + dropdown).show(); 471 }); 472 473 474 475 476 477 /* ========================================================================== 478 When document is ready, do 479 ========================================================================== */ 480 481 $(document).on('ready', function() { 482 counter_number(); 483 quantity_changer(); 484 }); 485 486 487 488 /* ========================================================================== 489 When document is Scrollig, do 490 ========================================================================== */ 491 492 mainwindow.on('scroll', function() { 493 scrolltotop(); 494 495 }); 496 497 /* ========================================================================== 498 When document is loading, do 499 ========================================================================== */ 500 501 mainwindow.on('load', function() { 502 stylePreloader(); 503 }); 504 505 506 /* ========================================================================== 507 When Window is resizing, do 508 ========================================================================== */ 509 510 mainwindow.on('resize', function() {}); 511 512 513 514 515})(window.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.