CSS3永动机

标题CSS3 动画的永动

标题html部分

// An highlighted block
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/css.css">
    
</head>
<body>
    <div class="container">
       <div class="loader">
            <div class="ball">
                
            </div>
        </div>
    </div> 
    
</body>
</html>

标题css部分

// An highlighted block
*{
    margin: 0;
    padding: 0;
    /* box-sizing: border-box; */
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #1c2f3f;
}

.loader{
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 20px solid  transparent;
    border-bottom-color: #06c8f9;
    border-right-color: #06c8f9;
    transform: rotate(45deg);
    /* border: 1px solid #000; */
    /* 分别是 动画名称 时间 无限次数 中间快俩头慢 反向运动 */
    animation-name: move; 
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
    
}
.container{
    /* 镜像 */
    -webkit-box-reflect:below 5px
    -webkit-linear-gradient(transparent 10%,rgba(0,0,0,0.5));
    /* filter: blur(3px); 可以设置一个模糊度 */
}
.ball{
    position: absolute;
    /* border: 1px solid #000; */
    top:0;
    left: 0;
    width: 200px;
    height: 200px;
    animation-name: reveres;
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
}

.ball::before{
    /* 设置小球 */
    position: absolute;
    content: '';
    width: 30px;
    height: 30px;
    bottom: 20px;
    left: 26px;
    border-radius: 50%;
    background-color: white;
}
@keyframes move{
  0%{
      transform: rotate(0);
  }
  100%{
       transform: rotate(90deg);
  }
}
@keyframes reveres{
    0%{
        transform: rotate(0);
    }
    100%{
        transform: rotate(-180deg);
    }
}

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值