C3制作反向旋转及光效动画

本文分享了一个关于制作反向旋转及光效动画的HTML和CSS代码demo,通过关键帧动画实现元素的透明度变化和逆向旋转,展示了如何在网页中创建动态视觉效果。

写了一个demo关于制作反向旋转及光效动画,以此为总结:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html, body {
	height: 100%;
	overflow: hidden;
}

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video {
	margin: 0;
	padding: 0;
	border: none;
	outline: none;
}

html,body,form,fieldset,p,div,h1,h2,h3,h4,h5,h6 {
	-webkit-text-size-adjust: none
}
        .div-parse{
            width: 100%;
            height: 100%;
            position: relative;
        }
        .main{
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 736px;
            height: 583px;
            background: url('./bg.png') no-repeat;
            background-size: 100% 100%;
        }
        .guang{
            width: 498px;
            height: 314px;
            position: absolute;
            top: 203px;
            left: 106px;
            background: url('./g.png') no-repeat;
            background-size: 100% 100%;
            opacity: 1;
            animation: move1 1s linear infinite alternate;
        }
        @keyframes move1{
            from{
                opacity: 1;
            }
            to{
                opacity: 0.5;
            }
        }
        .bottom-yuan{
            width: 99px;
            height: 99px;
            position: absolute;
            top: 80px;
            left: 100px;
            background: url('./y2.png') no-repeat;
            background-size: 100% 100%;
            animation: move2 4s linear infinite;
        }
        @keyframes move2 {
            from{
                transform: rotate(360deg);
            }
            to{
                transform: rotate(0deg);
            }    
        }
        .top-yuan{
            width: 120px;
            height: 120px;
            position: absolute;
            top: 70px;
            left: 89px;
            background: url('./y.png') no-repeat;
            background-size: 100% 100%;
            animation: move3 3s linear infinite;
        }
        @keyframes move3 {
            form{
                transform: rotate(0deg);
            }
            to{
                transform: rotate(360deg);
            }
        }
    </style>
</head>
<body>
    <div class="div-parse">
        <div class="main">
            <div class="guang"></div>
            <div class="yuan">
                <div class="bottom-yuan"></div>
                <div class="top-yuan"></div>
            </div>
        </div>
    </div>
</body>
</html>

效果是这样的:

demo所需图片资源:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值