1/*! css3 flip transition plugin for Cycle2; version: 20140128 */ 2/*! originally written by Laubeee (https://github.com/Laubeee) */ 3(function($) { 4"use strict"; 5 6var backface, 7 style = document.createElement('div').style, 8 tx = $.fn.cycle.transitions, 9 supported = style.transform !== undefined || 10 style.MozTransform !== undefined || 11 style.webkitTransform !== undefined || 12 style.oTransform !== undefined || 13 style.msTransform !== undefined; 14 15if ( supported && style.msTransform !== undefined ) { 16 style.msTransform = 'rotateY(0deg)'; 17 if ( ! style.msTransform ) 18 supported = false; 19} 20 21if ( supported ) { 22 tx.flipHorz = getTransition( getRotate('Y') ); 23 tx.flipVert = getTransition( getRotate('X') ); 24 backface = { 25 '-webkit-backface-visibility': 'hidden', 26 '-moz-backface-visibility': 'hidden', 27 '-o-backface-visibility': 'hidden', 28 'backface-visibility': 'hidden' 29 }; 30} 31else { 32 // fallback to scroll tx for browsers that don't support transforms 33 tx.flipHorz = tx.scrollHorz; 34 tx.flipVert = tx.scrollVert || tx.scrollHorz; 35} 36 37 38function getTransition( rotateFn ) { 39 // return C2 transition object 40 return { 41 preInit: function( opts ) { 42 opts.slides.css( backface ); 43 }, 44 transition: function( slideOpts, currEl, nextEl, fwd, callback ) { 45 var opts = slideOpts, 46 curr = $(currEl), 47 next = $(nextEl), 48 speed = opts.speed / 2; 49 50 // css before transition start 51 rotateFn.call(next, -90); 52 next.css({ 53 'display': 'block', 54 'visibility': 'visible', 55 'background-position': '-90px', 56 'opacity': 1 57 }); 58 59 curr.css('background-position', '0px'); 60 61 curr.animate({ backgroundPosition: 90 }, { 62 step: rotateFn, 63 duration: speed, 64 easing: opts.easeOut || opts.easing, 65 complete: function() { 66 slideOpts.API.updateView( false, true ); 67 next.animate({ backgroundPosition: 0 }, { 68 step: rotateFn, 69 duration: speed, 70 easing: opts.easeIn || opts.easing, 71 complete: callback 72 }); 73 } 74 }); 75 } 76 }; 77} 78 79function getRotate( dir ) { 80 return function( degrees ) { 81 /*jshint validthis:true */ 82 var el = $(this); 83 el.css({ 84 '-webkit-transform': 'rotate'+dir+'('+degrees+'deg)', 85 '-moz-transform': 'rotate'+dir+'('+degrees+'deg)', 86 '-ms-transform': 'rotate'+dir+'('+degrees+'deg)', 87 '-o-transform': 'rotate'+dir+'('+degrees+'deg)', 88 'transform': 'rotate'+dir+'('+degrees+'deg)' 89 }); 90 }; 91} 92 93})(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.