Today in a book called "HTML5 Touch Interface Design and development" to see a bouncing ball complex animation effect, first speed down, stop, and then bounce gradually slowed down. is done with the Cubic-bezier Bezier curve. So I went to learn a little bit about the cubic-bezier Bezier curve.
Cubic-bezier is less used because the browser is incompatible in the PC side. But on the phone side, you can use and bring cool animations and experiences.
Easing function: http://www.xuanfengge.com/easeing/easeing/
cubic-bezier:http://cubic-bezier.com/
The Cubic-bezier is the drawing method in the Bezier curve.
Several animation effects commonly used in CSS3:
1 Ease:cubic-bezier (0.25, 0.1, 0.25, 1.0) 2 linear:cubic-bezier (0.0, 0.0, 1.0, 1.0) 3 Ease-in:cubic-bezier (0.42, 0, 1.0, 1.0) 4 ease-out:cubic-bezier (0, 0, 0.58, 1.0) 5 Ease-in-out:cubic-bezier (0.42, 0, 0.58, 1.0)
Bezier curves define a curve by four points. These four values describe the location of the control point P1,P2, and the other two points are always p0 (0,0) P3. Control points are the curves in the chart that give the ball a (positive or negative) acceleration as it bounces and drops. (0,.27,.32,1) plays a role in the Ascent, and (1,0,0.96,0.91) plays a role in the descent process.
Now that we know a little bit about the Bezier curve, let's look at a bouncing ball example.
HTML section:
1 < ID= "Ball"></div>2< ID= "floor></div>
CSS section:
1 Body{margin:0;padding:0;}2 #ball{3 background:Red;4 Height:100px;5 width:100px;6 position:Absolute;7 Top:10px;8 Left:20px;9 Border-radius:50px;Ten} One #floor{ A position:Absolute; - Bottom:10px; - Left:0px; the width:350px; - Height:1px; - Border-top:5px Solid Brown; -}
Cubic-bezier Bézier curve CSS3 Animation tool