使用HTML和CSS制作神奇的旋转加载动画

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    
    <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
    <link href="/css/旋转加载动画.css" rel="stylesheet">
    <title>Hello World!</title>
  </head>
  <body>
    <div class="loader">
			<div class="loader-item"></div>
			<div class="loader-item"></div>
			<div class="loader-item"></div>
			
			
		</div>
    
  </body>
</html>

*{
	margin: 0;
	padding: 0;
	box-sizing: border-box;

}
body{
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #151320;
	
}
.loader{
	width: 100px;
	height: 100px;
	border-radius: 50%;
	perspective: 800px;
}
.loader .loader-item{
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 50%;
}

.loader .loader-item:nth-child(1){
	border-bottom: 6px solid #f13a8f;
	transform: rotateX(35deg) rotateY(-45deg);
	animation: rotate-one 1s linear infinite;
}
.loader .loader-item:nth-child(2){
	border-right: 6px solid #4bc8eb;
	transform: rotateX(50deg) rotateY(10deg);
	animation: rotate-two 1s linear infinite;
}
.loader .loader-item:nth-child(3){
	border-top: 6px solid #36f372;
	transform: rotateX(35deg) rotateY(55deg);
	animation: rotate-three 1s linear infinite;
}

@keyframes rotate-one{
	to{
		transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
	}
}
@keyframes rotate-two{
	to{
		transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
	}
}
@keyframes rotate-three{
	to{
		transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
	}
}

Github: https://github.com/hosseinnabi-ir/Rotating-Loading-Animation-using-CSS

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值