1(function($) { 2 3 "use strict"; 4 5 function zenwater_mainMenuClear() { 6 7 if ( $(window).width() >= 800 ) { 8 9 $('#navmain > div > ul > li').has('ul').removeClass('level-one-sub-menu'); 10 $('#navmain > div > ul li ul li').has('ul').removeClass('level-two-sub-menu'); 11 } 12 13 if ( $('ul:first-child', $('#navmain > div') ).is( ":visible" ) ) { 14 15 $('ul:first-child', $('#navmain > div') ).css('display', ''); 16 } 17 } 18 19 function zenwater_mainMenuInit() { 20 21 if ( $(window).width() >= 800 ) { 22 23 $('#navmain > div > ul > li').has('ul').addClass('level-one-sub-menu'); 24 $('#navmain > div > ul li ul li').has('ul').addClass('level-two-sub-menu'); 25 26 // add support of browsers which don't support focus-within 27 $('#navmain > div > ul > li > a:not(.login-form-icon):not(.search-form-icon), #navmain > div > ul > li > ul > li > a, #navmain > div > ul > li > ul > li > ul > li > a, .mega-menu-sub-menu') 28 .on('mouseenter focus', function() { 29 $(this).closest('li.level-one-sub-menu').addClass('menu-item-focused'); 30 $(this).closest('li.level-two-sub-menu').addClass('menu-item-focused'); 31 32 if (!$(this).parent().find('#cart-popup-content').length && $('#cart-popup-content').css('z-index') != '-1') 33 $('#cart-popup-content').css('z-index', '-1'); 34 }).on('mouseleave blur', function() { 35 $(this).closest('li.level-one-sub-menu').removeClass('menu-item-focused'); 36 $(this).closest('li.level-two-sub-menu').removeClass('menu-item-focused'); 37 }); 38 } 39 } 40 41 function zenwater_init_loading_effects() { 42 43 $('#header-logo').addClass("animations-hidden").viewportChecker({ 44 classToAdd: 'animated bounce', 45 offset: 1 46 }); 47 48 49 50 $('#page-header').addClass("animations-hidden").viewportChecker({ 51 classToAdd: 'animated bounceInUp', 52 offset: 1 53 }); 54 55 $('#main-content-wrapper h2, #main-content-wrapper h3') 56 .addClass("animations-hidden").viewportChecker({ 57 classToAdd: 'animated bounceInUp', 58 offset: 1 59 }); 60 61 $('img:not(.anim-skip)').addClass("animations-hidden").viewportChecker({ 62 classToAdd: 'animated zoomIn', 63 offset: 1 64 }); 65 66 $('#sidebar').addClass("animations-hidden").viewportChecker({ 67 classToAdd: 'animated zoomIn', 68 offset: 1 69 }); 70 71 $('.before-content, .after-content').addClass("animations-hidden").viewportChecker({ 72 classToAdd: 'animated bounce', 73 offset: 1 74 }); 75 76 $('.header-social-widget') 77 .addClass("animations-hidden").viewportChecker({ 78 classToAdd: 'animated bounceInLeft', 79 offset: 1 80 }); 81 82 $('article, article p, article li') 83 .addClass("animations-hidden").viewportChecker({ 84 classToAdd: 'animated zoomIn', 85 offset: 1 86 }); 87 88 $('#footer-main h1, #footer-main h2, #footer-main h3') 89 .addClass("animations-hidden").viewportChecker({ 90 classToAdd: 'animated bounceInUp', 91 offset: 1 92 }); 93 94 $('#footer-main p, #footer-main ul, #footer-main li, .footer-title, .col3a, .col3b, .col3c') 95 .addClass("animations-hidden").viewportChecker({ 96 classToAdd: 'animated zoomIn', 97 offset: 1 98 }); 99 100 $('.footer-social-widget') 101 .addClass("animations-hidden").viewportChecker({ 102 classToAdd: 'animated rubberBand', 103 offset: 1 104 }); 105 106 $('#footer-menu') 107 .addClass("animations-hidden").viewportChecker({ 108 classToAdd: 'animated bounceInDown', 109 offset: 1 110 }); 111 } 112 113 $( document ).ready(function() { 114 115 if (zenwater_options && zenwater_options.loading_effect) { 116 zenwater_init_loading_effects(); 117 } 118 119 $(window).on('scroll', function () { 120 121 if ($(this).scrollTop() > 100) { 122 123 $('.scrollup').fadeIn(); 124 125 } else { 126 127 $('.scrollup').fadeOut(); 128 129 } 130 }); 131 132 $('.scrollup').on('click', function () { 133 134 $("html, body").animate({ 135 scrollTop: 0 136 }, 600); 137 138 return false; 139 }); 140 141 zenwater_mainMenuInit(); 142 143 if ( $(window).width() < 800 ) { 144 145 $('#navmain > div > ul > li').each( 146 function() { 147 if ($(this).find('> ul.sub-menu').length > 0) { 148
149 $(this).prepend('<span class="sub-menu-item-toggle"></span>'); 150 } 151 } 152 ); 153 154 $('#navmain').on('focusin', function(){ 155 156 if ($('#navmain > div > ul').css('z-index') == '-1') { 157 158 $('#navmain > div > ul').css({'z-index': '5000'}); 159 $('#navmain ul ul').css({'z-index': '5000'}).css({'position': 'relative'}); 160 161 $('.sub-menu-item-toggle').addClass('sub-menu-item-toggle-expanded'); 162 } 163 }); 164 165 $('#main-content-wrapper, #home-content-wrapper').on('focusin', function(){ 166 167 if ($('#navmain > div > ul').css('z-index') != '-1') { 168 $('#navmain > div > ul').css({'z-index': '-1'}); 169 } 170 171 }); 172 173 $('.sub-menu-item-toggle').on('click', function(e) { 174 175 e.stopPropagation(); 176 177 var subMenu = $(this).parent().find('> ul.sub-menu'); 178 179 $('#navmain ul ul.sub-menu').not(subMenu).css('z-index', '-1').css('position', 'absolute'); 180 $(this).toggleClass('sub-menu-item-toggle-expanded'); 181 if (subMenu.css('z-index') == '-1') { 182 183 subMenu.css({'z-index': '5000'}).css({'position': 'relative'}); 184 subMenu.find('ul.sub-menu').css({'z-index': '5000'}).css({'position': 'relative'}); 185 186 } else { 187 188 subMenu.css({'z-index': '-1'}).css({'position': 'absolute'}); 189 subMenu.find('ul.sub-menu').css({'z-index': '-1'}).css({'position': 'absolute'}); 190 } 191 }); 192 193 } 194 195 $('#navmain > div').on('click', function(e) { 196 197 e.stopPropagation(); 198 199 // toggle main menu 200 if ( $(window).width() < 800 ) { 201 202 var parentOffset = $(this).parent().offset(); 203 204 var relY = e.pageY - parentOffset.top; 205 206 if (relY < 36) { 207 208 var firstChild = $('ul:first-child', this); 209 210 if (firstChild.css('z-index') == '-1') 211 firstChild.css({'z-index': '5000'}); 212 else 213 firstChild.css({'z-index': '-1'}); 214 215 firstChild.parent().toggleClass('mobile-menu-expanded'); 216 } 217 } 218 }); 219 220 // re-init main menu on screen resize 221 $(window).on('resize', function () { 222 223 zenwater_mainMenuClear(); 224 zenwater_mainMenuInit(); 225 }); 226 }); 227 228})(jQuery); 229 230 231jQuery(function() { 232 if (jQuery('#rm_container').length == 0) { 233 return; 234 } 235 var $listItems = jQuery('#rm_container > ul > li'), 236 totalItems = $listItems.length, 237 $rm_next = jQuery('#rm_next'), 238 $rm_prev = jQuery('#rm_prev'), 239 $rm_play = jQuery('#rm_play'), 240 $rm_pause = jQuery('#rm_pause'), 241 $rm_mask_left = jQuery('#rm_mask_left'), 242 $rm_mask_right = jQuery('#rm_mask_right'), 243 $rm_corner_left = jQuery('#rm_corner_left'), 244 $rm_corner_right= jQuery('#rm_corner_right'), 245 246 RotateImageMenu = (function() { 247 //difference of animation time between the items 248 var timeDiff = 300, 249 //time between each image animation (slideshow) 250 slideshowTime = 3000, 251 slideshowInterval, 252 //checks if the images are rotating 253 isRotating = false, 254 //how many images completed each slideshow iteration 255 completed = 0, 256 origin = ['155px', '930px'], 257 init = function() { 258 configure(); 259 initEventsHandler(); 260 }, 261 //initialize some events 262 initEventsHandler = function() { 263 $rm_next.on('click', function(e) { 264 stopSlideshow(); 265 rotateImages(1); 266 return false; 267 }); 268 $rm_prev.on('click', function(e) { 269 stopSlideshow(); 270 rotateImages(-1); 271 return false; 272 }); 273 /* 274 start and stop the slideshow 275 */ 276 $rm_play.on('click', function(e) { 277 startSlideshow(); 278 return false; 279 }); 280 $rm_pause.on('click', function(e) { 281 stopSlideshow(); 282 return false; 283 }); 284 285 jQuery(document).on('keydown', function(e){ 286 switch(e.which){ 287 case 37: 288 stopSlideshow(); 289 rotateImages(0); 290 break; 291 case 39: 292 stopSlideshow(); 293 rotateImages(1); 294 break; 295 } 296 }); 297 }, 298 /* 299 rotates each items images. 300 we set a delay between each item animation 301 */ 302 rotateImages = function(dir) { 303 //if the animation is in progress return 304 if(isRotating) return false; 305 306 isRotating = true; 307 308 $listItems.each(function(i) { 309 310 var $item = jQuery(this), 311 interval = (dir === 1) ? i * timeDiff : (totalItems - 1 - i) * timeDiff; 312 313 var $otherImages = jQuery('#' + $item.data('images')).children('img'), 314 totalOtherImages = $otherImages.length; 315 316 //the current one 317 $img = $item.children('img').last(), 318 //keep track of each items current image 319 current = $item.data('current'); 320 //out of bounds 321 if(current > totalOtherImages - 1) 322 current = 0; 323 else if(current < 0) 324 current = totalOtherImages - 1; 325 326 //the next image to show and its initial rotation (depends on dir) 327 var otherRotation = (dir === 1) ? '-30deg' : '30deg', 328 $other = $otherImages.eq(current).clone(); 329 330 $other.css({ 331 'transform-origin' : '155px 930px 0' 332 });
333 334 (dir === 1) ? ++current : --current; 335 336 //prepend the next image to the <li> 337 $item.data('current', current).prepend($other); 338 339 //the final rotation for the current image 340 var rotateTo = (dir === 1) ? '80deg' : '-80deg'; 341 342 $img.css({'transform':'rotate(' + rotateTo + ')','transition':'all ease 3s',}); 343 344 $img.delay(2000).queue(function() { 345 jQuery(this).remove(); 346 347 ++completed; 348 if(completed === 4) { 349 completed = 0; 350 isRotating = false; 351 } 352 353 $other.css({'transform':'rotate(0deg)','transition':'all ease 2s',}); 354 }); 355 }); 356 357 }, 358 //set initial rotations 359 configure = function() { 360 361 $listItems.each(function(i) { 362 //the initial current is 1 363 //since we already showing the first image 364 var $item = jQuery(this).data('current', 1); 365 366 var rotateTo = $item.data('rotation') + 'deg'; 367 $item.css({'transform':'rotate(' + rotateTo + ')'}); 368 369 $item.find('img').css({'transform-origin' : '155px 930px 0'}); 370 }); 371 }, 372 //rotates the masks and corners 373 rotateMaskCorners = function() { 374 $rm_mask_left.css({'transform':'rotate(-3deg)'}); 375 $rm_mask_right.css({'transform':'rotate(3deg)'}); 376 $rm_corner_left.css({'transform':'rotate(45deg)'}); 377 $rm_corner_right.css({'transform':'rotate(-45deg)'}); 378 }, 379 //hides the masks and corners 380 hideMaskCorners = function() { 381 $rm_mask_left.hide(); 382 $rm_mask_right.hide(); 383 $rm_corner_left.hide(); 384 $rm_corner_right.hide(); 385 }, 386 startSlideshow = function() { 387 clearInterval(slideshowInterval); 388 rotateImages(1); 389 slideshowInterval = setInterval(function() { 390 rotateImages(1); 391 }, slideshowTime); 392 //show the pause button and hide the play button 393 $rm_play.hide(); 394 $rm_pause.show(); 395 }, 396 stopSlideshow = function() { 397 clearInterval(slideshowInterval); 398 //show the play button and hide the pause button 399 $rm_pause.hide(); 400 $rm_play.show(); 401 }; 402 403 return {init : init}; 404 })(); 405 406 RotateImageMenu.init(); 407});
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.