加载中特效

       我们在做一些网页时,加载某些页面的时间可能会很长。我们可以在加载的时候放一些提示信息,效果如图:

加载中

html代码:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>加载中</title>
	</head>
	<body>
		<div class="loader">
			<div class="spinner">
			</div>
			
			<div class="text">loading</div>
			
		</div>
	</body>
	
	<style>
		body{
			display: flex;
			justify-content: center;
			align-content: center;
			height: 100vh;
		}
		.loader{
			margin-top: 285px;
			user-select:none
		}
		.loader .spinner{
			position: relative;
			width: 160px;
			height: 160px;
		
		}
		.loader .spinner::before,
		.loader .spinner::after{
			content: "";
			position: absolute;
		}
		.spinner::before{
			width: 100%;
			height: 100%;
			background-color: #a08fd5;
			animation: spinner 2.5s cubic-bezier(0.75,0,0.5,1) infinite;
		}
		
		.loader .spinner::after{
			width: 100%;
			height: 4px;
			border-radius: 50%;
			background-color: #333;
			bottom: -40px;
			animation: shadow 2.5s cubic-bezier(0.75,0,0.5,1) infinite;
		}
		.loader .text{
			position: absolute;
			top: 50%;
			left:50%;
			transform: translate(-50%,-50%);
			color: #fff;
			font-size: 32px;
			text-transform: uppercase;
			font-weight: 100;
			animation: text 2.5s cubic-bezier(0.75,0,0.5,1) infinite;
		}
		@keyframes spinner{
			50%{
				border-radius: 50%;
				background-color: #f5e866;
				transform: rotate(360deg) scale(0.5);
			}
			100%{
				background-color: #A08FD5;
				transform: rotate(720deg);
			}
		}
		
		@keyframes shadow{
			50%{
				transform: scale(0.5);
			}
		}
		
		@keyframes text{
			0%,100%{
				transform: translate(-50%,-50%) scale(1,1);
			}
			50%{
				transform: translate(-50%,-50%) scale(0.5,0.5);
				color: #000;
			}
		}
		
	</style>
</html>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值