1/* =================================================================== 2 * Dazzle - Main JS 3 * 4 * ------------------------------------------------------------------- */ 5 6(function($) { 7 8 "use strict"; 9 10 var cfg = { 11 scrollDuration : 800, // smoothscroll duration 12 mailChimpURL : 'https://facebook.us8.list-manage.com/subscribe/post?u=cdb7b577e41181934ed6a6a44&id=e6957d85dc' // mailchimp url 13 }, 14 15 $WIN = $(window); 16 17 // Add the User Agent to the <html> 18 // will be used for IE10 detection (Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)) 19 var doc = document.documentElement; 20 doc.setAttribute('data-useragent', navigator.userAgent); 21 22 23 /* Preloader 24 * -------------------------------------------------- */ 25 var ssPreloader = function() { 26 27 $WIN.on('load', function() { 28 29 // force page scroll position to top at page refresh 30 $('html, body').animate({ scrollTop: 0 }, 'normal'); 31 32 // will fade out the whole preloader DIV that covers the website. 33 $("#preloader").delay(500).fadeOut('slow'); 34 35 }); 36 }; 37 38 39 /* Mobile Menu 40 * ---------------------------------------------------- */ 41 var ssMobileMenu = function() { 42 43 var toggleButton = $('.header-menu-toggle'), 44 nav = $('#header-nav-wrap'); 45 46 toggleButton.on('click', function(event){ 47 event.preventDefault(); 48 49 toggleButton.toggleClass('is-clicked'); 50 nav.slideToggle(); 51 }); 52 53 if (toggleButton.is(':visible')) nav.addClass('mobile'); 54 55 $(window).resize(function() { 56 if (toggleButton.is(':visible')) nav.addClass('mobile'); 57 else nav.removeClass('mobile'); 58 }); 59 60 $('#header-nav-wrap').find('a').on("click", function() { 61 62 if (nav.hasClass('mobile')) { 63 toggleButton.toggleClass('is-clicked'); 64 nav.slideToggle(); 65 } 66 }); 67 68 }; 69 70 71 /* FitVids 72 * ---------------------------------------------------- */ 73 var ssFitVids = function() { 74 $(".fluid-video-wrapper").fitVids(); 75 }; 76 77 78 79 /* Owl Carousel 80 * ------------------------------------------------------ */ 81 var ssOwlCarousel = function() { 82 83 $(".owl-carousel").owlCarousel({ 84 loop: true, 85 nav: false, 86 autoHeight: true, 87 items: 1 88 }); 89 90 }; 91 92 93 /* Highlight the current section in the navigation bar 94 * ------------------------------------------------------ */ 95 var ssWaypoints = function() { 96 97 var sections = $("section"), 98 navigation_links = $(".header-main-nav li a"); 99 100 sections.waypoint( { 101 102 handler: function(direction) { 103 104 var active_section; 105 106 active_section = $('section#' + this.element.id); 107 108 if (direction === "up") active_section = active_section.prev(); 109 110 var active_link = $('.header-main-nav li a[href="#' + active_section.attr("id") + '"]'); 111 112 navigation_links.parent().removeClass("current"); 113 active_link.parent().addClass("current"); 114 115 }, 116 117 offset: '25%' 118 119 }); 120 }; 121 122 123 /* Smooth Scrolling 124 * ------------------------------------------------------ */ 125 var ssSmoothScroll = function() { 126 127 $('.smoothscroll').on('click', function (e) { 128 var target = this.hash, 129 $target = $(target); 130 131 e.preventDefault(); 132 e.stopPropagation(); 133 134 $('html, body').stop().animate({ 135 'scrollTop': $target.offset().top 136 }, cfg.scrollDuration, 'swing', function () { 137 window.location.hash = target; 138 }); 139 140 }); 141 142 }; 143 144 145 146 /* Placeholder Plugin Settings 147 * ------------------------------------------------------ */ 148 var ssPlaceholder = function() { 149 $('input, textarea, select').placeholder(); 150 }; 151 152 153 154 /* Alert Boxes 155 ------------------------------------------------------- */ 156 var ssAlertBoxes = function() { 157 158 $('.alert-box').on('click', '.close', function() { 159 $(this).parent().fadeOut(500); 160 }); 161 162 }; 163 164 165 166 /* Animate On Scroll 167 * ------------------------------------------------------ */ 168 var ssAOS = function() { 169 170 AOS.init( { 171 offset: 200, 172 duration: 600, 173 easing: 'ease-in-sine', 174 delay: 300, 175 once: true, 176 disable: 'mobile' 177 }); 178 179 }; 180 181 182 /* AjaxChimp 183 * ------------------------------------------------------ */ 184 var ssAjaxChimp = function() { 185 186 $('#mc-form').ajaxChimp({ 187 language: 'es', 188 url: cfg.mailChimpURL 189 }); 190 191 // Mailchimp translation 192 // 193 // Defaults: 194 // 'submit': 'Submitting...', 195 // 0: 'We have sent you a confirmation email', 196 // 1: 'Please enter a value', 197 // 2: 'An email address must contain a single @',
198 // 3: 'The domain portion of the email address is invalid (the portion after the @: )', 199 // 4: 'The username portion of the email address is invalid (the portion before the @: )', 200 // 5: 'This email address looks fake or invalid. Please enter a real email address' 201 202 $.ajaxChimp.translations.es = { 203 'submit': 'Submitting...', 204 0: '<i class="fa fa-check"></i> We have sent you a confirmation email', 205 1: '<i class="fa fa-warning"></i> You must enter a valid e-mail address.', 206 2: '<i class="fa fa-warning"></i> E-mail address is not valid.', 207 3: '<i class="fa fa-warning"></i> E-mail address is not valid.', 208 4: '<i class="fa fa-warning"></i> E-mail address is not valid.', 209 5: '<i class="fa fa-warning"></i> E-mail address is not valid.' 210 } 211 212 }; 213 214 215 216 /* Back to Top 217 * ------------------------------------------------------ */ 218 var ssBackToTop = function() { 219 220 var pxShow = 500, // height on which the button will show 221 fadeInTime = 400, // how slow/fast you want the button to show 222 fadeOutTime = 400, // how slow/fast you want the button to hide 223 scrollSpeed = 300, // how slow/fast you want the button to scroll to top. can be a value, 'slow', 'normal' or 'fast' 224 goTopButton = $("#go-top") 225 226 // Show or hide the sticky footer button 227 $(window).on('scroll', function() { 228 if ($(window).scrollTop() >= pxShow) { 229 goTopButton.fadeIn(fadeInTime); 230 } else { 231 goTopButton.fadeOut(fadeOutTime); 232 } 233 }); 234 }; 235 236 237 /* Initialize 238 * ------------------------------------------------------ */ 239 (function ssInit() { 240 241 ssPreloader(); 242 ssMobileMenu(); 243 ssFitVids(); 244 ssOwlCarousel(); 245 ssWaypoints(); 246 ssSmoothScroll(); 247 ssPlaceholder(); 248 ssAlertBoxes(); 249 ssAOS(); 250 ssAjaxChimp(); 251 ssBackToTop(); 252 253 })(); 254 255 256})(jQuery);
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.