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>
相关推荐
hboot2 分钟前
别再被 TS 类型冲突折磨了!一文搞懂类型合并规则
前端·typescript
在西安放羊的牛油果6 分钟前
浅谈 import.meta.env 和 process.env 的区别
前端·vue.js·node.js
鹏北海10 分钟前
从弹窗变胖到 npm 依赖管理:一次完整的问题排查记录
前端·npm·node.js
布列瑟农的星空11 分钟前
js中的using声明
前端
薛定谔的猫211 分钟前
Cursor 系列(2):使用心得
前端·ai编程·cursor
用户9047066835712 分钟前
后端问前端:我的接口请求花了多少秒?为啥那么慢,是你慢还是我慢?
前端
深念Y12 分钟前
仿B站项目 前端 4 首页 顶层导航栏
前端·vue·ai编程·导航栏·bilibili·ai开发
dragonZhang18 分钟前
基于 Agent Skills 的 UI 重构实践:从 Demo 到主题化界面的升级之路
前端·ai编程·claude
王林不想说话23 分钟前
提升工作效率的Utils
前端·javascript·typescript
weixin_584121431 小时前
vue内i18n国际化移动端引入及使用
前端·javascript·vue.js