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>
相关推荐
环信21 小时前
2026年开发者选择即时通讯厂商应注意的几点
前端
卷帘依旧21 小时前
Generator 全面解析 + async/await 深度对比
前端·javascript
weixin_471383031 天前
统一缩放单位基础(px、em、rem)
开发语言·javascript·ecmascript
yqcoder1 天前
数据劫持的双雄:深入解析 Object.defineProperty 与 Proxy
开发语言·前端·javascript
lichenyang4531 天前
鸿蒙聊天 Demo 练习 03:接入 Next.js 后端接口,实现真机前后端联调
前端
小三金1 天前
EXPO+RN echarts图表库,以及如何使用
前端·javascript·react.js
ZFSS1 天前
Midjourney Shorten API 的集成与使用
java·前端·数据库·人工智能·ai·midjourney·ai编程
Pu_Nine_91 天前
IntersectionObserver 详解:封装 Vue 指令实现图片懒加载
前端·javascript·vue.js·性能优化
清灵xmf1 天前
Web 和 Native 是怎么“对话“的?JSBridge 解答
前端·webview·native·jsbridge·hybrid
jiayong231 天前
前端面试题库 - ES6+新特性篇
前端·面试·es6