怎么用CSS3制作环形星星发光动画

这篇文章主要介绍“怎么用CSS3制作环形星星发光动画”,在日常操作中,相信很多人在怎么用CSS3制作环形星星发光动画问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么用CSS3制作环形星星发光动画”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

10余年的武安网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。营销型网站的优势是能够根据用户设备显示端的尺寸不同,自动调整武安建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联公司从事“武安网站设计”,“武安网站推广”以来,每个客户项目都认真落实执行。

怎么用CSS3制作环形星星发光动画

html源码:

    
    
    
    

css源码:

   
        *{margin:0;padding:0;}
        html,body{
            height:100%;
        }
        body{
            background:radial-gradient(ellipse at center,#34679a 0%, #214163 50%, #0d1926 100%);/*径向渐变   椭圆*/
        }
        body > div{
            width:200px;/*宽度 px像素  cm*/
            height:200px;/*高度*/
            border:1px #fff solid;/*边框 宽度 风格 颜色*/
            border-radius:50%;/*圆角*/
            position:absolute;
            top:15%;
            left:50%;
            margin-left:-101px;
            transform:rotateX(80deg) rotateY(20deg);
            transform-style:preserve-3d;
        }
        body > div:nth-of-type(2){
            transform:rotateX(-80deg) rotateY(20deg);
        }
        body > div:nth-of-type(3){
            transform:rotateX(-70deg) rotateY(60deg);
        }
        body > div:nth-of-type(4){
            transform:rotateX(70deg) rotateY(60deg);
        }
        body > div:first-of-type:after{
            width:40px;
            height:40px;
            content:"";
            background:#fff;
            position:absolute;
            top:50%;
            left:50%;
            margin-top:-20px;
            margin-left:-20px;
            transform:rotateX(80deg);
            border-radius:50%;
            animation:nucleus 2s infinite linear;
        }
        body > div > div{
            width:200px;
            height:200px;
            position:relative;
            transform-style:preserve-3d;
            animation:trail 1s infinite linear; /*自定义动画  动画名称 时间 播放次数 速度*/
        }
        body > div > div:after{
            content:"";
            width:5px;
            height:5px;
            background:#fff;
            position:absolute;
            top:-5px;
            left:50%;
            margin-left:-5px;
            border-radius:50%;
            box-shadow:0 0 12px #fff;/*阴影 x y 模糊度 颜色*/
            animation:particle 1s infinite linear;
        }
        /*自定义动画执行*/
        @keyframes trail{
            from{
                transform:rotateZ(0deg);
            }
            to{
                transform:rotateZ(360deg);
            }
        }
        @keyframes particle{
            from{
                transform:rotateX(90deg) rotateY(0deg);
            }
            to{
                transform:rotateX(90deg) rotateY(-360deg);
            }
        }
        @keyframes nucleus{
            0%{
                box-shadow:0 0 0 transparent;
            }
            50%{
                box-shadow:0 0 25px #fff;
            }
            100%{
                box-shadow:0 0 0 transparent;
            }
        }
        body > div:nth-of-type(2) > div,
        body > div:nth-of-type(2) > div:after{
            animation-delay:-0.5s;
        }
        body > div:nth-of-type(3) > div,
        body > div:nth-of-type(3) > div:after{
            animation-delay:-1s;
        }
        body > div:nth-of-type(4) > div,
        body > div:nth-of-type(4) > div:after{
            animation-delay:-1.5s;
        }

   

到此,关于“怎么用CSS3制作环形星星发光动画”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


网站标题:怎么用CSS3制作环形星星发光动画
网站URL:http://scyanting.com/article/pophih.html