css之loading旋转加载

1.效果

2.代码

java 复制代码
	<!-- 检测动画 -->
					<view class="sk-chase">
						<view class="sk-chase-dot"></view>
						<view class="sk-chase-dot"></view>
						<view class="sk-chase-dot"></view>
						<view class="sk-chase-dot"></view>
						<view class="sk-chase-dot"></view>
						<view class="sk-chase-dot"></view>
					</view>





<style>
	// 检测等待动画
	.sk-chase {
		width: 40px;
		height: 40px;
		position: relative;
		animation: sk-chase 2.5s infinite linear both;
	}

	.sk-chase-dot {
		width: 100%;
		height: 100%;
		position: absolute;
		left: 0;
		top: 0;
		animation: sk-chase-dot 2.0s infinite ease-in-out both;
	}

	.sk-chase-dot:before {
		content: '';
		display: block;
		width: 25%;
		height: 25%;
		background-color: #1677FF;
		border-radius: 100%;
		animation: sk-chase-dot-before 2.0s infinite ease-in-out both;
	}

	.sk-chase-dot:nth-child(1) {
		animation-delay: -1.1s;
	}

	.sk-chase-dot:nth-child(2) {
		animation-delay: -1.0s;
	}

	.sk-chase-dot:nth-child(3) {
		animation-delay: -0.9s;
	}

	.sk-chase-dot:nth-child(4) {
		animation-delay: -0.8s;
	}

	.sk-chase-dot:nth-child(5) {
		animation-delay: -0.7s;
	}

	.sk-chase-dot:nth-child(6) {
		animation-delay: -0.6s;
	}

	.sk-chase-dot:nth-child(1):before {
		animation-delay: -1.1s;
	}

	.sk-chase-dot:nth-child(2):before {
		animation-delay: -1.0s;
	}

	.sk-chase-dot:nth-child(3):before {
		animation-delay: -0.9s;
	}

	.sk-chase-dot:nth-child(4):before {
		animation-delay: -0.8s;
	}

	.sk-chase-dot:nth-child(5):before {
		animation-delay: -0.7s;
	}

	.sk-chase-dot:nth-child(6):before {
		animation-delay: -0.6s;
	}

	@keyframes sk-chase {
		100% {
			transform: rotate(360deg);
		}
	}

	@keyframes sk-chase-dot {

		80%,
		100% {
			transform: rotate(360deg);
		}
	}

	@keyframes sk-chase-dot-before {
		50% {
			transform: scale(0.4);
		}

		100%,
		0% {
			transform: scale(1.0);
		}
	}
</style>
相关推荐
数字元匠_山步4 小时前
一篇笔记彻底搞懂 “脚手架” “框架” “构建工具” 的关系
前端
李剑一5 小时前
前端实现时间轴组件拼接N多个不连续监控视频展示
前端·vue.js
岁月向前5 小时前
iOS UI基础和内存管理相关
前端
Magicman5 小时前
JS筑基(二)-关于this指向
前端
Asort5 小时前
精通React JSX:高级开发者必备的语法规则与逻辑处理技巧
前端·javascript·react.js
Mintopia5 小时前
想摸鱼背单词?我用 Cursor 一个小时开发了一个 Electron 应用
前端·javascript·cursor
JarvanMo5 小时前
Flutter PruneKit - 从你的Flutter代码中干掉那些已经死掉的代码
前端
500佰5 小时前
最近做产品开发,总结出一些通病
前端
serve the people5 小时前
Formatting Outputs for ChatPrompt Templates(two)
前端·数据库
小皮虾5 小时前
魔法降临!让小程序调用云函数如丝般顺滑,调用接口仿佛就是调用存在于本地的函数
前端·微信小程序·小程序·云开发