1/* =================================================================== 2 Author : ModinaTheme 3 Version : 1.0 4* ================================================================= */ 5 6(function($) { 7 "use strict"; 8 9 $(document).ready( function() { 10 11 //>> Mobile Menu Js Start <<// 12 $('#visaland_main_menu').meanmenu({ 13 meanMenuContainer: '.mobile-menu', 14 meanScreenWidth: "991", 15 meanExpand: ['<i class="far fa-plus"></i>'], 16 }); 17 18 //>> Sidebar Toggle Js Start <<// 19 $(".offcanvas__close,.offcanvas__overlay").on("click", function() { 20 $(".offcanvas__info").removeClass("info-open"); 21 $(".offcanvas__overlay").removeClass("overlay-open"); 22 }); 23 $(".sidebar__toggle").on("click", function() { 24 $(".offcanvas__info").addClass("info-open"); 25 $(".offcanvas__overlay").addClass("overlay-open"); 26 }); 27 28 //>> Body Overlay Js Start <<// 29 $(".body-overlay").on("click", function() { 30 $(".offcanvas__area").removeClass("offcanvas-opened"); 31 $(".df-search-area").removeClass("opened"); 32 $(".body-overlay").removeClass("opened"); 33 }); 34 35 //>> Sticky Header Js Start <<// 36 37 $(window).scroll(function() { 38 if ($(this).scrollTop() > 250) { 39 $("#header-sticky").addClass("sticky"); 40 } else { 41 $("#header-sticky").removeClass("sticky"); 42 } 43 }); 44 45 46 //>> Text Animation Gsap Js Start <<// 47 if ($('.title-anim').length > 0) { 48 let splitTitleLines = gsap.utils.toArray(".title-anim"); 49 splitTitleLines.forEach(splitTextLine => { 50 const tl = gsap.timeline({ 51 scrollTrigger: { 52 trigger: splitTextLine, 53 start: 'top 90%', 54 end: 'bottom 60%', 55 scrub: false, 56 markers: false, 57 toggleActions: 'play none none none' 58 } 59 }); 60 61 const itemSplitted = new SplitText(splitTextLine, { type: "words, lines" }); 62 gsap.set(splitTextLine, { perspective: 300}); 63 itemSplitted.split({ type: "lines" }) 64 tl.from(itemSplitted.lines, { duration: 1, delay: 0.3, opacity: 0, rotationX: -50, force3D: true, transformOrigin: "top center -50", stagger: 0.2 }); 65 }); 66 } 67 68 //>> Hero-1 Slider Start <<// 69 const sliderActive2 = ".hero-slider"; 70 const sliderInit2 = new Swiper(sliderActive2, { 71 loop: true, 72 slidesPerView: 1, 73 effect: "fade", 74 speed: 3000, 75 autoplay: { 76 delay: 7000, 77 disableOnInteraction: false, 78 }, 79 pagination: { 80 el: ".dot", 81 clickable: true, 82 }, 83 }); 84 function animated_swiper(selector, init) { 85 const animated = function animated() { 86 $(selector + " [data-animation]").each(function () { 87 let anim = $(this).data("animation"); 88 let delay = $(this).data("delay"); 89 let duration = $(this).data("duration"); 90 $(this) 91 .removeClass("anim" + anim) 92 .addClass(anim + " animated") 93 .css({ 94 webkitAnimationDelay: delay, 95 animationDelay: delay, 96 webkitAnimationDuration: duration, 97 animationDuration: duration, 98 }) 99 .one("animationend", function () { 100 $(this).removeClass(anim + " animated"); 101 }); 102 }); 103 }; 104 animated(); 105 init.on("slideChange", function () { 106 $(sliderActive2 + " [data-animation]").removeClass("animated"); 107 }); 108 init.on("slideChange", animated); 109 } 110 animated_swiper(sliderActive2, sliderInit2); 111 //>> Banner Animation <<// 112 113 // Init slick slider + animation 114 115 116 117 //>> Hero-4 Slider Start <<// 118 const sliderActive1 = ".hero-slider-4"; 119 const sliderInit1 = new Swiper(sliderActive1, { 120 loop: true, 121 slidesPerView: 1, 122 effect: "fade", 123 speed: 2000,
124 autoplay: { 125 delay: 4000, 126 disableOnInteraction: false, 127 }, 128 pagination: { 129 el: ".dot", 130 clickable: true, 131 }, 132 navigation: { 133 nextEl: ".array-prev", 134 prevEl: ".array-next", 135 }, 136 }); 137 // content animation when active start here 138 function animated_swiper(selector, init) { 139 let animated = function animated() { 140 $(selector + " [data-animation]").each(function () { 141 let anim = $(this).data("animation"); 142 let delay = $(this).data("delay"); 143 let duration = $(this).data("duration"); 144 $(this) 145 .removeClass("anim" + anim) 146 .addClass(anim + " animated") 147 .css({ 148 webkitAnimationDelay: delay, 149 animationDelay: delay, 150 webkitAnimationDuration: duration, 151 animationDuration: duration, 152 }) 153 .one("animationend", function () { 154 $(this).removeClass(anim + " animated"); 155 }); 156 }); 157 }; 158 animated(); 159 init.on("slideChange", function () { 160 $(sliderActive1 + " [data-animation]").removeClass("animated"); 161 }); 162 init.on("slideChange", animated); 163 } 164 animated_swiper(sliderActive1, sliderInit1); 165 166 //>> Video Popup Start <<// 167 $(".img-popup").magnificPopup({ 168 type: "image", 169 gallery: { 170 enabled: true, 171 }, 172 }); 173 174 $('.video-popup').magnificPopup({ 175 type: 'iframe', 176 callbacks: { 177 } 178 }); 179 180 //>> Counterup Start <<// 181 $(".count").counterUp({ 182 delay: 15, 183 time: 4000, 184 }); 185 186 //>> Wow Animation Start <<// 187 new WOW().init(); 188 189 //>> Nice Select Start <<// 190 $('select').niceSelect(); 191 192 193 194 if($('.testimonial-carousel-active-4').length > 0) { 195 $('.testimonial-carousel-active-4').slick({ 196 autoplay: true, 197 autoplaySpeed: 1500, 198 speed: 800, 199 slidesToShow: 1, 200 slidesToScroll: 1, 201 arrows: true, 202 dots: false, 203 prevArrow: $('.testimonial-nav-prev'), 204 nextArrow: $('.testimonial-nav-next'), 205 }); 206 } 207 208 209 //>> Search Popup Start <<// 210 const $searchWrap = $(".search-wrap"); 211 const $navSearch = $(".nav-search"); 212 const $searchClose = $("#search-close"); 213 214 $(".search-trigger").on("click", function (e) { 215 e.preventDefault(); 216 $searchWrap.animate({ opacity: "toggle" }, 500); 217 $navSearch.add($searchClose).addClass("open"); 218 }); 219 220 $(".search-close").on("click", function (e) { 221 e.preventDefault(); 222 $searchWrap.animate({ opacity: "toggle" }, 500); 223 $navSearch.add($searchClose).removeClass("open"); 224 }); 225 226 function closeSearch() { 227 $searchWrap.fadeOut(200); 228 $navSearch.add($searchClose).removeClass("open"); 229 } 230 231 $(document.body).on("click", function (e) { 232 closeSearch(); 233 }); 234 235 $(".search-trigger, .main-search-input").on("click", function (e) { 236 e.stopPropagation(); 237 }); 238 239 //>> Scroll Js Start <<// 240 const scrollPath = document.querySelector(".scroll-up path"); 241 const pathLength = scrollPath.getTotalLength(); 242 scrollPath.style.transition = scrollPath.style.WebkitTransition = "none"; 243 scrollPath.style.strokeDasharray = pathLength + " " + pathLength; 244 scrollPath.style.strokeDashoffset = pathLength; 245 scrollPath.getBoundingClientRect(); 246 scrollPath.style.transition = scrollPath.style.WebkitTransition = "stroke-dashoffset 10ms linear"; 247 248 const updatescroll = function() { 249 let scrolltotal = $(window).scrollTop(); 250 let height = $(document).height() - $(window).height(); 251 let scrolltotalheight = pathLength - (scrolltotal * pathLength) / height; 252 scrollPath.style.strokeDashoffset = scrolltotalheight; 253 }; 254 updatescroll(); 255 256 $(window).scroll(updatescroll); 257 const offset = 50; 258 const duration = 950; 259 260 $(window).on("scroll", function() { 261 if (jQuery(this).scrollTop() > offset) { 262 jQuery(".scroll-up").addClass("active-scroll"); 263 } else { 264 jQuery(".scroll-up").removeClass("active-scroll"); 265 } 266 }); 267 268 $(".scroll-up").on("click", function(event) { 269 event.preventDefault(); 270 jQuery("html, body").animate({ 271 scrollTop: 0, 272 }, 273 duration 274 ); 275 return false;
276 }); 277 278 //>> Mouse Cursor Start <<// 279 function mousecursor() { 280 if ($("body")) { 281 const e = document.querySelector(".cursor-inner"), 282 t = document.querySelector(".cursor-outer"); 283 let n, 284 i = 0, 285 o = !1; 286 (window.onmousemove = function(s) { 287 o || 288 (t.style.transform = 289 "translate(" + s.clientX + "px, " + s.clientY + "px)"), 290 (e.style.transform = 291 "translate(" + s.clientX + "px, " + s.clientY + "px)"), 292 (n = s.clientY), 293 (i = s.clientX); 294 }), 295 $("body").on("mouseenter", "a, .cursor-pointer", function() { 296 e.classList.add("cursor-hover"), t.classList.add("cursor-hover"); 297 }), 298 $("body").on("mouseleave", "a, .cursor-pointer", function() { 299 ($(this).is("a") && $(this).closest(".cursor-pointer").length) || 300 (e.classList.remove("cursor-hover"), 301 t.classList.remove("cursor-hover")); 302 }), 303 (e.style.visibility = "visible"), 304 (t.style.visibility = "visible"); 305 } 306 } 307 $(function() { 308 mousecursor(); 309 }); 310 311 312 // circle-progress 313 if ($(".circle-bar").length > 0) { 314 $(".circle-bar").loading(); 315 } 316 317 318 }); // End Document Ready Function 319 320 $.fn.loading = function() { 321 const DEFAULTS = { 322 backgroundColor: '#b3cef6', 323 progressColor: '#4b86db', 324 percent: 75, 325 duration: 2000 326 }; 327 328 $(this).each(function() { 329 const $target = $(this); 330 331 const opts = { 332 backgroundColor: $target.data('color') ? $target.data('color').split(',')[0] : DEFAULTS.backgroundColor, 333 progressColor: $target.data('color') ? $target.data('color').split(',')[1] : DEFAULTS.progressColor, 334 percent: $target.data('percent') ? $target.data('percent') : DEFAULTS.percent, 335 duration: $target.data('duration') ? $target.data('duration') : DEFAULTS.duration 336 }; 337 // console.log(opts); 338 339 $target.append('<div class="background"></div><div class="rotate"></div><div class="left"></div><div class="right"></div><div class=""><span>' + opts.percent + '%</span></div>'); 340 341 $target.find('.background').css('background-color', opts.backgroundColor); 342 $target.find('.left').css('background-color', opts.backgroundColor); 343 $target.find('.rotate').css('background-color', opts.progressColor); 344 $target.find('.right').css('background-color', opts.progressColor); 345 346 const $rotate = $target.find('.rotate'); 347 setTimeout(function() { 348 $rotate.css({ 349 'transition': 'transform ' + opts.duration + 'ms linear', 350 'transform': 'rotate(' + opts.percent * 3.6 + 'deg)' 351 }); 352 }, 1); 353 354 if (opts.percent > 50) { 355 let animationRight = 'toggle ' + (opts.duration / opts.percent * 50) + 'ms step-end'; 356 let animationLeft = 'toggle ' + (opts.duration / opts.percent * 50) + 'ms step-start'; 357 $target.find('.right').css({ 358 animation: animationRight, 359 opacity: 1 360 }); 361 $target.find('.left').css({ 362 animation: animationLeft, 363 opacity: 0 364 }); 365 } 366 }); 367 } 368 369 function loader() { 370 $(window).on('load', function() { 371 // Animate loader off screen 372 $(".preloader").addClass('loaded'); 373 $(".preloader").delay(600).fadeOut(); 374 }); 375} 376loader(); 377 378 379})(jQuery); // End jQuery 380
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.