纯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>
相关推荐
子兮曰6 小时前
OpenClaw入门:从零开始搭建你的私有化AI助手
前端·架构·github
吴仰晖6 小时前
使用github copliot chat的源码学习之Chromium Compositor
前端
1024小神6 小时前
github发布pages的几种状态记录
前端
不像程序员的程序媛8 小时前
Nginx日志切分
服务器·前端·nginx
北原_春希8 小时前
如何在Vue3项目中引入并使用Echarts图表
前端·javascript·echarts
尽意啊8 小时前
echarts树图动态添加子节点
前端·javascript·echarts
吃面必吃蒜8 小时前
echarts 极坐标柱状图 如何定义柱子颜色
前端·javascript·echarts
O_oStayPositive8 小时前
Vue3使用ECharts
前端·javascript·echarts
竹秋…8 小时前
echarts自定义tooltip中的内容
前端·javascript·echarts
宝贝露.8 小时前
Axure引入Echarts图无法正常显示问题
前端·javascript·echarts