Giter Site home page Giter Site logo

弹跳效果 about you-need-to-know-css HOT 1 OPEN

l-hammer avatar l-hammer commented on July 29, 2024
弹跳效果

from you-need-to-know-css.

Comments (1)

lcl-101 avatar lcl-101 commented on July 29, 2024

这个小球的动画有点太生硬了,给你推荐一个方法,自己从安卓包里提取出来的

function bounce(t){
            var ts=t * t * 8.0;
            return ts;
        }
        function getInterpolation(t){
            var t = t*1.1226;
            if(t<0.3535){
                return bounce(t);
            }else if(t < 0.7408){
                return bounce(t - 0.54719) + 0.7;
            }else if(t < 0.9644){
                return bounce(t - 0.8526) + 0.9;
            }else {
                return bounce(t - 1.0435) + 0.95;
            }
        }
        var tt=0;
        setInterval(function(){
            tt++;
            if(tt>=1000){
                return;
            }
            var s=-50*getInterpolation(tt / 1000)+50;
            $('.qing-transform').show().css({transform: 'rotate('+-s+'deg)','-webkit-transform': 'rotate('+-s+'deg)','-moz-transform': 'rotate('+-s+'deg)','-o-transform': 'rotate('+-s+'deg)'})
        },1)

演示地址

demo
image

自由落体文档地址

自由落体

from you-need-to-know-css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.