css3-贝塞尔曲线-完成小球的曲线运动

本文介绍了如何利用CSS3的贝塞尔曲线实现小球沿曲线平滑运动,通过设置特定的cubic-bezier值来控制弧度和运动轨迹。读者可以通过提供的代码示例和效果展示理解这一技术。
摘要由CSDN通过智能技术生成

完成曲线运动使用贝塞尔曲线,可以去:贝塞尔曲线设置曲线的弧度
复制参数过来替换 cubic-bezier(.15,.76,.25,.86);

代码如下所示:

 <!DOCTYPE html>
    <html lang="zh-cn">
    <head>
      <meta charset="UTF-8">
      <title>Document</title>
      <style>
    .ball{
      height: 60px;
      width: 60px;
      border-radius: 50%;
      position: absolute;
      bottom: 10px;
      z-index: 10;
      left: 10px;
      background: red;
    }
    
    .run_top_right {
      display: block;
      animation: 
    	run-right-right 3s 0.4s infinite linear,
      	run-right-top 3s 0.4s infinite cubic-bezier(.15,.76,.25,.86);
      animation-fill-mode: forwards;
    }
    @keyframes run-right-top {
      0% {
        bottom: 10px; 
    	
      }
      100% {
        bottom:400px;
      }
    }
    @keyframes run-right-right {
      0% {
         left
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值