1(function () { 2 "use strict"; 3 var karla = { 4 init: function () { 5 this.cacheDom(); 6 this.bindEvents(); 7 this.initSlider(); 8 this.navOverlay(); 9 this.totopButton(); 10 this.enablePopupGallery(); 11 } 12 , cacheDom: function () { 13 this.toTop = $('.totop'); 14 this._body = $('body'); 15 this.karlaHomepageSlider = $('.karla-slider'); 16 this.karlaInstaCarouselSlider = $('.insta-carousel-slider'); 17 this.karlaInstaSlider = $('.karla-insta-slider'); 18 this.karlaMenuTrigger = $('.karla-hamburger-trigger'); 19 this.karlaMainMenu = $('.karla-nav-overlay-main-nav'); 20 this.karlaOverlayMenuHolder = $('.karla-nav-overlay'); 21 this.karlaOverlayMenuClose = $('.karla-nav-overlay-close'); 22 this.karlaMenuLinks = $('.karla-nav-overlay-main-nav li a'); 23 this.karlaGalleryTabs = $('.karla-toolbar-item'); 24 this.karlaGalleryItem = $('.karla-gallery-item'); 25 } 26 , bindEvents: function () { 27 var self = this; 28 this.karlaGalleryTabs.on('click', self.changeActiveTab); 29 this.karlaGalleryTabs.on('click', self.addGalleryFilter); 30 $(window).on('load', self.enablePreloader); 31 } 32 , /* popup gallery */ 33 enablePopupGallery: function () { 34 $('.karla-popup-gallery').each(function () { 35 $(this).magnificPopup({ 36 delegate: 'a' 37 , type: 'image' 38 , gallery: { 39 enabled: true 40 } 41 }); 42 }); 43 } 44 , /* preloader */ 45 enablePreloader: function () { 46 var preloader = $('#karla-page-loading').delay(500); 47 if (preloader.length > 0) { 48 preloader.fadeOut("slow", function () { 49 preloader.remove(); 50 }); 51 } 52 } 53 , /* gallery tab */ 54 changeActiveTab: function () { 55 $(this).closest('.karla-gallery-toolbar').find('.active').removeClass('active'); 56 $(this).addClass('active'); 57 } 58 , /* gallery filter */ 59 addGalleryFilter: function () { 60 var value = $(this).attr('data-filter'); 61 if (value === 'all') { 62 karla.karlaGalleryItem.show('3000'); 63 } 64 else { 65 karla.karlaGalleryItem.not('.' + value).hide('3000'); 66 karla.karlaGalleryItem.filter('.' + value).show('3000'); 67 } 68 } 69 , /* slider */ 70 initSlider: function () { 71 var self = this; 72 /* homepage slider */ 73 self.karlaHomepageSlider.slick({ 74 infinite: true 75 , arrows: false 76 , autoplay: true 77 , speed: 3000 78 , slidesToShow: 3 79 , slidesToScroll: 3 80 , responsive: [ 81 { 82 breakpoint: 768 83 , settings: { 84 slidesToShow: 1 85 , slidesToScroll: 1 86 , speed: 1000 87 } 88 } 89 ] 90 }); 91 } 92 , /* navigation overlay*/ 93 navOverlay: function () { 94 var self = this; 95 if (self.karlaMainMenu.length > 0) { 96 var closeMenu = function () { 97 self.karlaOverlayMenuHolder.removeClass('is-active'); 98 self.karlaOverlayMenuHolder.addClass('karla-nav-overlay-closed'); 99 self.karlaMenuTrigger.removeClass('is-active'); 100 setTimeout(function () { 101 self._body.css('overflow', ''); 102 }, 700); 103 }; 104 var openMenu = function () { 105 self.karlaOverlayMenuHolder.addClass('is-active'); 106 self.karlaOverlayMenuHolder.removeClass('karla-nav-overlay-closed'); 107 self.karlaMenuTrigger.addClass('is-active'); 108 self._body.css('overflow', 'hidden'); 109 }; 110 var toggleOpen = function () { 111 if (self.karlaOverlayMenuHolder.hasClass('is-active')) { 112 closeMenu(); 113 } 114 else { 115 openMenu(); 116 } 117 }; 118 /* Open menu trigger */ 119 self.karlaMenuTrigger.on('click', function (e) { 120 e.preventDefault(); 121 toggleOpen(); 122 }); 123 /* Close Button */ 124 self.karlaOverlayMenuClose.on('click', function (e) { 125 e.preventDefault(); 126 toggleOpen(); 127 }); 128 /* Close menu if the menu links are clicked */ 129 self.karlaMenuLinks.on('click', function (e) { 130 self.karlaMainMenu.find('li .active').removeClass('active'); 131 $(this).addClass('active'); 132 toggleOpen(); 133 // Get the link id 134 var $link = $(this) 135 , linkAttribute = $link.attr('href') 136 , sectionId = linkAttribute.substring(linkAttribute.indexOf('#')) 137 , $section = $(sectionId); 138 if ($section.length !== 0) { 139 e.preventDefault(); 140 } 141 var positionToTop = $section.offset().top 142 , topOffset = $link.data('offset'); 143 // Check if link has offset 144 if (topOffset) { 145 positionToTop = positionToTop + topOffset; 146 } 147 // Scroll to element 148 $('html, body').animate({ 149 scrollTop: positionToTop 150 }, 'slow'); 151 }); 152 } 153 } 154 , /* ======= toTop ======= */ 155 totopButton: function () { 156 var self = this; 157 /* Show totop button*/ 158 $(window).scroll(function () {
159 var toTopOffset = self.toTop.offset().top; 160 var toTopHidden = 1000; 161 if (toTopOffset > toTopHidden) { 162 self.toTop.addClass('totop-vissible'); 163 } 164 else { 165 self.toTop.removeClass('totop-vissible'); 166 } 167 }); 168 /* totop button animation */ 169 if (self.toTop && self.toTop.length > 0) { 170 self.toTop.on('click', function (e) { 171 e.preventDefault(); 172 $('html, body').animate({ 173 scrollTop: 0 174 }, 'slow'); 175 }); 176 } 177 } 178 }; 179 // Scroll 180 var header = $(".start-style"); 181 $(window).scroll(function () { 182 var scroll = $(window).scrollTop(); 183 if (scroll >= 10) { 184 header.removeClass('start-style').addClass("scroll-on"); 185 } 186 else { 187 header.removeClass("scroll-on").addClass('start-style'); 188 } 189 }); 190 // Sections Background Image 191 var pageSection = $(".bg-img, section"); 192 pageSection.each(function (indx) { 193 if ($(this).attr("data-background")) { 194 $(this).css("background-image", "url(" + $(this).data("background") + ")"); 195 } 196 }); 197 // Clients owlCarousel 198 $('.clients .owl-carousel').owlCarousel({ 199 loop: true 200 , margin: 30 201 , mouseDrag: true 202 , autoplay: true 203 , dots: false 204 , responsiveClass: true 205 , responsive: { 206 0: { 207 margin: 10 208 , items: 2 209 } 210 , 600: { 211 items: 3 212 } 213 , 1000: { 214 items: 5 215 } 216 } 217 }); 218 // Testimonials owlCarousel 219 $('.testimonials .owl-carousel').owlCarousel({ 220 loop: true 221 , margin: 30 222 , mouseDrag: true 223 , autoplay: false 224 , dots: true 225 , nav: false 226 , navText: ["<i class='lnr ti-angle-left'></i>", "<i class='lnr ti-angle-right'></i>"] 227 , responsiveClass: true 228 , responsive: { 229 0: { 230 items: 1 231 , } 232 , 600: { 233 items: 1 234 } 235 , 1000: { 236 items: 1 237 } 238 } 239 }); 240 // Animations 241 var contentWayPoint = function () { 242 var i = 0; 243 $('.animate-box').waypoint(function (direction) { 244 if (direction === 'down' && !$(this.element).hasClass('animated')) { 245 i++; 246 $(this.element).addClass('item-animate'); 247 setTimeout(function () { 248 $('body .animate-box.item-animate').each(function (k) { 249 var el = $(this); 250 setTimeout(function () { 251 var effect = el.data('animate-effect'); 252 if (effect === 'fadeIn') { 253 el.addClass('fadeIn animated'); 254 } 255 else if (effect === 'fadeInLeft') { 256 el.addClass('fadeInLeft animated'); 257 } 258 else if (effect === 'fadeInRight') { 259 el.addClass('fadeInRight animated'); 260 } 261 else { 262 el.addClass('fadeInUp animated'); 263 } 264 el.removeClass('item-animate'); 265 }, k * 200, 'easeInOutExpo'); 266 }); 267 }, 100); 268 } 269 }, { 270 offset: '85%' 271 }); 272 }; 273 $(function () { 274 contentWayPoint(); 275 }); 276 // img zoom 277 $(".img-zoom").magnificPopup({ 278 type: "image" 279 , closeOnContentClick: !0 280 , mainClass: "mfp-fade" 281 , gallery: { 282 enabled: !0 283 , navigateByImgClick: !0 284 , preload: [0, 1] 285 } 286 }) 287 // Accordion 288 $(".accordion").on("click", ".title", function () { 289 $(this).next().slideDown(); 290 $(".accordion-info").not($(this).next()).slideUp(); 291 }); 292 $(".accordion").on("click", ".item", function () { 293 $(this).addClass("active").siblings().removeClass("active"); 294 }); 295 296 $(document).ready(function() { 297 $('.popup-youtube, .popup-vimeo, .popup-gmaps, .popup-custom').magnificPopup({ 298 disableOn: 700, 299 type: 'iframe', 300 mainClass: 'mfp-fade', 301 removalDelay: 160, 302 preloader: false,
303 fixedContentPos: false 304 }); 305 }); 306 307 karla.init(); 308})(); 309 310// Contact Form 311 var form = $('.contact__form'), 312 message = $('.contact__msg'), 313 form_data; 314 // success function 315 function done_func(response) { 316 message.fadeIn().removeClass('alert-danger').addClass('alert-success'); 317 message.text(response); 318 setTimeout(function () { 319 message.fadeOut(); 320 }, 2000); 321 form.find('input:not([type="submit"]), textarea').val(''); 322 } 323 // fail function 324 function fail_func(data) { 325 message.fadeIn().removeClass('alert-success').addClass('alert-success'); 326 message.text(data.responseText); 327 setTimeout(function () { 328 message.fadeOut(); 329 }, 2000); 330 } 331 form.submit(function (e) { 332 e.preventDefault(); 333 form_data = $(this).serialize(); 334 $.ajax({ 335 type: 'POST', 336 url: form.attr('action'), 337 data: form_data 338 }) 339 .done(done_func) 340 .fail(fail_func); 341 });
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.