1/** 2* 3* -------------------------------------------------------------------- 4* 5* Template : Reobiz - Creative Portfolio WordPress Theme 6* Author : rs-theme 7* Author URI : http://www.rstheme.com/ 8* 9* -------------------------------------------------------------------- 10* 11**/ 12 13(function($) { 14 "use strict"; 15 // Smooth Scroling 16 if ($('.rs-smoother-yes').length) { 17 const lenis = new Lenis({ 18 smoothWheel: true, 19 wheelMultiplier: 1.2, 20 duration: 1.5, 21 lerp: 0.1, 22 }); 23 24 function raf(time) { 25 lenis.raf(time); 26 requestAnimationFrame(raf); 27 } 28 requestAnimationFrame(raf); 29 30 // Handle scroll animation for anchor links 31 document.querySelectorAll('a[href^="#"]').forEach((el) => { 32 el.addEventListener('click', (e) => { 33 e.preventDefault() 34 const id = el.getAttribute('href')?.slice(1) 35 if (!id) return 36 const target = document.getElementById(id) 37 if (target) { 38 target.scrollIntoView({ behavior: 'smooth' }) 39 } 40 }) 41 }); 42 43 // Function to handle lenis prevent for dynamic select woo checkout 44 if ($('body.woocommerce-checkout').length) { 45 const lenisPreventDynamic = () => { 46 document.querySelectorAll('.select2-results__options:not([data-lenis-prevent])').forEach((el) => { 47 el.setAttribute('data-lenis-prevent', ''); 48 }); 49 }; 50 const observer = new MutationObserver((mutationsList) => { 51 mutationsList.forEach((mutation) => { 52 mutation.addedNodes.forEach((node) => { 53 if (node.nodeType === 1 && node.matches('.select2-results__options')) { 54 lenisPreventDynamic(); 55 } else if (node.nodeType === 1 && node.querySelector('.select2-results__options')) { 56 lenisPreventDynamic(); 57 } 58 }); 59 }); 60 }); 61 observer.observe(document.body, { 62 childList: true, 63 subtree: true, 64 }); 65 lenisPreventDynamic(); 66 } 67 } 68 69 // sticky menu 70 var header = $('.menu-sticky'); 71 var win = $(window); 72 var headerinnerHeight = $(".header-inner").innerHeight(); 73 74 win.on('scroll', function() { 75 var scroll = win.scrollTop(); 76 if (scroll < headerinnerHeight) { 77 header.removeClass("sticky"); 78 79 } else { 80 header.addClass("sticky"); 81 } 82 }); 83 $('.header-inner').waypoint('sticky', { 84 offset: 0 85 }); 86 87 $(".widget_nav_menu li a").filter(function(){ 88 return $.trim($(this).html()) == ''; 89 }).hide(); 90 91 // Slider init 92 $('.rs-slider-carousel').slick({ 93 centerPadding: '0px', 94 slidesToShow: 1, 95 slidesToScroll: 1, 96 adaptiveHeight: true 97 }); 98 99 100 // video 101 if ($('.player').length) { 102 $(".player").YTPlayer(); 103 } 104 // Mouse Pointer 105 106 if ($('.pointer-wrap').length) { 107 const cursor = cursorDot({ 108 diameter: parseInt(pointer_data.diameter), 109 borderWidth: parseInt(pointer_data.border_width), 110 borderColor: String(pointer_data.pointer_border), 111 easing: parseInt(pointer_data.speed), 112 background: String(pointer_data.pointer_bg) 113 }) 114 cursor.over("a", { 115 scale: parseFloat(pointer_data.scale) 116 }); 117 118 } 119 120 // Magnific Popup Box 121 var rsaddon_PRObox = $('.rsaddon_pro_box'); 122 if(rsaddon_PRObox.length) { 123 $('.rsaddon_pro_box').magnificPopup({ 124 delegate: '.pointer-events', 125 removalDelay: 500, 126 callbacks: { 127 beforeOpen: function() { 128 this.st.mainClass = this.st.el.attr('data-effect'); 129 } 130 }, 131 midClick: true 132 }); 133 } 134 135 if ($('.rs-newsletter-section-wrap').length) { 136 $(document).on("ready", function () { 137 if (document.cookie.indexOf("accepted_cookies=") < 0) { 138 $(".rs-cookie-overlay").removeClass("d-none").addClass("d-block"); 139 $("body").removeClass("newsletter-disable").addClass("newsletter-enable"); 140 } 141 $(".rs-accept-cookies").on("click", function () { 142 document.cookie = "accepted_cookies=yes;"; 143 $(".rs-cookie-overlay").removeClass("d-block").addClass("d-none"); 144 $("body").removeClass("newsletter-enable").addClass("newsletter-disable"); 145 });
146 $(".close-cookies").on("click", function () { 147 $(".rs-cookie-overlay").removeClass("d-block").addClass("d-none"); 148 $("body").removeClass("newsletter-enable").addClass("newsletter-disable"); 149 }); 150 }); 151 } 152 153 $(".menu-area .navbar ul > li.menu-item-has-children").on('hover', 154 function () { 155 $(this).addClass('hover-minimize'); 156 }, 157 function () { 158 $(this).removeClass("hover-minimize"); 159 } 160 ); 161 162 $(".showcase-item").on('hover', function() { 163 $(this).toggleClass("hover"); 164 }); 165 166 167 //Phone Number 168 169 $('.phone_call').on('click', function(event) { 170 $('.phone_num_call').slideToggle('show'); 171 }); 172 173 //search 174 175 $('.sticky_search').on('click', function(event) { 176 $('.sticky_form').slideToggle('show'); 177 $( '.sticky_form input' ).focus(); 178 }); 179 180 181 $('.sticky_search').on('click', function() { 182 $('body').removeClass('search-active').removeClass('search-close'); 183 if ($(this).hasClass('close-full')) { 184 $('body').addClass('search-close'); 185 } 186 else { 187 $('body').addClass('search-active'); 188 } 189 return false; 190 }); 191 192 193 $('.nav-link-container').on('click', function(e){ 194 $('body.on-offcanvas').removeClass('on-offcanvas'); 195 setTimeout(function(){ $('body').addClass('on-offcanvas'); },500); 196 }); 197 198 199 200 $('.sticky_form_search').on('click', function() { 201 $('body, html').removeClass('rs-search-active').removeClass('rs-search-close'); 202 if ($(this).hasClass('close-search')) { 203 $('body, html').addClass('rs-search-close'); 204 205 } 206 else { 207 $('body, html').addClass('rs-search-active'); 208 } 209 return false; 210 }); 211 212 213 if($('#rs-header').hasClass('fixed-menu')){ 214 $('body').addClass('body-left-space'); 215 } 216 217 $("#rs-header ul > li.classic").on('hover', 218 function () { 219 $('body').addClass('mega-classic'); 220 }, 221 function () { 222 $('body.mega-classic').removeClass("mega-classic"); 223 } 224 ); 225 226 $(document).ready(function(){ 227 function resizeNav() { 228 $(".menu-ofcn").css({"height": window.innerHeight}); 229 var radius = Math.sqrt(Math.pow(window.innerHeight, 2) + Math.pow(window.innerWidth, 2)); 230 var diameter = radius * 2; 231 $(".off-nav-layer").width(diameter); 232 $(".off-nav-layer").height(diameter); 233 $(".off-nav-layer").css({"margin-top": -radius, "margin-left": -radius}); 234 } 235 $(".menu-button, .close-button, .offwrap").on('click', function() { 236 $(".nav-toggle, .off-nav-layer, .menu-ofcn, .close-button, body").toggleClass("off-open"); 237 }); 238 $(window).resize(resizeNav); 239 resizeNav(); 240 }); 241 242 //One page menu js 243 if ($('.page-template-page-single-php .nav').length) { 244 $('#single-menu li:first-child, .sidenav li:first-child').addClass('active'); 245 $('#single-menu a, .sidenav a').on('click', function(){ 246 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 247 var target = $(this.hash); 248 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 249 $('#single-menu li, .sidenav li').removeClass('active'); 250 $(this).parent('li').addClass('active'); 251 if (target.length) { 252 $('html, body').animate({ 253 scrollTop: (target.offset().top - 70) 254 }, 1000, "easeInOutExpo"); 255 return false; 256 } 257 } 258 }); 259 260 var navChildren = $("#single-menu li.menu-item").children("a"); 261 var aArray = []; 262 for (var i = 0; i < navChildren.length; i++) { 263 var aChild = navChildren[i]; 264 var ahref = $(aChild).attr('href'); 265 aArray.push(ahref); 266 } 267 } 268 269 if ($('.page-template-page-single').length) { 270 // Select all navigation links 271 const navLinks = document.querySelectorAll('nav a'); 272 function updateActiveLink() { 273 const sections = document.querySelectorAll('section, header'); 274 sections.forEach((section) => { 275 const rect = section.getBoundingClientRect(); 276 if (rect.top <= 150 && rect.bottom >= 150) { 277 const targetLink = document.querySelector(`nav a[href="#${section.id}"]`); 278 navLinks.forEach(link => link.classList.remove('rs-active-section')); 279 if(targetLink) { 280 targetLink.classList.add('rs-active-section'); 281 } 282 } 283 }); 284 } 285 window.addEventListener('scroll', updateActiveLink); 286 updateActiveLink(); 287 } 288 289 $('.menu li a').on('click', function () { 290 $('.nav-container').removeClass('nav-active-menu-container') 291 }); 292 293 // Get a quote popup 294 295 $('.popup-quote').magnificPopup({ 296 type: 'inline', 297 preloader: false, 298 focus: '#qname', 299 removalDelay: 500, //delay removal by X to allow out-animation 300 // When elemened is focused, some mobile browsers in some cases zoom in 301 // It looks not nice, so we disable it: 302 callbacks: { 303 beforeOpen: function() { 304 this.st.mainClass = this.st.el.attr('data-effect'); 305 if($(window).width() < 700) { 306 this.st.focus = false;
307 } else { 308 this.st.focus = '#qname'; 309 } 310 } 311 } 312 }); 313 314 315 // Canvas Menu Js 316 $( ".nav-link-container > a" ).off("click").on("click", function(event){ 317 event.preventDefault(); 318 $(".nav-link-container").toggleClass("nav-inactive-menu-link-container"); 319 $(".mobile-menus").toggleClass("nav-active-menu-container"); 320 }); 321 322 $(".nav-close-menu-li > a").on('click', function(event){ 323 $(".mobile-menus").toggleClass("nav-active-menu-container"); 324 $(".content").toggleClass("inactive-body"); 325 }); 326 327 328 // Single Menu Js 329 $( "body.page-template-page-single .mobile-menu-link > a, body.page-template-page-single .sidenav li.nav-link-container a" ).off("click").on("click", function(event){ 330 event.preventDefault(); 331 $(".mobile-menu-container").toggleClass("nav-inactive-menu-link-container"); 332 $(".mobile-menu-container").toggleClass("nav-active-menu-container"); 333 }); 334 335 336 $(".rs-heading h3").each(function() { 337 338 // Some Vars 339 var elText, 340 openSpan = '<span class="first-word">', 341 closeSpan = '</span>'; 342 343 // Make the text into array 344 elText = $(this).text().split(" "); 345 346 // Adding the open span to the beginning of the array 347 elText.unshift(openSpan); 348 349 // Adding span closing after the first word in each sentence 350 elText.splice(2, 0, closeSpan); 351 352 // Make the array into string 353 elText = elText.join(" "); 354 355 // Change the html of each element to style it 356 $(this).html(elText); 357 }); 358 359 $(".testi-item a.tab").on('click', function(e){ 360 e.preventDefault(); 361 slideIndex = $(this).index(); 362 $( '.testi-carousel' ).slickGoTo( parseInt(slideIndex) ); 363 }); 364 365 // Portfolio Single Carousel 366 if ($('.cdev').length) { 367 $(".cdev").circlos(); 368 } 369 370 // Portfolio Single Carousel 371 if ($('.portfolio-carousel').length) { 372 $('.portfolio-carousel').owlCarousel({ 373 loop: true, 374 nav:true, 375 autoHeight:true, 376 items:1 377 }) 378 } 379 380 //for potfolio slider 381 382 if ($('.portfolio-slider-data').length) { 383 var sliderDots = ""; 384 if(portfolio_data.slider_dots==1){ 385 sliderDots = true; 386 } 387 var sliderNav = ""; 388 if(portfolio_data.nav==1){ 389 sliderNav = true; 390 } 391 392 $(".portfolio-slider-data").each(function() { 393 $(".portfolio-slider-data").slick({ 394 slidesToShow: portfolio_data.col_lg, 395 centerMode: false, 396 dots: sliderDots, 397 arrows: sliderNav, 398 autoplay: portfolio_data.autoplay, 399 slidesToScroll: 2, 400 centerPadding: '15px', 401 autoplaySpeed: portfolio_data.autoplaySpeed, 402 pauseOnHover: portfolio_data.pauseOnHover, 403 prevArrow:"<button type='button' class='slick-prev pull-left'><i class='glyph-icon reobizicon-left-arrow' aria-hidden='true'></i></button>", 404 nextArrow:"<button type='button' class='slick-next pull-right'><i class='glyph-icon reobizicon-right-arrow' aria-hidden='true'></i></button>", 405 responsive: [{ 406 breakpoint: 1400, 407 settings: { 408 centerPadding: '15px', 409 slidesToShow: portfolio_data.col_lg, 410 slidesToScroll: 1, 411 } 412 }, 413 { 414 breakpoint: 1200, 415 settings: { 416 centerPadding: '15px', 417 slidesToShow: portfolio_data.col_md, 418 slidesToScroll: 1, 419 } 420 }, 421 { 422 breakpoint: 767, 423 settings: { 424 centerPadding: '10px', 425 slidesToShow: portfolio_data.col_sm, 426 slidesToScroll: 1, 427 } 428 }, 429 { 430 breakpoint: 480, 431 settings: { 432 centerPadding: '5px', 433 slidesToShow: portfolio_data.col_xs, 434 slidesToScroll: 1, 435 } 436 }, 437 { 438 breakpoint: 350, 439 settings: { 440 centerPadding: '0px', 441 slidesToShow: portfolio_data.col_mobile, 442 slidesToScroll: 1, 443 } 444 }, ] 445 }); 446 }); 447 } 448 449 450 $(function(){ 451 // collapse hidden 452 var navMain = $(".navbar-collapse"); // avoid dependency on #id 453 // when you have dropdown inside navbar 454 navMain.on("click", "a:not([data-toggle])", null, function () { 455 navMain.collapse('hide'); 456 }); 457 458 $( "ul.children" ).addClass( "sub-menu" ); 459 }); 460 461 $(".rs-products-grid .product-btn .button").addClass("glyph-icon reobizicon-shopping-bag"); 462 463 //Videos popup jQuery activation code 464 $('.popup-videos').magnificPopup({ 465 disableOn: 10, 466 type: 'iframe', 467 mainClass: 'mfp-fade', 468 removalDelay: 160, 469 preloader: false, 470
471 fixedContentPos: false 472 }); 473 474 //type writer 475 $(".rs-banner .cd-words-wrapper p:first-child").addClass("is-visible"); 476 477 478 //CountDown Timer 479 var CountTimer = $('.CountDownTimer'); 480 if(CountTimer.length){ 481 $(".CountDownTimer").TimeCircles({ 482 fg_width: 0.030, 483 bg_width: 0.8, 484 circle_bg_color: "#ffffff", 485 circle_fg_color: "#ffffff", 486 time: { 487 Days:{ 488 text: countdown_data.day_text, 489 color: "#fff" 490 }, 491 Hours:{ 492 text: countdown_data.hour_text, 493 color: "#fff" 494 }, 495 Minutes:{ 496 text: countdown_data.sec_text, 497 color: "#fff" 498 }, 499 Seconds:{ 500 text: countdown_data.min_text, 501 color: "#fff" 502 } 503 } 504 }); 505 } 506 //CountDown Timer 507 var CountTimer = $('.CountDownTimer3'); 508 if(CountTimer.length){ 509 $(".CountDownTimer3").TimeCircles({ 510 fg_width: 0.030, 511 bg_width: 0.8, 512 circle_bg_color: events_data.ev_circle_bg_color, 513 time: { 514 Days:{ 515 color: events_data.ev_days_color 516 }, 517 Hours:{ 518 color: events_data.ev_hours_color 519 }, 520 Minutes:{ 521 color: events_data.ev_min_color 522 }, 523 Seconds:{ 524 color: events_data.ev_sec_color 525 } 526 } 527 }); 528 } 529 530 //Select box wrap css 531 $( ".mptt-shortcode-wrapper .mptt-navigation-select" ).wrap( "<div class='mptt-select'></div>" ); 532 $(".menu-area .navbar ul > li.mega > ul.sub-menu").wrapInner("<div class='container flex-mega'></div>"); 533 $('.menu-area .navbar ul > li.mega > ul.sub-menu li').first().addClass('first-li-item'); 534 535 536 if ($('div').hasClass('openingfoot')) { 537 $('body').addClass('openingfootwrap'); 538 } 539 540 // Sticky Sidebar 541 $('.contents-sticky, .sticky-sidebar').theiaStickySidebar({ 542 additionalMarginTop: 160, 543 additionalMarginBottom: 20, 544 }); 545 546 //CountDown Timer 547 var CountTimer = $('.CountDownTimer4'); 548 if(CountTimer.length){ 549 $(".CountDownTimer4").TimeCircles({ 550 551 }); 552 } 553 554 555 //preloader 556 $(window).on( 'load', function() { 557 $("#reobiz-load").delay(1000).fadeOut(500); 558 $(".reobiz-loader").delay(1000).fadeOut(500); 559 560 if($(window).width() < 992) { 561 $('.rs-menu').css('height', '0'); 562 $('.rs-menu').css('opacity', '0'); 563 $('.rs-menu').css('z-index', '-1'); 564 $('.rs-menu-toggle').on( 'click', function(){ 565 $('.rs-menu').css('opacity', '1'); 566 $('.rs-menu').css('z-index', '1'); 567 }); 568 } 569 }) 570 571 // image loaded portfolio init 572 $('.grid').imagesLoaded(function() { 573 $('.portfolio-filter').on('click', 'button', function() { 574 var filterValue = $(this).attr('data-filter'); 575 $grid.isotope({ 576 filter: filterValue 577 }); 578 }); 579 var $grid = $('.grid').isotope({ 580 581 animationOptions: { 582 duration: 750, 583 easing: 'linear', 584 queue: false 585 }, 586 587 itemSelector: '.grid-item', 588 percentPosition: true, 589 masonry: { 590 columnWidth: '.grid-item', 591 } 592 }); 593 }); 594 595 // portfolio Filter 596 $('.portfolio-filter button').on('click', function(event) { 597 $(this).siblings('.active').removeClass('active'); 598 $(this).addClass('active'); 599 event.preventDefault(); 600 }); 601 602 603 // magnificPopup init 604 $('.image-popup').magnificPopup({ 605 type: 'image', 606 callbacks: { 607 beforeOpen: function() { 608 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure animated zoomInDown'); 609 } 610 }, 611 image: { 612 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 613 titleSrc: function(item) { 614 return '<div class="gallery-title-wrap"><h3>' + item.el.attr('title') + '</h3>' + '<p>' + item.el.attr('caption') + '</p></div>'; 615 } 616 }, 617 gallery: { 618 enabled: true 619 } 620 }); 621 622 //service carousel
623 if ($('.project-single-carousel').length) { 624 $('.project-single-carousel').owlCarousel({ 625 loop:true, 626 margin: 20, 627 arrows: true, 628 autoplay: true, 629 nav:true, 630 dots: false, 631 navText : ["<i class='glyph-icon reobizicon-left-arrow'></i>","<i class='glyph-icon reobizicon-right-arrow'></i>"], 632 responsive:{ 633 0:{ 634 items:1 635 }, 636 767:{ 637 items:2 638 }, 639 991:{ 640 items:2 641 }, 642 1199:{ 643 items:4 644 } 645 } 646 }); 647 } 648 649 // Counter Up 650 $('.rs-counter').counterUp({ 651 delay: 20, 652 time: 1500 653 }); 654 655 656 657 // scrollTop init 658 var win=$(window); 659 var totop = $('#scrollUp'); 660 win.on('scroll', function() { 661 if (win.scrollTop() > 150) { 662 totop.fadeIn(); 663 } else { 664 totop.fadeOut(); 665 } 666 }); 667 totop.on('click', function() { 668 $("html,body").animate({ 669 scrollTop: 0 670 }, 500) 671 }); 672 673 $( ".comment-body, .comment-respond" ).wrap( "<div class='comment-full'></div>" ); 674 $('.rs-heading .description p:empty').remove(); 675 676 //woocommerce quantity style 677 if ( ! String.prototype.getDecimals ) { 678 String.prototype.getDecimals = function() { 679 var num = this, 680 match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); 681 if ( ! match ) { 682 return 0; 683 } 684 return Math.max( 0, ( match[1] ? match[1].length : 0 ) - ( match[2] ? +match[2] : 0 ) ); 685 } 686 } 687 // Quantity "plus" and "minus" buttons 688 $( document.body ).on( 'click', '.plus, .minus', function() { 689 var $qty = $( this ).closest( '.quantity' ).find( '.qty'), 690 currentVal = parseFloat( $qty.val() ), 691 max = parseFloat( $qty.attr( 'max' ) ), 692 min = parseFloat( $qty.attr( 'min' ) ), 693 step = $qty.attr( 'step' ); 694 695 // Format values 696 if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0; 697 if ( max === '' || max === 'NaN' ) max = ''; 698 if ( min === '' || min === 'NaN' ) min = 0; 699 if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) === 'NaN' ) step = 1; 700 701 // Change the value 702 if ( $( this ).is( '.plus' ) ) { 703 if ( max && ( currentVal >= max ) ) { 704 $qty.val( max ); 705 } else { 706 $qty.val( ( currentVal + parseFloat( step )).toFixed( step.getDecimals() ) ); 707 } 708 } else { 709 if ( min && ( currentVal <= min ) ) { 710 $qty.val( min ); 711 } else if ( currentVal > 0 ) { 712 $qty.val( ( currentVal - parseFloat( step )).toFixed( step.getDecimals() ) ); 713 } 714 } 715 716 // Trigger change event 717 $qty.trigger( 'change' ); 718 }); 719 720})(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.