三次贝塞尔(Cubic Bezier)函数 <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>S弧线运动</title> <style> .box{ width: 400px; height: 400px; border: 2px solid #eee; } span{ display: block; width: 40px; height: 40px; border: 1px solid #333; animation: center1 1s cubic-bezier(.66,.01,1,1) forwards; } span:after{ content: ''; display: block; width: 40px; height: 40px; background: #333; animation: center2 1s cubic-bezier(.14,.84,.87,.25) forwards; } @keyframes center1 { to{transform: translateX(360px)} } @keyframes center2 { to{transform: translateY(360px)} } </style> </head> <body> <div class="box"> <span></span> </div> </body> </html>
三次贝塞尔(Cubic Bezier)函数