1;(function ($) { 2 3 "use strict"; 4 5 /* =================== 6 Page reload 7 ===================== */ 8 var scroll_top; 9 var window_height; 10 var window_width; 11 var scroll_status = ''; 12 var lastScrollTop = 0; 13 $(window).on('load', function () { 14 $(".ct-loader").fadeOut("slow"); 15 window_width = $(window).width(); 16 alico_col_offset(); 17 alico_header_sticky(); 18 alico_scroll_to_top(); 19 alico_quantity_icon(); 20 alico_footer_fixed(); 21 $('.ct-image-animate').addClass('active'); 22 }); 23 $(window).on('resize', function () { 24 window_width = $(window).width(); 25 alico_col_offset(); 26 alico_footer_fixed(); 27 }); 28 29 $(window).on('scroll', function () { 30 scroll_top = $(window).scrollTop(); 31 window_height = $(window).height(); 32 window_width = $(window).width(); 33 if (scroll_top < lastScrollTop) { 34 scroll_status = 'up'; 35 } else { 36 scroll_status = 'down'; 37 } 38 lastScrollTop = scroll_top; 39 alico_header_sticky(); 40 alico_scroll_to_top(); 41 }); 42 43 $(document).on('click', '.h-btn-search', function () { 44 $('.ct-modal-search').addClass('open'); 45 $('body').addClass('ov-hidden'); 46 setTimeout(function(){ 47 $('.ct-modal-search .search-field').focus(); 48 },1000); 49 }); 50 51 $(document).ready(function () { 52 53 /* ================= 54 Menu Dropdown 55 =================== */ 56 var $menu = $('.ct-main-navigation'); 57 $menu.find('.ct-main-menu li').each(function () { 58 var $submenu = $(this).find('> ul.sub-menu'); 59 if ($submenu.length == 1) { 60 $(this).hover(function () { 61 if ($submenu.offset().left + $submenu.width() > $(window).width()) { 62 $submenu.addClass('back'); 63 } else if ($submenu.offset().left < 0) { 64 $submenu.addClass('back'); 65 } 66 }, function () { 67 $submenu.removeClass('back'); 68 }); 69 } 70 }); 71 72 /* Mega Menu */ 73 $('.mega-2-columns').parents('.sub-menu').addClass('ct-mega-2-columns'); 74 75 var m_h_mega = $('li.megamenu > .sub-menu > li > .container').outerHeight(); 76 var w_h_mega = $(window).height(); 77 var w_h_mega_css = w_h_mega - 100; 78 if(m_h_mega > w_h_mega && window_width < 1400) { 79 $('li.megamenu > .sub-menu > li > .container').css('max-height', w_h_mega_css + 'px'); 80 $('li.megamenu > .sub-menu > li > .container').css('overflow-x', 'scroll'); 81 } 82 83 var $mega_submenu = $('.ct-main-menu li.megamenu'); 84 if ($mega_submenu.length == 1) { 85 var menu_offset_left = $('.ct-main-menu li.megamenu > .sub-menu').offset().left; 86 var header_offset_left = $('#ct-header > .container').offset().left; 87 var mega_offset_left = menu_offset_left - header_offset_left - 15; 88 $('body:not(.rtl) .ct-main-menu li.megamenu > .sub-menu').css('left', -mega_offset_left + 'px'); 89 $('body.rtl .ct-main-menu li.megamenu > .sub-menu').css('right', mega_offset_left + 'px'); 90 } 91 92 /* Main Header */ 93 $('.ct-header-fixed-transparent').parents('.ct-header-elementor-main').addClass('ct-header-fixed-transparent-wrap'); 94 $('.ct-header-elementor-sticky').parents('body').addClass('header-sticky'); 95 96 97 /* ================= 98 Menu Mobile 99 =================== */ 100 $('.ct-main-navigation li.menu-item-has-children').append('<span class="ct-menu-toggle far fac-angle-down"></span>'); 101 $('.ct-menu-toggle').on('click', function () { 102 $(this).toggleClass('toggle-open'); 103 $(this).parent().find('> .sub-menu').toggleClass('submenu-open'); 104 $(this).parent().find('> .sub-menu').slideToggle(); 105 }); 106 107 $("#ct-menu-mobile .open-menu").on('click', function () { 108 $(this).toggleClass('opened'); 109 $('.ct-header-navigation').toggleClass('navigation-open'); 110 }); 111 112 $(".ct-menu-close").on('click', function () { 113 $(this).parents('.header-navigation').removeClass('navigation-open'); 114 $('.ct-menu-overlay').removeClass('active'); 115 $('#ct-menu-mobile .open-menu').removeClass('opened'); 116 $('body').removeClass('ovhidden'); 117 }); 118 119 $(".ct-menu-overlay").on('click', function () { 120 $(this).parents('#header-main').find('.header-navigation').removeClass('navigation-open'); 121 $(this).removeClass('active'); 122 $('#ct-menu-mobile .open-menu').removeClass('opened'); 123 $('.header-navigation').removeClass('navigation-open'); 124 $('body').removeClass('ovhidden'); 125 }); 126 127 /* =================== 128 Search Toggle 129 ===================== */ 130 $('.h-btn-form').click(function (e) { 131 e.preventDefault(); 132 $('.ct-modal-contact-form').removeClass('remove').toggleClass('open'); 133 }); 134 $('.ct-close').click(function (e) { 135 e.preventDefault(); 136 $(this).parents('.ct-widget-cart-wrap').removeClass('open'); 137 $(this).parents('.ct-modal').addClass('remove').removeClass('open'); 138 $(this).parents('#page').find('.site-overlay').removeClass('open'); 139 $(this).parents('body').removeClass('ov-hidden'); 140 }); 141 142 $('.ct-hidden-sidebar-overlay, .ct-widget-cart-overlay').click(function (e) { 143 e.preventDefault(); 144 $(this).parent().toggleClass('open'); 145 $(this).parents('body').removeClass('ov-hidden'); 146 }); 147 148 /* Video 16:9 */ 149 $('.entry-video iframe').each(function () { 150 var v_width = $(this).width(); 151 152 v_width = v_width / (16 / 9); 153 $(this).attr('height', v_width + 35); 154 }); 155 156 /* Video Light Box */ 157 $('.ct-video-button, .btn-video, .slider-video').magnificPopup({ 158 type: 'iframe', 159 mainClass: 'mfp-fade', 160 removalDelay: 160, 161 preloader: false,
162 fixedContentPos: false 163 }); 164 165 /* ==================== 166 Scroll To Top 167 ====================== */ 168 $('.scroll-top').click(function () { 169 $('html, body').animate({scrollTop: 0}, 800); 170 return false; 171 }); 172 173 /* ================= 174 Add Class 175 =================== */ 176 $('.wpcf7-select').parent().addClass('wpcf7-menu'); 177 178 179 /* ================= 180 The clicked item should be in center in owl carousel 181 =================== */ 182 var $owl_item = $('.owl-active-click'); 183 $owl_item.children().each(function (index) { 184 $(this).attr('data-position', index); 185 }); 186 $(document).on('click', '.owl-active-click .owl-item > div', function () { 187 $owl_item.trigger('to.owl.carousel', $(this).data('position')); 188 }); 189 190 /* Select */ 191 $('select').each(function () { 192 $(this).niceSelect(); 193 }); 194 195 /* Newsletter */ 196 $('.widget_newsletterwidget, form.newsletter').each(function () { 197 var email_text = $(this).find('.tnp-field-email label').text(); 198 $(this).find('.tnp-field-email label').remove(); 199 $(this).find(".tnp-email").each(function (ev) { 200 if (!$(this).val()) { 201 $(this).attr("placeholder", email_text); 202 } 203 }); 204 var firstname_text = $(this).find('.tnp-field-firstname label').text(); 205 $(this).find('.tnp-field-firstname label').remove(); 206 $(this).find(".tnp-firstname").each(function (ev) { 207 if (!$(this).val()) { 208 $(this).attr("placeholder", firstname_text); 209 } 210 }); 211 var lastname_text = $(this).find('.tnp-field-lastname label').text(); 212 $(this).find('.tnp-field-lastname label').remove(); 213 $(this).find(".tnp-lastname").each(function (ev) { 214 if (!$(this).val()) { 215 $(this).attr("placeholder", lastname_text); 216 } 217 }); 218 }); 219 220 /* Search */ 221 $('.ct-modal-close').on('click', function () { 222 $(this).parent().removeClass('open'); 223 $(this).parents('body').removeClass('ov-hidden'); 224 }); 225 $(document).on('click', function (e) { 226 if (e.target.className == 'ct-modal ct-modal-search open') 227 $('.ct-modal-search').removeClass('open'); 228 if (e.target.className == 'ct-hidden-sidebar open') 229 $('.ct-hidden-sidebar').removeClass('open'); 230 }); 231 232 /* Hidden Sidebar */ 233 $(".h-btn-sidebar").on('click', function (e) { 234 e.preventDefault(); 235 $('.ct-hidden-sidebar-wrap').toggleClass('open'); 236 $(this).parents('body').addClass('ov-hidden'); 237 }); 238 239 $(".ct-hidden-close").on('click', function (e) { 240 e.preventDefault(); 241 $(this).parents('.ct-hidden-sidebar-wrap').removeClass('open'); 242 $(this).parents('body').removeClass('ov-hidden'); 243 }); 244 245 /* Cart Sidebar */ 246 $(".h-btn-cart, .btn-nav-cart").on('click', function (e) { 247 e.preventDefault(); 248 $('.ct-widget-cart-wrap').toggleClass('open'); 249 $('.ct-header-navigation').removeClass('navigation-open'); 250 $('#ct-menu-mobile .open-menu').removeClass('opened'); 251 $(this).parents('body').addClass('ov-hidden'); 252 }); 253 254 /* Year Copyright */ 255 var _year_footer = $(".ct-footer-year"), 256 _year_clone = _year_footer.parents(".site").find('.ct-year'); 257 _year_clone.after(_year_footer.clone()); 258 _year_footer.remove(); 259 _year_clone.remove(); 260 261 /* Comment Reply */ 262 $('.comment-reply a').append( '<i class="fa fa-angle-right"></i>' ); 263 264 /* Widget Menu */ 265 $('.ct-navigation-menu1.default a').append( '<i class="fac fac-angle-right"></i>' ); 266 267 /* Nav Slider */ 268 setTimeout(function () { 269 $('.revslider-initialised').each(function () { 270 $(this).find('.ct-slider-nav .slider-nav-right').on('click', function () { 271 $(this).parents('.revslider-initialised').find('.tp-rightarrow').trigger('click'); 272 }); 273 $(this).find('.ct-slider-nav .slider-nav-left').on('click', function () { 274 $(this).parents('.revslider-initialised').find('.tp-leftarrow').trigger('click'); 275 }); 276 }); 277 $('.ct-slider-nav').parents('.revslider-initialised').find('.tparrows').addClass('arrow-hidden'); 278 }, 300); 279 280 /* Icon Form */ 281 setTimeout(function () { 282 $('.input-filled').each(function () { 283 var icon_input = $(this).find(".input-icon"), 284 control_wrap = $(this).find('.wpcf7-form-control'); 285 control_wrap.before(icon_input.clone());
286 icon_input.remove(); 287 }); 288 }, 200); 289 290 /* Same Height */ 291 $('.same-height').matchHeight(); 292 293 /* Demo Bar */ 294 $(".choose-demo").on('click', function () { 295 $(this).parents('.ct-demo-bar').toggleClass('active'); 296 }); 297 298 /* Animate Time */ 299 $('.animate-time').each(function () { 300 var eltime = 100; 301 var elt_inner = $(this).children().length; 302 var _elt = elt_inner - 1; 303 $(this).find('> .grid-item > .wow').each(function (index, obj) { 304 $(this).css('animation-delay', eltime + 'ms'); 305 if (_elt === index) { 306 eltime = 100; 307 _elt = _elt + elt_inner; 308 } else { 309 eltime = eltime + 80; 310 } 311 }); 312 }); 313 314 /* Pricing */ 315 $('.ct-pricing-body').each(function () { 316 $(this).find('.item--first').hover(function () { 317 $(this).parent().addClass('item--first-active'); 318 }, function () { 319 $(this).parent().removeClass('item--first-active'); 320 }); 321 $(this).find('.item--last').hover(function () { 322 $(this).parent().addClass('item--last-active'); 323 }, function () { 324 $(this).parent().removeClass('item--last-active'); 325 }); 326 }); 327 328 $(".item--nav").on('click', function () { 329 $(this).parent().toggleClass('active'); 330 $(this).parents('.ct-pricing').find('.ct-pricing-monthly').toggleClass('pr-hide'); 331 $(this).parents('.ct-pricing').find('.ct-pricing-year').toggleClass('pr-active'); 332 }); 333 334 /* Cover Boxes */ 335 $('body:not(.elementor-editor-active) .ct-cover-boxes1 .ct-cover-item').each(function () { 336 $(this).hover(function () { 337 $(this).parents('.ct-cover-boxes1').find('.ct-cover-item').removeClass('active'); 338 $(this).addClass('active'); 339 }); 340 }); 341 342 /* Overlay particle */ 343 $('.ctf-author-box-link').removeAttr('target'); 344 345 setTimeout(function(){ 346 $('.elementor-top-section.elementor-element').each(function () { 347 var _el_image = $(this).find(".ct-image-animate"), 348 _row_image = _el_image.parents(".elementor-container"); 349 _row_image.before(_el_image.clone()); 350 _el_image.remove(); 351 352 var _el_text = $(this).find(".ct-text"), 353 _row_text = _el_text.parents(".elementor-container"); 354 _row_text.before(_el_text.clone()); 355 _el_text.remove(); 356 }); 357 }, 200); 358 359 /* Blog */ 360 $( ".ct-blog-grid-layout1 .grid-item-inner" ).hover( 361 function() { 362 $( this ).find('.entry-readmore').slideToggle(300); 363 $( this ).find('.entry-meta').slideToggle(300); 364 }, function() { 365 $( this ).find('.entry-readmore').slideToggle(300); 366 $( this ).find('.entry-meta').slideToggle(300); 367 } 368 ); 369 370 /* Range Slider */ 371 $('.wpcf7-form').each(function () { 372 var range = $(this).find('.ct-range-slider'); 373 var range_value = $(this).find('.ct-range-slider').attr('data-value'); 374 var range_maxvalue = $(this).find('.ct-range-slider').attr('data-maxvalue'); 375 var range_currency = $(this).find('.ct-range-slider').attr('data-currency'); 376 $(this).find( ".ct-range-slider" ).slider({ 377 range: "min", 378 value: range_value, 379 min: 1, 380 max: range_maxvalue, 381 slide: function( event, ui ) { 382 $(this).parent().find( ".ct-range-result" ).val( range_currency + ui.value ); 383 } 384 }); 385 $(this).find( ".ct-range-result" ).val( range_currency + $(this).find( ".ct-range-slider" ).slider( "value" ) ); 386 }); 387 388 /* Pricing */ 389 $(".ct-pricing-tab-active .ct-pricing-tab-item").on('click', function () { 390 $(this).parent().find('.ct-pricing-tab-item').removeClass('active'); 391 $(this).addClass('active'); 392 }); 393 $(".ct-pricing-tab-active .title-tab-monthly").on('click', function () { 394 $(this).parents('.ct-pricing').find('.ct-pricing-monthly').removeClass('ct-pricing-hide'); 395 $(this).parents('.ct-pricing').find('.ct-pricing-year').addClass('ct-pricing-hide'); 396 }); 397 $(".ct-pricing-tab-active .title-tab-year").on('click', function () { 398 $(this).parents('.ct-pricing').find('.ct-pricing-year').removeClass('ct-pricing-hide'); 399 $(this).parents('.ct-pricing').find('.ct-pricing-monthly').addClass('ct-pricing-hide'); 400 }); 401 402 /* Team */ 403 $('.item--social-btn').on('click', function () { 404 $(this).toggleClass('active'); 405 $(this).parent().toggleClass('active'); 406 }); 407 408 /* Service */ 409 $( ".ct-service-grid4 .grid-item-inner" ).hover( 410 function() { 411 $( this ).find('.item-readmore').slideToggle(300); 412 }, function() { 413 $( this ).find('.item-readmore').slideToggle(300); 414 } 415 ); 416 417 });
418 419 function alico_header_sticky() { 420 var offsetTop = $('#ct-header-wrap').outerHeight(); 421 var offsetTopElementor = $('#ct-header-elementor').outerHeight(); 422 var h_header = $('.fixed-height').outerHeight(); 423 var offsetTopAnimation = offsetTop + 200; 424 var offsetTopAnimationElementor = offsetTopElementor + 200; 425 if($('#ct-header-wrap').hasClass('is-sticky')) { 426 if (scroll_top > offsetTopAnimation) { 427 $('#ct-header').addClass('h-fixed'); 428 } else { 429 $('#ct-header').removeClass('h-fixed'); 430 } 431 } 432 if($('#ct-header-elementor').hasClass('is-sticky')) { 433 if (scroll_top > offsetTopAnimationElementor) { 434 $('.ct-header-elementor-sticky').addClass('h-fixed'); 435 } else { 436 $('.ct-header-elementor-sticky').removeClass('h-fixed'); 437 } 438 } 439 if (window_width > 1200) { 440 $('.fixed-height').css({ 441 'height': h_header 442 }); 443 } 444 if (scroll_status == 'up' && scroll_top > 0) { 445 $('#ct-header').addClass('scroll-up'); 446 } else { 447 $('#ct-header').removeClass('scroll-up'); 448 } 449 if (scroll_status == 'down') { 450 $('#ct-header').addClass('scroll-down'); 451 } else { 452 $('#ct-header').removeClass('scroll-down'); 453 } 454 } 455 456 /* ================= 457 Column Offset 458 =================== */ 459 function alico_col_offset() { 460 var w_vc_row_lg = ($('#content').width() - 1200) / 2; 461 if (window_width > 1200) { 462 $('body:not(.rtl) .col-offset-left > .elementor-column-wrap > .elementor-widget-wrap').css('padding-left', w_vc_row_lg + 'px'); 463 $('body:not(.rtl) .col-offset-right > .elementor-column-wrap > .elementor-widget-wrap').css('padding-right', w_vc_row_lg + 'px'); 464 465 $('.rtl .col-offset-left > .elementor-column-wrap > .elementor-widget-wrap').css('padding-right', w_vc_row_lg + 'px'); 466 $('.rtl .col-offset-right > .elementor-column-wrap > .elementor-widget-wrap').css('padding-left', w_vc_row_lg + 'px'); 467 } 468 } 469 470 /* ================= 471 Footer Fixed 472 =================== */ 473 function alico_footer_fixed() { 474 setTimeout(function(){ 475 var h_footer = $('.fixed-footer .site-footer-custom').outerHeight() - 1; 476 $('.fixed-footer .site-content').css('margin-bottom', h_footer + 'px'); 477 }, 300); 478 } 479 480 /* ==================== 481 Scroll To Top 482 ====================== */ 483 function alico_scroll_to_top() { 484 if (scroll_top < window_height) { 485 $('.scroll-top').addClass('off').removeClass('on'); 486 } 487 if (scroll_top > window_height) { 488 $('.scroll-top').addClass('on').removeClass('off'); 489 } 490 } 491 492 /* ==================== 493 WooComerce Quantity 494 ====================== */ 495 function alico_quantity_icon() { 496 $('#content .quantity').append('<span class="quantity-icon"><i class="quantity-down fa fa-sort-desc"></i><i class="quantity-up fa fa-sort-asc"></i></span>'); 497 $('.quantity-up').on('click', function () { 498 $(this).parents('.quantity').find('input[type="number"]').get(0).stepUp(); 499 $(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled'); 500 }); 501 $('.quantity-down').on('click', function () { 502 $(this).parents('.quantity').find('input[type="number"]').get(0).stepDown(); 503 $(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled'); 504 }); 505 $('.woocommerce-cart-form .actions .button').removeAttr('disabled'); 506 } 507 508 $( document ).ajaxComplete(function() { 509 alico_quantity_icon(); 510 }); 511 512})(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.