小y的放松时刻-0002:流星效果

小y的放松时刻-0002:流星效果

内容简介

这是小y学习css、js的记录和分享。
绝大部分内容将会是非原创,侵删。

原链接

https://www.jianshu.com/p/65f21a47818f

效果展示

在这里插入图片描述

代码

<body>
    <div class="loader">
        <div class="face">
            <div class="circle"></div>
        </div>
        <div class="face">
            <div class="circle"></div>
        </div>
    </div>
</body>
body{
    margin:0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: grey;
}
.loader{
    width: 20em;
    height: 20em;
    font-size: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader .face{
    position: absolute;
    border-radius: 50%;
    border-style: solid;
    animation: animate 3s linear infinite;
}
.loader .face:nth-child(1){
    width: 100%;
    height: 100%;
    color:black;
    border-color: currentColor transparent transparent currentColor;
    border-width: 0.2em 0.2em 0em 0em;
    --deg: -45deg;
    animation-direction: normal;
}
.loader .face:nth-child(2){
    width: 70%;
    height: 70%;
    color:white;
    border-color: currentColor currentColor transparent transparent ;
    border-width: 0.2em 0em 0em 0.2em;
    --deg: -135deg;
    animation-direction: reverse;
}
.loader .face .circle{
    position: absolute;
    width: 50%;
    height: 0.1em;
    top: 50%;
    left: 50%;
    background-color: transparent;
    transform: rotate(var(--deg));
    transform-origin: left;
}
.loader .face .circle::before{
    position: absolute;
    top: -0.5em;
    right: -0.5em;
    content: '';
    width: 1em;
    height: 1em;
    background-color: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 2em,
                0 0 4em,
                0 0 6em,
                0 0 8em,
                0 0 10em,
                0 0 0 0.5em rgba(255, 255, 0, 0.1);
}
@keyframes animate {
    to{
        transform: rotate(1turn);
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值