个性博客增加loading缓载

增加loading

页面加载时显示loading缓载,需要先选择一个自己喜欢的loading样式

我的这里随便选了一个css写的loading,预览效果参照博主的loading

点击查看代码
<div class="circle-loader-bg"></div>
<div class="circle-loader">
    <div class="circle-line">
        <div class="circle circle-blue"></div>
        <div class="circle circle-blue"></div>
        <div class="circle circle-blue"></div>
    </div>
    <div class="circle-line">
        <div class="circle circle-yellow"></div>
        <div class="circle circle-yellow"></div>
        <div class="circle circle-yellow"></div>
    </div>
    <div class="circle-line">
        <div class="circle circle-red"></div>
        <div class="circle circle-red"></div>
        <div class="circle circle-red"></div>
    </div>
    <div class="circle-line">
        <div class="circle circle-green"></div>
        <div class="circle circle-green"></div>
        <div class="circle circle-green"></div>
    </div>
</div>

<style>
/*loading*/
@-webkit-keyframes rotate-animation {
	0% {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}

	100% {
		-webkit-transform: rotate(360deg);
		transform: rotate(360deg);
	}
}

@keyframes rotate-animation {
	0% {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}

	100% {
		-webkit-transform: rotate(360deg);
		transform: rotate(360deg);
	}
}

@-webkit-keyframes move-animation {
	0% {
		-webkit-transform: translate(0, 0);
		transform: translate(0, 0);
	}

	25% {
		-webkit-transform: translate(-64px, 0);
		transform: translate(-64px, 0);
	}

	75% {
		-webkit-transform: translate(32px, 0);
		transform: translate(32px, 0);
	}

	100% {
		-webkit-transform: translate(0, 0);
		transform: translate(0, 0);
	}
}

@-webkit-keyframes move-animation {
	0% {
		-webkit-transform: translate(0,0);
		transform: translate(0,0);
	}
}

@keyframes move-animation {
	0% {
		-webkit-transform: translate(0, 0);
		transform: translate(0, 0);
	}

	25% {
		-webkit-transform: translate(-64px, 0);
		transform: translate(-64px, 0);
	}

	75% {
		-webkit-transform: translate(32px, 0);
		transform: translate(32px, 0);
	}

	100% {
		-webkit-transform: translate(0, 0);
		transform: translate(0, 0);
	}
}

.circle-loader-bg {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 9999;
	background: #F5F5F5;
}

.circle-loader {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 10009;
	display: block;
	margin-top: -16px;
	margin-left: -16px;
	width: 64px;
	height: 64px;
	-webkit-transform-origin: 16px 16px;
	transform-origin: 16px 16px;
	-webkit-animation: rotate-animation 5s infinite;
	animation: rotate-animation 5s infinite;
	-webkit-animation-timing-function: linear;
	animation-timing-function: linear;
}

.circle-loader .circle {
	position: absolute;
	top: 50%;
	left: 50%;
	-webkit-animation: move-animation 2.5s infinite;
	animation: move-animation 2.5s infinite;
	-webkit-animation-timing-function: linear;
	animation-timing-function: linear;
}

.circle-loader .circle-line {
	position: absolute;
	top: 4px;
	left: 0;
	width: 64px;
	height: 24px;
	-webkit-transform-origin: 4px 4px;
	transform-origin: 4px 4px;
}

.circle-loader .circle-line:nth-child(0) {
	-webkit-transform: rotate(0deg);
	transform: rotate(0deg);
}

.circle-loader .circle-line:nth-child(1) {
	-webkit-transform: rotate(90deg);
	transform: rotate(90deg);
}

.circle-loader .circle-line:nth-child(2) {
	-webkit-transform: rotate(180deg);
	transform: rotate(180deg);
}

.circle-loader .circle-line:nth-child(3) {
	-webkit-transform: rotate(270deg);
	transform: rotate(270deg);
}

.circle-loader .circle-line .circle:nth-child(1) {
	top: 50%;
	left: 50%;
	margin-top: -4px;
	margin-left: -4px;
	width: 8px;
	height: 8px;
	border-radius: 4px;
	-webkit-animation-delay: -0.3s;
	animation-delay: -0.3s;
}

.circle-loader .circle-line .circle:nth-child(2) {
	top: 50%;
	left: 50%;
	margin-top: -8px;
	margin-left: -8px;
	width: 16px;
	height: 16px;
	border-radius: 8px;
	-webkit-animation-delay: -0.6s;
	animation-delay: -0.6s;
}

.circle-loader .circle-line .circle:nth-child(3) {
	top: 50%;
	left: 50%;
	margin-top: -12px;
	margin-left: -12px;
	width: 24px;
	height: 24px;
	border-radius: 12px;
	-webkit-animation-delay: -0.9s;
	animation-delay: -0.9s;
}

.circle-loader .circle-blue {
	background-color: #1f4e5a;
}

.circle-loader .circle-red {
	background-color: #ff5955;
}

.circle-loader .circle-yellow {
	background-color: #ffb265;
}

.circle-loader .circle-green {
	background-color: #00a691;
}

</style>
<!--loading-->
<script language="javascript" type="text/javascript"> 
    document.onreadystatechange=function()
    { 
        if(document.readyState=="complete")
        { 
            $('.circle-loader-bg').hide();
            $('.circle-loader').hide();
        } 
    }
</script>
posted @   蓦然JL  阅读(71)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
  1. 1 唯一 G.E.M.邓紫棋
  2. 2 他只是经过 白敬亭 魏大勋
  3. 3 Uptown Funk Mark Ronson / Bruno Mars
  4. 4 在你的身边 盛哲
  5. 5 Edge of My Life Manafest
  6. 6 凄美地 郭顶
  7. 7 Wonderful Tonight Boyce Avenue
  8. 8 心如止水 Ice Paper
  9. 9 Sugar Maroon 5
  10. 10 静谧时光 JIAxNING
  11. 11 Right Now (Na Na Na) Aamir
  12. 12 Dangerously Charlie Puth
  13. 13 Someone You Loved Madilyn Paige
  14. 14 Shape of My Heart Boyce Avenue
  15. 15 We Can't Stop Boyce Avenue / Bea Miller
  16. 16 Perfect Boyce Avenue
  17. 17 Love Me Like You Do Boyce Avenue
  18. 18 Thank You Boyce Avenue
  19. 19 Don’t Wanna Know Boyce Avenue / Sarah Hyland
他只是经过 - 白敬亭 魏大勋
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.

Not available

访问主页
关注我
关注微博
私信我
返回顶部
点击右上角即可分享
微信分享提示

目录导航