纯css 实现呼吸灯效果

开始效果

呼吸效果

实现代码

html 复制代码
<div class="container">
	<div class="breathing-light"></div>
</div>

<style>
	html,
	body {
		height: 100%;
		background-color: white;
	}
	.container {
		padding: 100px;
	}
	.container .breathing-light {
		width: 20px;
		height: 20px;
		border-radius: 100%;
		animation: 2s shadowBreath ease-out infinite normal;
		background: rgba(42, 170, 255, 1);
	}
	@keyframes shadowBreath {
		0%,
		100% {
			transform: scale(0.9);
			box-shadow: 0 0 4px 1px rgba(42, 170, 255, 0.7);
		}
		50% {
			transform: scale(1.5);
			box-shadow: 0 0 30px 5px rgb(42, 170, 255);
		}
	}
</style>
相关推荐
前端不太难2 分钟前
Navigation State 与页面内存泄漏的隐性关系
前端·ui·react
C+++Python7 分钟前
如何选择合适的锁机制来提高 Java 程序的性能?
java·前端·python
IT_陈寒14 分钟前
JavaScript 性能优化:7 个 V8 引擎偏爱的编码模式让你提速 40%
前端·人工智能·后端
小oo呆25 分钟前
【自然语言处理与大模型】LangChainV1.0入门指南:核心组件Messages
前端·javascript·easyui
果壳~1 小时前
【前端】【canvas】图片颜色填充工具实现详解
前端
Bigger1 小时前
Tauri (23)——为什么每台电脑位置显示效果不一致?
前端·rust·app
¥懒大王¥1 小时前
XSS-Game靶场教程
前端·安全·web安全·xss
ssshooter1 小时前
为什么移动端 safari 用 translate 移动元素卡卡的
前端·css·性能优化
闲云一鹤1 小时前
Claude Code 接入第三方AI模型(MiMo-V2-Flash)
前端·后端·claude
惜.己1 小时前
前端笔记(四)
前端·笔记