1(function ($) { 2 "use strict"; 3 4 //Hide Loading Box (Preloader) 5 function handlePreloader() { 6 if ($('.preloader').length) { 7 $('.preloader').delay(200).fadeOut(500); 8 } 9 } 10 11 //Update Header Style and Scroll to Top 12 function headerStyle() { 13 if ($('.main-header').length) { 14 var windowpos = $(window).scrollTop(); 15 var scrollLink = $('.scroll-to-top'); 16 var sticky_header = $('.main-header .sticky-header'); 17 if (windowpos > 100) { 18 sticky_header.addClass("fixed-header animated slideInDown"); 19 scrollLink.fadeIn(300); 20 } else { 21 sticky_header.removeClass("fixed-header animated slideInDown"); 22 scrollLink.fadeOut(300); 23 } 24 } 25 } 26 headerStyle(); 27 28 //Submenu Dropdown Toggle 29 if ($('.main-header li.dropdown ul').length) { 30 $('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><i class="fa fa-angle-down"></i></div>'); 31 } 32 33 //Mobile Nav Hide Show 34 if ($('.mobile-menu').length) { 35 36 var mobileMenuContent = $('.main-header .main-menu .navigation').html(); 37 38 $('.mobile-menu .navigation').append(mobileMenuContent); 39 $('.sticky-header .navigation').append(mobileMenuContent); 40 $('.mobile-menu .close-btn').on('click', function () { 41 $('body').removeClass('mobile-menu-visible'); 42 }); 43 44 //Dropdown Button 45 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function () { 46 $(this).prev('ul').slideToggle(500); 47 $(this).toggleClass('active'); 48 }); 49 50 //Menu Toggle Btn 51 $('.mobile-nav-toggler').on('click', function () { 52 $('body').addClass('mobile-menu-visible'); 53 }); 54 55 //Menu Toggle Btn 56 $('.mobile-menu .menu-backdrop, .mobile-menu .close-btn').on('click', function () { 57 $('body').removeClass('mobile-menu-visible'); 58 }); 59 60 } 61 62 //Banner Carousel 63 if ($('.banner-carousel').length) { 64 $('.banner-carousel').owlCarousel({ 65 animateOut: 'fadeOut', 66 animateIn: 'fadeIn', 67 loop: true, 68 margin: 0, 69 nav: true, 70 smartSpeed: 500, 71 autoHeight: true, 72 autoplay: true, 73 autoplayTimeout: 10000, 74 navText: ['<span class="fa fa-long-arrow-alt-left"></span>', '<span class="fa fa-long-arrow-alt-right"></span>'], 75 responsive: { 76 0: { 77 items: 1 78 }, 79 600: { 80 items: 1 81 }, 82 1024: { 83 items: 1 84 }, 85 } 86 }); 87 } 88 89 90 //project-carousel 91 if ($('.project-carousel').length) { 92 $('.project-carousel').owlCarousel({ 93 loop: true, 94 margin: 30, 95 nav: false, 96 smartSpeed: 500, 97 autoHeight: true, 98 autoplay: true, 99 autoplayTimeout: 10000, 100 navText: ['<span class="fa fa-long-arrow-alt-left"></span>', '<span class="fa fa-long-arrow-alt-right"></span>'], 101 responsive: { 102 0: { 103 items: 1 104 }, 105 600: { 106 items: 2, 107 margin: 15, 108 }, 109 1024: { 110 items: 3 111 }, 112 1200: { 113 items: 3 114 }, 115 } 116 }); 117 } 118 119 // Testimonial Carousel Three 120 if ($('.testimonial-carousel-three').length) { 121 $('.testimonial-carousel-three').owlCarousel({ 122 animateOut: 'fadeOut', 123 animateIn: 'fadeIn', 124 loop: true, 125 margin: 0, 126 nav: false, 127 items: 1, 128 smartSpeed: 700, 129 autoplay: 5000, 130 navText: ['<span class="flaticon-left-chevron"></span>', '<span class="flaticon-right-chevron"></span>'], 131 responsive: { 132 0: { 133 items: 1 134 }, 135 991: { 136 items: 3 137 }, 138 1023: { 139 items: 2 140 }, 141 } 142 }); 143 } 144 145 //Clients Carousel 146 if ($('.clients-carousel').length) { 147 $('.clients-carousel').owlCarousel({ 148 loop: true, 149 margin: 10, 150 nav: false, 151 smartSpeed: 400, 152 autoplay: true, 153 navText: ['<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>'], 154 responsive: { 155 0: { 156 items: 1 157 }, 158 480: { 159 items: 2 160 }, 161 600: { 162 items: 3 163 }, 164 768: { 165 items: 4 166 }, 167 1023: { 168 items: 5 169 }, 170 } 171 }); 172 } 173 174 //Team Carousel 175 if ($('.team-carousel').length) { 176 $('.team-carousel').owlCarousel({ 177 loop: true, 178 margin: 10, 179 nav: false, 180 smartSpeed: 400, 181 autoplay: true, 182 navText: ['<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>'], 183 responsive: { 184 0: { 185 items: 1 186 }, 187 480: { 188 items: 2 189 }, 190 600: { 191 items: 3 192 }, 193 768: { 194 items: 3 195 }, 196 1023: { 197 items: 4 198 }, 199 } 200 }); 201 } 202 203 //News Carousel 204 if ($('.news-carousel').length) { 205 $('.news-carousel').owlCarousel({ 206 loop: true, 207 margin: 0, 208 nav: true, 209 smartSpeed: 400, 210 autoplay: true, 211 navText: ['<span class="fa fa-long-arrow-alt-left"></span>', '<span class="fa fa-long-arrow-alt-right"></span>'], 212 responsive: { 213 0: { 214 items: 1 215 }, 216 768: { 217 items: 2 218 }, 219 1024: { 220 items: 3 221 }, 222 1200: { 223 items: 3 224 }, 225 } 226 }); 227 } 228 229 // Testinomials Carousel 230 if ($('.testimonial-content').length) { 231 var testimonial_thumbs = new Swiper('.testimonial-thumbs', { 232 spaceBetween: 0, 233 direction: "vertical", 234 loop: false, 235 slidesPerView: 3, 236 breakpoints: { 237 320: { 238 slidesPerView: 3, 239 }, 240 600: { 241 slidesPerView: 3, 242 }, 243 } 244 245 }); 246 247 var testimonial_content = new Swiper('.testimonial-content', { 248 spaceBetween: 0, 249 effect: 'fade', 250 loop: true, 251 thumbs: { 252 swiper: testimonial_thumbs 253 }, 254 pagination: { 255 el: '.testimonial-pagination', 256 clickable: true, 257 }, 258 }); 259 } 260 261 //Accordion Box 262 if ($('.accordion-box').length) { 263 $(".accordion-box").on('click', '.acc-btn', function () { 264 265 var outerBox = $(this).parents('.accordion-box'); 266 var target = $(this).parents('.accordion'); 267 268 if ($(this).hasClass('active') !== true) { 269 $(outerBox).find('.accordion .acc-btn').removeClass('active '); 270 } 271 272 if ($(this).next('.acc-content').is(':visible')) { 273 return false; 274 } else { 275 $(this).addClass('active'); 276 $(outerBox).children('.accordion').removeClass('active-block'); 277 $(outerBox).find('.accordion').children('.acc-content').slideUp(300); 278 target.addClass('active-block'); 279 $(this).next('.acc-content').slideDown(300); 280 } 281 }); 282 } 283 284 //Tabs Box 285 if ($('.tabs-box').length) { 286 $('.tabs-box .tab-buttons .tab-btn').on('click', function (e) { 287 e.preventDefault(); 288 var target = $($(this).attr('data-tab')); 289 290 if ($(target).is(':visible')) { 291 return false; 292 } else { 293 target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn'); 294 $(this).addClass('active-btn'); 295 target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0); 296 target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab animated fadeIn'); 297 $(target).fadeIn(300); 298 $(target).addClass('active-tab animated fadeIn'); 299 } 300 }); 301 } 302 303 //LightBox / Fancybox 304 if ($('.lightbox-image').length) { 305 $('.lightbox-image').fancybox({ 306 openEffect: 'fade', 307 closeEffect: 'fade', 308 helpers: { 309 media: {} 310 } 311 }); 312 } 313 314 // Scroll to a Specific Div 315 $(".scroll-to-top").on("click", function (e) { 316 e.preventDefault(); 317 $("html, body").animate({ scrollTop: 0 }, 600); 318 }); 319 320 // Elements Animation 321 if ($('.wow').length) { 322 var wow = new WOW( 323 { 324 boxClass: 'wow', // animated element css class (default is wow) 325 animateClass: 'animated', // animation css class (default is animated) 326 offset: 0, // distance to the element when triggering the animation (default is 0) 327 mobile: false, // trigger animations on mobile devices (default is true) 328 live: true // act on asynchronously loaded content (default is true) 329 } 330 ); 331 wow.init(); 332 } 333 334 /* ========================================================================== 335 When document is Scrollig, do 336 ========================================================================== */ 337 338 $(window).on('scroll', function () { 339 // TM_activateMenuItemOnReach(); 340 headerStyle(); 341 }); 342 343 /* ========================================================================== 344 When document is loading, do 345 ========================================================================== */ 346 347 $(window).on('load', function () { 348 handlePreloader(); 349 }); 350 351})(window.jQuery); 352 353// // Contact Mail 354// function getFormattedDate() { 355// const now = new Date();
356// const year = now.getFullYear(); 357// const month = String(now.getMonth() + 1).padStart(2, '0'); 358// const day = String(now.getDate()).padStart(2, '0'); 359// const hour = String(now.getHours()).padStart(2, '0'); 360// return `${year}-${month}-${day} ${hour}`; 361// } 362 363 364// $(document).ready(function () { 365// document.getElementById('secureKey').value = getFormattedDate(); 366// $('#contact_form').on('submit', function (e) { 367// e.preventDefault(); // Always prevent by default first 368 369// grecaptcha.ready(function () { 370// grecaptcha.execute('6LdptkMrAAAAAC0M8n4IWG3Q0-yDEJt0f7n7227D', { action: 'submit' }).then(function (token) { 371// $('#g-recaptcha-response').val(token); 372 373// $('#loader').show(); 374 375// $.ajax({ 376// type: 'POST', 377// url: 'required/send-mail', 378// data: $('#contact_form').serialize(), 379// dataType: 'json', 380// success: function (response) { 381// const msg = $('#contactResponseMessage'); 382// msg.text(response.message) 383// .css({ 384// color: response.status === 'success' ? 'green' : 'red', 385// display: 'block' 386// }) 387// .fadeIn(); 388 389// if (response.status === 'success') { 390// $('#contact_form')[0].reset(); 391// } 392 393// setTimeout(() => msg.fadeOut(), 4000); 394// }, 395// error: function () { 396// $('#contactResponseMessage').text("Server error. Please try again later.").css({ 397// color: 'red', 398// display: 'block' 399// }); 400// }, 401// complete: function () { 402// $('#loader').hide(); 403// } 404// }); 405// }); 406// }); 407// }); 408// }); 409 410// Contact Mail 411$(document).ready(function () { 412 // Handle form submission for any form containing .secureKey 413 $('form:has(.secureKey)').on('submit', function (e) { 414 e.preventDefault(); 415 const form = $(this); 416 const loader = form.find('.loader'); 417 const msg = form.find('.responseMessage'); 418 419 loader.show(); 420 msg.hide().empty(); 421 422 $.ajax({ 423 type: 'POST', 424 url: 'required/send-mail', 425 data: form.serialize(), 426 dataType: 'json', 427 success: function (response) { 428 msg.text(response.message) 429 .css({ 430 color: response.status === 'success' ? 'green' : 'red', 431 display: 'block' 432 }) 433 .fadeIn(); 434 435 if (response.status === 'success') { 436 form[0].reset(); 437 } 438 }, 439 error: function (xhr) { 440 const errorMsg = xhr.responseJSON && xhr.responseJSON.message 441 ? xhr.responseJSON.message 442 : "Server error. Please try again later."; 443 444 msg.text(errorMsg) 445 .css({ 446 color: 'red', 447 display: 'block' 448 }) 449 .fadeIn(); 450 }, 451 complete: function () { 452 loader.hide(); 453 setTimeout(() => msg.fadeOut(), 4000); 454 } 455 }); 456 }); 457}); 458 459 460// Product Modal 461document.addEventListener("DOMContentLoaded", function () { 462 const BASE_URL_HOME = window.location.hostname.includes("localhost") 463 ? "http://localhost/axissoftmedia/" 464 : "https://www.axissoftmedia.com/"; 465 466 467 // Define relative paths for the modal to appear 468 const allowedPaths = [ 469 "product-details/ali-nastaliq-web", 470 "product-details/naskh-font-bundle", 471 "product-details/manzar-noori-nastaliq", 472 "product-details/manzar-lahori-nastaliq", 473 "product-details/manzar-naskh", 474 "product-details/ali-nastalig-gold", 475 "product-details/ali-nastaliq", 476 "manzar-typesetting-tool" 477 ]; 478 479 // Normalize URLs (ignore trailing slash and case) 480 const currentURL = window.location.href.replace(/\/$/, "").toLowerCase(); 481 482 // Check if current URL matches any allowed path 483 const shouldShowModal = allowedPaths.some(path => { 484 const fullURL = (BASE_URL_HOME + path).replace(/\/$/, "").toLowerCase(); 485 return currentURL === fullURL; 486 }); 487 488 // Show modal if URL matches 489 if (shouldShowModal) { 490 const modalEl = document.getElementById("inpageModal"); 491 if (modalEl) { 492 const modal = new bootstrap.Modal(modalEl, { 493 backdrop: 'static', 494 keyboard: false 495 }); 496 modal.show(); 497 } else { 498 console.warn("Modal element #inpageModal not found."); 499 } 500 } 501}); 502 503// Mobile Navbar 504document.addEventListener('DOMContentLoaded', function () { 505 // Only apply on screens <= 991px (typical mobile breakpoint) 506 function enableNestedDropdownForMobile() { 507 if (window.innerWidth <= 991) { 508 document.querySelectorAll('.dropdown .dropdown-btn').forEach(function (btn) { 509 // Prevent duplicate listeners 510 if (!btn.dataset.bound) { 511 btn.dataset.bound = 'true'; 512 btn.addEventListener('click', function (e) { 513 e.preventDefault(); 514 e.stopPropagation(); 515 516 const parent = this.closest('.dropdown'); 517 if (parent) { 518 parent.classList.toggle('submenu-open'); 519 } 520 });
521 } 522 }); 523 } 524 } 525 526 enableNestedDropdownForMobile(); 527 528 // Re-enable if screen is resized back to mobile width 529 window.addEventListener('resize', enableNestedDropdownForMobile); 530});
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.