1// JavaScript Document 2 3 4 $(window).on('load', function() { 5 6 "use strict"; 7 8 /*----------------------------------------------------*/ 9 /* Preloader 10 /*----------------------------------------------------*/ 11 12 $("#loader").delay(100).fadeOut(); 13 $("#loader-wrapper").delay(100).fadeOut("fast"); 14 15 $(window).stellar({}); 16 17 }); 18 19 20 $(window).on('scroll', function() { 21 22 "use strict"; 23 24 /*----------------------------------------------------*/ 25 /* Navigtion Menu Scroll 26 /*----------------------------------------------------*/ 27 28 var b = $(window).scrollTop(); 29 30 if( b > 72 ){ 31 $(".navbar").addClass("scroll"); 32 } else { 33 $(".navbar").removeClass("scroll"); 34 } 35 36 37 }); 38 39 40 $(document).ready(function() { 41 42 "use strict"; 43 44 45 /*----------------------------------------------------*/ 46 /* Mobile Menu Toggle 47 /*----------------------------------------------------*/ 48 49 $('.navbar-nav li.nav-item.nl-simple').on('click', function() { 50 $('#navbarSupportedContent').css("height", "1px").removeClass("in").addClass("collapse"); 51 $('#navbarSupportedContent').removeClass("show"); 52 }); 53 54 55 /*----------------------------------------------------*/ 56 /* OnScroll Animation 57 /*----------------------------------------------------*/ 58 59 $('.animated').appear(function() { 60 61 var elem = $(this); 62 var animation = elem.data('animation'); 63 64 if ( !elem.hasClass('visible') ) { 65 var animationDelay = elem.data('animation-delay'); 66 if ( animationDelay ) { 67 setTimeout(function(){ 68 elem.addClass( animation + " visible" ); 69 }, animationDelay); 70 71 } else { 72 elem.addClass( animation + " visible" ); 73 } 74 } 75 76 }); 77 78 79 /*----------------------------------------------------*/ 80 /* Animated Scroll To Anchor 81 /*----------------------------------------------------*/ 82 83 $('.header a[href^="#"], .page a.btn[href^="#"], .page a.internal-link[href^="#"]').on('click', function (e) { 84 85 e.preventDefault(); 86 87 var target = this.hash, 88 $target = jQuery(target); 89 90 $('html, body').stop().animate({ 91 'scrollTop': $target.offset().top - 60 // - 200px (nav-height) 92 }, 'slow', 'easeInSine', function () { 93 window.location.hash = '1' + target; 94 }); 95 96 }); 97 98 99 /*----------------------------------------------------*/ 100 /* ScrollUp 101 /*----------------------------------------------------*/ 102 103 $.scrollUp = function (options) { 104 105 // Defaults 106 var defaults = { 107 scrollName: 'scrollUp', // Element ID 108 topDistance: 600, // Distance from top before showing element (px) 109 topSpeed: 800, // Speed back to top (ms) 110 animation: 'fade', // Fade, slide, none 111 animationInSpeed: 200, // Animation in speed (ms) 112 animationOutSpeed: 200, // Animation out speed (ms) 113 scrollText: '', // Text for element 114 scrollImg: false, // Set true to use image 115 activeOverlay: false // Set CSS color to display scrollUp active point, e.g '#00FFFF' 116 }; 117 118 var o = $.extend({}, defaults, options), 119 scrollId = '#' + o.scrollName; 120 121 // Create element 122 $('<a/>', { 123 id: o.scrollName, 124 href: '#top', 125 title: o.scrollText 126 }).appendTo('body'); 127 128 // If not using an image display text 129 if (!o.scrollImg) { 130 $(scrollId).text(o.scrollText); 131 } 132 133 // Minium CSS to make the magic happen 134 $(scrollId).css({'display':'none','position': 'fixed','z-index': '2147483647'}); 135 136 // Active point overlay 137 if (o.activeOverlay) { 138 $("body").append("<div id='"+ o.scrollName +"-active'></div>"); 139 $(scrollId+"-active").css({ 'position': 'absolute', 'top': o.topDistance+'px', 'width': '100%', 'border-top': '1px dotted '+o.activeOverlay, 'z-index': '2147483647' }); 140 } 141 142 // Scroll function 143 $(window).on('scroll', function(){ 144 switch (o.animation) { 145 case "fade": 146 $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).fadeIn(o.animationInSpeed) : $(scrollId).fadeOut(o.animationOutSpeed) ); 147 break; 148 case "slide": 149 $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).slideDown(o.animationInSpeed) : $(scrollId).slideUp(o.animationOutSpeed) ); 150 break; 151 default: 152 $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).show(0) : $(scrollId).hide(0) ); 153 } 154 }); 155 156 // To the top 157 $(scrollId).on('click', function(event){ 158 $('html, body').animate({scrollTop:0}, o.topSpeed); 159 event.preventDefault(); 160 }); 161 162 }; 163 164 $.scrollUp(); 165 166 167 /*----------------------------------------------------*/ 168 /* Video Link Lightbox 169 /*----------------------------------------------------*/ 170 171 $('.video-popup').magnificPopup({ 172 type: 'iframe', 173 174 iframe: { 175 patterns: { 176 youtube: { 177 178 index: 'youtube.com', 179 src: 'https://www.youtube.com/embed/kuceVNBTJio' 180 181 } 182 } 183 } 184 }); 185 186 187 /*----------------------------------------------------*/ 188 /* Statistic Counter 189 /*----------------------------------------------------*/ 190 191 $('.statistic-number').each(function () { 192 $(this).appear(function() { 193 $(this).prop('Counter',0).animate({ 194 Counter: $(this).text() 195 }, { 196 duration: 4000, 197 easing: 'swing', 198 step: function (now) { 199 $(this).text(Math.ceil(now)); 200 } 201 }); 202 },{accX: 0, accY: 0}); 203 }); 204 205 206 /*----------------------------------------------------*/ 207 /* Testimonials Rotator Slick Carousel 208 /*----------------------------------------------------*/ 209 210 $('#reviews-1 .center, #reviews-2 .center').slick({ 211 centerMode: true, 212 autoplay: true, 213 centerPadding: '0px',
214 speed: 800, 215 slidesToShow: 3, 216 dots: true, 217 responsive: [ 218 { 219 breakpoint: 1199, 220 settings: { 221 arrows: false, 222 centerMode: true, 223 centerPadding: '0px', 224 slidesToShow: 3 225 } 226 }, 227 { 228 breakpoint: 991, 229 settings: { 230 arrows: false, 231 centerMode: true, 232 centerPadding: '0px', 233 slidesToShow: 3 234 } 235 }, 236 { 237 breakpoint: 800, 238 settings: { 239 arrows: false, 240 centerMode: true, 241 centerPadding: '0px', 242 slidesToShow: 1 243 } 244 }, 245 { 246 breakpoint: 767, 247 settings: { 248 arrows: false, 249 centerMode: true, 250 centerPadding: '0px', 251 slidesToShow: 1 252 } 253 }, 254 { 255 breakpoint: 648, 256 settings: { 257 arrows: false, 258 centerMode: true, 259 centerPadding: '0px', 260 slidesToShow: 1 261 } 262 } 263 ] 264 }); 265 266 267 /*----------------------------------------------------*/ 268 /* Screens Carousel Slick 269 /*----------------------------------------------------*/ 270 271 $('.screens-carousel').slick({ 272 infinite: true, 273 autoplay: true, 274 centerMode: true, 275 dots: true, 276 autoplaySpeed: 3500, 277 speed: 1000, 278 slidesToShow: 5, 279 slidesToScroll: 1, 280 variableWidth: true, 281 responsive: [ 282 { 283 breakpoint: 769, 284 settings: { 285 slidesToShow: 3 286 } 287 }, 288 { 289 breakpoint: 480, 290 settings: { 291 dots: false, 292 slidesToShow: 1, 293 variableWidth: false, 294 fade: true, 295 cssEase: 'linear' 296 } 297 } 298 ] 299 }); 300 301 302 303 /*----------------------------------------------------*/ 304 /* Contact Form Validation 305 /*----------------------------------------------------*/ 306 307 $(".contact-form").validate({ 308 rules:{ 309 name:{ 310 required: true, 311 minlength: 1, 312 maxlength: 16, 313 }, 314 email:{ 315 required: true, 316 email: true, 317 }, 318 message:{ 319 required: true, 320 minlength: 2, 321 } 322 }, 323 messages:{ 324 name:{ 325 required: "Please enter no more than (1) characters" 326 }, 327 email:{ 328 required: "We need your email address to contact you", 329 email: "Your email address must be in the format of [email protected]" 330 }, 331 message:{ 332 required: "Please enter no more than (2) characters" 333 }, 334 } 335 }); 336 337 338 /*----------------------------------------------------*/ 339 /* Comment Form Validation 340 /*----------------------------------------------------*/ 341 342 $(".comment-form").validate({ 343 rules:{ 344 name:{ 345 required: true, 346 minlength: 1, 347 maxlength: 16, 348 }, 349 email:{ 350 required: true, 351 email: true, 352 }, 353 message:{ 354 required: true, 355 minlength: 2, 356 } 357 }, 358 messages:{ 359 name:{ 360 required: "Please enter no more than (1) characters" 361 }, 362 email:{ 363 required: "We need your email address to contact you", 364 email: "Your email address must be in the format of [email protected]" 365 }, 366 message:{ 367 required: "Please enter no more than (2) characters" 368 }, 369 } 370 }); 371 372 373 /*----------------------------------------------------*/ 374 /* Bottom Quick Form 375 /*----------------------------------------------------*/ 376 377 $('.bottom-form-header').parent().delay(1000).animate({bottom: '-311px'}, 1000, function(){ 378 $(this).find('.bottom-form-header').addClass('closed'); 379 }); 380 381 382 $('.bottom-form-header').click(function(){ 383 if ($(this).hasClass('closed')){ 384 $(this).next('.bottom-form-holder').css({display:'block'}).parent().animate({bottom: 0}, 1000, function(){ 385 $(this).find('.bottom-form-header').removeClass('closed'); 386 }); 387 } else { 388 $(this).parent().animate({bottom: '-311px'}, 1000, function(){ 389 $(this).find('.bottom-form-header').addClass('closed'); 390 }); 391 } 392 393 return false; 394 }); 395 396 397 /*----------------------------------------------------*/ 398 /* Newsletter Subscribe Form 399 /*----------------------------------------------------*/ 400 401 $('.newsletter-form').ajaxChimp({ 402 language: 'cm', 403 url: 'http://dsathemes.us3.list-manage.com/subscribe/post?u=af1a6c0b23340d7b339c085b4&id=344a494a6e' 404 //http://xxx.xxx.list-manage.com/subscribe/post?u=xxx&id=xxx 405 }); 406 407 408 $.ajaxChimp.translations.cm = { 409 'submit': 'Submitting...', 410 0: 'We have sent you a confirmation email', 411 1: 'Please enter your email address', 412 2: 'An email address must contain a single @',
413 3: 'The domain portion of the email address is invalid (the portion after the @: )', 414 4: 'The username portion of the email address is invalid (the portion before the @: )', 415 5: 'This email address looks fake or invalid. Please enter a real email address' 416 }; 417 418 419 420 });
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.