宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

js缓动函数-风君子博客

tween: {
            easeInQuad: functionpos){
                return Math.powpos, 2);
            },

            easeOutQuad: functionpos){
                return -Math.powpos-1), 2) -1);
            },

            easeInOutQuad: functionpos){
                if pos/=0.5) < 1) return 0.5*Math.powpos,2);
                return -0.5 * pos-=2)*pos - 2);
            },

            easeInCubic: functionpos){
                return Math.powpos, 3);
            },

            easeOutCubic: functionpos){
                return Math.powpos-1), 3) +1);
            },

            easeInOutCubic: functionpos){
                if pos/=0.5) < 1) return 0.5*Math.powpos,3);
                return 0.5 * Math.powpos-2),3) + 2);
            },

            easeInQuart: functionpos){
                return Math.powpos, 4);
            },

            easeOutQuart: functionpos){
                return -Math.powpos-1), 4) -1)
            },

            easeInOutQuart: functionpos){
                if pos/=0.5) < 1) return 0.5*Math.powpos,4);
                return -0.5 * pos-=2)*Math.powpos,3) - 2);
            },

            easeInQuint: functionpos){
                return Math.powpos, 5);
            },

            easeOutQuint: functionpos){
                return Math.powpos-1), 5) +1);
            },

            easeInOutQuint: functionpos){
                if pos/=0.5) < 1) return 0.5*Math.powpos,5);
                return 0.5 * Math.powpos-2),5) + 2);
            },

            easeInSine: functionpos){
                return -Math.cospos * Math.PI/2)) + 1;
            },

            easeOutSine: functionpos){
                return Math.sinpos * Math.PI/2));
            },

            easeInOutSine: functionpos){
                return -.5 * Math.cosMath.PI*pos) -1));
            },

            easeInExpo: functionpos){
                return pos==0) ? 0 : Math.pow2, 10 * pos - 1));
            },

            easeOutExpo: functionpos){
                return pos==1) ? 1 : -Math.pow2, -10 * pos) + 1;
            },

            easeInOutExpo: functionpos){
                ifpos==0) return 0;
                ifpos==1) return 1;
                ifpos/=0.5) < 1) return 0.5 * Math.pow2,10 * pos-1));
                return 0.5 * -Math.pow2, -10 * --pos) + 2);
            },

            easeInCirc: functionpos){
                return -Math.sqrt1 - pos*pos)) - 1);
            },

            easeOutCirc: functionpos){
                return Math.sqrt1 - Math.powpos-1), 2))
            },

            easeInOutCirc: functionpos){
                ifpos/=0.5) < 1) return -0.5 * Math.sqrt1 - pos*pos) - 1);
                return 0.5 * Math.sqrt1 - pos-=2)*pos) + 1);
            },

            easeOutBounce: functionpos){
                if pos) < 1/2.75)) {
                    return 7.5625*pos*pos);
                } else if pos < 2/2.75)) {
                    return 7.5625*pos-=1.5/2.75))*pos + .75);
                } else if pos < 2.5/2.75)) {
                    return 7.5625*pos-=2.25/2.75))*pos + .9375);
                } else {
                    return 7.5625*pos-=2.625/2.75))*pos + .984375);
                }
            },

            easeInBack: functionpos){
                var s = 1.70158;
                return pos)*pos*s+1)*pos - s);
            },

            easeOutBack: functionpos){
                var s = 1.70158;
                return pos=pos-1)*pos*s+1)*pos + s) + 1;
            },

            easeInOutBack: functionpos){
                var s = 1.70158;
                ifpos/=0.5) < 1) return 0.5*pos*pos*s*=1.525))+1)*pos -s));
                return 0.5*pos-=2)*pos*s*=1.525))+1)*pos +s) +2);
            },

            elastic: functionpos) {
                return -1 * Math.pow4,-8*pos) * Math.sinpos*6-1)*2*Math.PI)/2) + 1;
            },

            swingFromTo: functionpos) {
                var s = 1.70158;
                return pos/=0.5) < 1) ? 0.5*pos*pos*s*=1.525))+1)*pos - s)) :
                0.5*pos-=2)*pos*s*=1.525))+1)*pos + s) + 2);
            },

            swingFrom: functionpos) {
                var s = 1.70158;
                return pos*pos*s+1)*pos - s);
            },

            swingTo: functionpos) {
                var s = 1.70158;
                return pos-=1)*pos*s+1)*pos + s) + 1;
            },

            bounce: functionpos) {
                if pos < 1/2.75)) {
                    return 7.5625*pos*pos);
                } else if pos < 2/2.75)) {
                    return 7.5625*pos-=1.5/2.75))*pos + .75);
                } else if pos < 2.5/2.75)) {
                    return 7.5625*pos-=2.25/2.75))*pos + .9375);
                } else {
                    return 7.5625*pos-=2.625/2.75))*pos + .984375);
                }
            },

            bouncePast: functionpos) {
                if pos < 1/2.75)) {
                    return 7.5625*pos*pos);
                } else if pos < 2/2.75)) {
                    return 2 - 7.5625*pos-=1.5/2.75))*pos + .75);
                } else if pos < 2.5/2.75)) {
                    return 2 - 7.5625*pos-=2.25/2.75))*pos + .9375);
                } else {
                    return 2 - 7.5625*pos-=2.625/2.75))*pos + .984375);
                }
            },

            easeFromTo: functionpos) {
                if pos/=0.5) < 1) return 0.5*Math.powpos,4);
                return -0.5 * pos-=2)*Math.powpos,3) - 2);
            },

            easeFrom: functionpos) {
                return Math.powpos,4);
            },

            easeTo: functionpos) {
                return Math.powpos,0.25);
            },

            linear:  functionpos) {
                return pos
            },

            sinusoidal: functionpos) {
                return -Math.cospos*Math.PI)/2) + 0.5;
            },

            reverse: functionpos) {
                return 1 - pos;
            },

            mirror: functionpos, transition) {
                transition = transition || tween.sinusoidal;
                ifpos<0.5)
                    return transitionpos*2);
                else
                    return transition1-pos-0.5)*2);
            },

            flicker: functionpos) {
                var pos = pos + Math.random)-0.5)/5;
                return tween.sinusoidalpos < 0 ? 0 : pos > 1 ? 1 : pos);
            },

            wobble: functionpos) {
                return -Math.cospos*Math.PI*9*pos))/2) + 0.5;
            },

            pulse: functionpos, pulses) {
                return -Math.cospos*pulses||5)-.5)*2)*Math.PI)/2) + .5;
            },

            blink: functionpos, blinks) {
                return Math.roundpos*blinks||5)) % 2;
            },

            spring: functionpos) {
                return 1 - Math.cospos * 4.5 * Math.PI) * Math.exp-pos * 6));
            },

            none: functionpos){
                return 0
            },

            full: functionpos){
                return 1
            }
        }