1/*================================================== 2 copygen Theme Js 3==================================================*/ 4(function ($) { 5 ("use strict"); 6 /*---====================---preloader---======================---*/ 7 8 9if($('.loader-wrap').length){ 10 $('.loader-wrap').delay(1000).fadeOut(500); 11 $(".preloader-close").on("click", function(){ 12 $('.loader-wrap').delay(200).fadeOut(500); 13 }) 14} 15 16/*---====================---preloader---======================---*/ 17 /*---====================---back-to-top---======================---*/ 18if($('.prgoress_indicator path').length){ 19 var progressPath = document.querySelector('.prgoress_indicator path'); 20 var pathLength = progressPath.getTotalLength(); 21 progressPath.style.transition = progressPath.style.WebkitTransition = 'none'; 22 progressPath.style.strokeDasharray = pathLength + ' ' + pathLength; 23 progressPath.style.strokeDashoffset = pathLength; 24 progressPath.getBoundingClientRect(); 25 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 26 var updateProgress = function () { 27 var scroll = $(window).scrollTop(); 28 var height = $(document).height() - $(window).height(); 29 var progress = pathLength - (scroll * pathLength / height); 30 progressPath.style.strokeDashoffset = progress; 31 } 32 updateProgress(); 33 $(window).on('scroll', updateProgress); 34 var offset = 250; 35 var duration = 550; 36 jQuery(window).on('scroll', function () { 37 if (jQuery(this).scrollTop() > offset) { 38 jQuery('.prgoress_indicator').addClass('active-progress'); 39 } else { 40 jQuery('.prgoress_indicator').removeClass('active-progress'); 41 } 42 }); 43 jQuery('.prgoress_indicator').on('click', function (event) { 44 event.preventDefault(); 45 jQuery('html, body').animate({ scrollTop: 0 }, duration); 46 return false; 47 }); 48} 49 /*---====================---back-to-top---======================---*/ 50function copygen_search_popup() { 51 52 if($('.search-popup').length){ 53 54 //Show Popup 55 $('.search-toggler').on('click', function() { 56 $('.search-popup').addClass('popup-visible'); 57 }); 58 $(document).keydown(function(e){ 59 if(e.keyCode === 27) { 60 $('.search-popup').removeClass('popup-visible'); 61 } 62 }); 63 //Hide Popup 64 $('.close-search , .search-popup .overlay-layer').on('click', function() { 65 $('.search-popup').removeClass('popup-visible'); 66 }); 67} 68} 69 70function copygen_option_panel_popup() { 71 72 if($('.option_panel-popup').length){ 73 74 //Show Popup 75 $('.contact-toggler').on('click', function() { 76 $('.option_panel-popup').addClass('popup-visible'); 77 }); 78 $(document).keydown(function(e){ 79 if(e.keyCode === 27) { 80 $('.option_panel-popup').removeClass('popup-visible'); 81 } 82 }); 83 //Hide Popup 84 $('.close-option-pan , .option_panel-popup .sdmenu_overlay').on('click', function() { 85 $('.option_panel-popup').removeClass('popup-visible'); 86 }); 87 } 88} 89 90 91 92 93/*----------------------------- 94 CounterUp 95-----------------------------*/ 96jQuery(document).ready(function($) { 97 if($('.count').length){ 98 $(".count").counterUp({ 99 delay: 10, 100 time: 2000 101 }); 102 } 103}); 104 105/*----------------------------- 106 Sidebar menu Active 107-----------------------------*/ 108 109/*----------------------------- 110 light box 111-----------------------------*/ 112function copygen_light_box() { 113 if ($('.lightbox-image').length) { 114 $('.lightbox-image').fancybox({ 115 openEffect: 'fade', 116 closeEffect: 'fade', 117 autoDimensions:false, 118 width:'560', 119 height:'400', 120 helpers: { 121 media: {} 122 } 123 }); 124 } 125} 126/*----------------------------- 127 VSticker 128-----------------------------*/ 129 130if($('.side_bar_cart').length){ 131 //Menu Toggle Btn 132 $('.mini_cart_togglers').on('click', function() { 133 $('body').toggleClass('side_bar_cart-visible'); 134 });
135 //Menu Toggle Btn 136 $('.side_bar_cart .close_btn_mini , .side_bar_cart .cart_overlay').on('click', function() { 137 $('body').removeClass('side_bar_cart-visible'); 138 }); 139} 140 141 142function copygen_faqsall() { 143 144 if ($('.accordion-box').length) { 145 $(".accordion-box").off('click').on('click', '.question', function () { 146 console.log('Accordion question clicked'); 147 var outerBox = $(this).parents('.accordion-box'); 148 var target = $(this).parents('.accordion'); 149 150 if ($(this).hasClass('active') !== true) { 151 $(outerBox).find('.accordion .question').removeClass('active'); 152 } 153 154 if ($(this).next('.accordion-content').is(':visible')) { 155 return false; 156 } else { 157 $(this).addClass('active'); 158 $(outerBox).children('.accordion').removeClass('active-block'); 159 $(outerBox).find('.accordion').children('.accordion-content').slideUp(300); 160 target.addClass('active-block'); 161 $(this).next('.accordion-content').slideDown(300); 162 } 163 }); 164 } 165 166 167} 168 169/*================================= 170 Side Menu Option 171=================================*/ 172 function copygen_side_menu() { 173 if($(".menu_open_sidely").length) { 174 //adding a new class on button element 175 $('.side_navbar_togglers').on('click',function () { 176 $('body').addClass('opne_side_menu_v1'); 177 }); 178 //removing a existing class from button element 179 $('.side_navbar_togglers_close').on('click',function () { 180 $('body').removeClass('opne_side_menu_v1'); 181 }); 182 } 183} 184 185/*================================= 186 Menu Stick 187==================================*/ 188 function copygen_headerStyle() { 189 if($('.sticky_header_content').length){ 190 var windowpos = $(window).scrollTop(); 191 var siteHeader = $('.sticky_header_content'); 192 var sticky_header = $('.sticky_header_content .sticky_header_default'); 193 if (windowpos > 500) { 194 siteHeader.addClass('fixed-header'); 195 sticky_header.addClass("wow animate__animated animate__slideInDown"); 196 } else { 197 siteHeader.removeClass('fixed-header'); 198 sticky_header.removeClass("wow animate__animated animate__slideInDown"); 199 } 200 } 201 } 202 203 204/*----------------------------- 205 progress bar 206-----------------------------*/ 207function copygen_progress_bar() { 208 // Progress Bar 209 if ($('.count-bar').length) { 210 $('.count-bar').appear(function(){ 211 var el = $(this); 212 var percent = el.data('percent'); 213 $(el).css('width',percent).addClass('counted'); 214 },{accY: -50}); 215 216 } 217} 218/*----------------------------- 219 protfolio ajax 220-----------------------------*/ 221function copygen_protfolio_ajax(){ 222 $('.ajax_protfolio_enabled').on('click', '.pagination .next', function(e) { 223 e.preventDefault(); 224 if ($(this).data('requestRunning')) { 225 return; 226 } 227 $(this).data('requestRunning', true); 228 var $protfolio_post_list = $('.portfoliocontainer'), 229 $pagination = $(this).parents('.pagination'), 230 $parent = $(this).parent(); 231 232 $parent.addClass('loader'); 233 234 $.get( 235 $(this).attr('href'), 236 function (response) { 237 var $content = $(response).find('.portfoliocontainer').children('.portfolio-wrapper'), 238 protfolio_pagination = $(response).find('.pagination').html(); 239 $pagination.html(protfolio_pagination); 240 $protfolio_post_list.append($content); 241 $content.imagesLoaded(function () { 242 $protfolio_post_list.isotope( 'appended', $content ); 243 $pagination.find('.next').data('requestRunning', false); 244 $parent.removeClass('loader'); 245 }); 246 } 247 ); 248 }); 249} 250 /*----------------------------- 251 service ajax 252-----------------------------*/ 253function copygen_ser_ajax(){ 254 $('.ajax_service_enabled').on('click', '.pagination-area .next', function(e) { 255 e.preventDefault(); 256 if ($(this).data('requestRunning')) { 257 return; 258 } 259 $(this).data('requestRunning', true); 260 var $ser_post_list = $('.ajaxservicecontainer'), 261 $paginationser = $(this).parents('.pagination-area'), 262 $parent = $(this).parent(); 263 264 $parent.addClass('loader'); 265 266 $.get( 267 $(this).attr('href'), 268 function (response) { 269 var $contentser = $(response).find('.ajaxservicecontainer').children('.ajax-service-wrapper'), 270 ser_pagination = $(response).find('.pagination-area').html(); 271 $paginationser.html(ser_pagination); 272 $ser_post_list.append($contentser); 273 $contentser.imagesLoaded(function () { 274 $contentser; 275 $paginationser.find('.next').data('requestRunning', false); 276 $parent.removeClass('loader'); 277 }); 278 } 279 ); 280 });
281} 282 283 /*----------------------------- 284 post ajax 285-----------------------------*/ 286function copygen_post_ajax(){ 287 $('.ajax_posts_enabled').on('click', '.pagination-area .next', function(e) { 288 e.preventDefault(); 289 if ($(this).data('requestRunning')) { 290 return; 291 } 292 $(this).data('requestRunning', true); 293 var $ser_post_list = $('.ajaxcontainer'), 294 $paginationser = $(this).parents('.pagination-area'), 295 $parent = $(this).parent(); 296 297 $parent.addClass('loader'); 298 299 $.get( 300 $(this).attr('href'), 301 function (response) { 302 var $contentser = $(response).find('.ajaxcontainer').children('.ajax-wrapper'), 303 ser_pagination = $(response).find('.pagination-area').html(); 304 $paginationser.html(ser_pagination); 305 $ser_post_list.append($contentser); 306 $contentser.imagesLoaded(function () { 307 $contentser; 308 $paginationser.find('.next').data('requestRunning', false); 309 $parent.removeClass('loader'); 310 }); 311 } 312 ); 313 }); 314} 315/*================================= 316 Menu Stick 317==================================*/ 318 319 320function copygen_tab() { 321 if ($('.copygen_tab').length) { 322 $('.copygen_tab').each(function () { 323 var $tabContainer = $(this); 324 var widgetId = $tabContainer.data('widget-id'); 325 326 // Function to set active tab 327 function setActiveTab(tabId) { 328 var $target = $tabContainer.find(tabId); 329 if (!$target.hasClass('active-tab show')) { 330 $tabContainer.find('.showcase_tabs_btns .s_tab_btn').removeClass('active'); 331 $tabContainer.find('[data-tab="' + tabId + '"]').addClass('active'); 332 $tabContainer.find('.s_tabs_content .s_tab').removeClass('active-tab show'); 333 $target.addClass('active-tab show'); 334 } 335 } 336 337 // Check for stored active tab 338 var activeTab = localStorage.getItem('activeTab-' + widgetId); 339 if (activeTab) {
340 setActiveTab(activeTab); 341 } 342 343 // Click event handler 344 $tabContainer.find('.showcase_tabs_btns .s_tab_btn').on('click', function (e) { 345 e.preventDefault(); 346 var tabId = $(this).attr('data-tab'); 347 setActiveTab(tabId); 348 localStorage.setItem('activeTab-' + widgetId, tabId); 349 }); 350 }); 351 } 352 353} 354 355 356/*--------------------------- 357 Select active 358-------------------------- */ 359function copygen_search() { 360 361 // $("select").select2(); 362 // $(".wpforms-form select").select2(); 363 364} 365/*----------------------------- 366 Type Write Text 367-----------------------------*/ 368function copygen_type_write_text(){ 369 var TxtType = function(el, toRotate, period) { 370 this.toRotate = toRotate; 371 this.el = el; 372 this.loopNum = 0; 373 this.period = parseInt(period, 10) || 2000; 374 this.txt = ''; 375 this.tick(); 376 this.isDeleting = !1 377 }; 378 TxtType.prototype.tick = function() { 379 var i = this.loopNum % this.toRotate.length; 380 var fullTxt = this.toRotate[i]; 381 if (this.isDeleting) { 382 this.txt = fullTxt.substring(0, this.txt.length - 1) 383 } else { 384 this.txt = fullTxt.substring(0, this.txt.length + 1) 385 } 386 this.el.innerHTML = '<span class="wrap">' + this.txt + '</span>'; 387 var that = this; 388 var delta = 200 - Math.random() * 100; 389 if (this.isDeleting) { 390 delta /= 2 391 } 392 if (!this.isDeleting && this.txt === fullTxt) { 393 delta = this.period; 394 this.isDeleting = !0 395 } else if (this.isDeleting && this.txt === '') { 396 this.isDeleting = !1; 397 this.loopNum++; 398 delta = 500 399 } 400 setTimeout(function() { 401 that.tick() 402 }, delta) 403 }; 404 window.onload = function() { 405 var elements = document.getElementsByClassName('typewrite'); 406 for (var i = 0; i < elements.length; i++) { 407 var toRotate = elements[i].getAttribute('data-type'); 408 var period = elements[i].getAttribute('data-period'); 409 if (toRotate) { 410 new TxtType(elements[i], JSON.parse(toRotate), period) 411 } 412 } 413 var css = document.createElement("style"); 414 css.type = "text/css"; 415 css.innerHTML = ".typewrite > .wrap { border-right: 0.05em solid rgba(147, 197, 253)}"; 416 document.body.appendChild(css) 417 } 418} 419 420 /*========================================================================== 421 Carousel for product gallery tabs 422==========================================================================*/ 423 424function copygen_product_tab_carousel() { 425 $(document).ready(function() { 426 $('.flex-control-nav').owlCarousel({ 427 loop: false, 428 margin: 10, 429 nav: true, 430 dots: false, 431 responsive: { 432 0: { 433 items: 1 434 }, 435 600: { 436 items: 3 437 }, 438 1000: { 439 items: 4 440 } 441 } 442 }); 443 444 // Add the class "owl-carousel" to the navigation controls 445 $('.flex-control-nav').addClass('owl-carousel'); 446 }); 447 448} 449 450/*========================================================================== 451 When document is Scrollig, do 452==========================================================================*/ 453$(window).on('scroll', function() { 454 copygen_headerStyle(); 455}); 456 457/* ========================================================================== 458Elementor front end start 459========================================================================== */ 460$(window).on('elementor/frontend/init', function() { 461 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-title-v1.default', copygen_type_write_text); 462 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-header-v1.default', copygen_search_popup); 463 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-extra-items-v1.default', copygen_search_popup); 464 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-header-v1.default', copygen_option_panel_popup); 465 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-extra-items-v1.default', copygen_option_panel_popup); 466 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-side-header-v1.default', copygen_side_menu); 467 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-contact-form-v1.default', copygen_search); 468 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-progress-v1.default', copygen_progress_bar); 469 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-portfoliofilt-v1.default', copygen_protfolio_ajax); 470 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-blog-v1.default', copygen_post_ajax); 471 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-service-v1.default', copygen_ser_ajax); 472 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-videobtns-v1.default', copygen_light_box); 473 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-tab-with-content-v1.default', copygen_tab); 474 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-price-tab-v1.default', copygen_tab); 475 elementorFrontend.hooks.addAction('frontend/element_ready/copygen-faqs-v1.default', copygen_faqsall); 476 477 478}); 479/* ========================================================================== 480 When document is Scrollig, do 481========================================================================== */ 482jQuery(document).on('ready', function () { 483 (function ($) { 484 // add your functions 485 copygen_search_popup(); 486 copygen_option_panel_popup(); 487 copygen_light_box(); 488 copygen_side_menu(); 489 copygen_search(); 490 copygen_faqsall(); 491 copygen_progress_bar(); 492 copygen_protfolio_ajax(); 493 copygen_post_ajax(); 494 copygen_ser_ajax(); 495 copygen_tab(); 496 copygen_type_write_text(); 497 copygen_product_tab_carousel(); 498 })(jQuery); 499}); 500 501 502 503})(jQuery); 504
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.