css 实现呼吸灯效果

先看效果:


动画的结果就想实在呼吸,完整的代码如下:

html 复制代码
<template>
  <div class="container">
    <div class="long-breath"></div>
  </div>
</template>

<style  lang="less">
html, body{
  height: 100%;
  background-color: white;
}
.container{
  position: relative;
  width: 100%;
  height: 80px;
  .long-breath {
    position: absolute;
    width: 100px;
    left: 0;
    bottom: 0;
    animation: 2s shadowBreath ease-out infinite normal;
    background: #ffffff;
  }
}
@keyframes shadowBreath {
  0%,
  100% {
    box-shadow: 0 0 4px 1px rgba(42, 170, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 20px 5px rgb(42, 170, 255);
  }
}
</style>
相关推荐
计算机魔术师1 小时前
Dwarkesh Patel 对 OpenAI/Hugging Face 事件的爆款解读被指危险误导
前端
自进化Agent智能体2 小时前
Hermes GitHub PR 审查 —— 自动化代码评审
前端
涛涛ing4 小时前
OpenAI Astra 泄露:零样本生成 3D 网页,前端开发者慌了吗?
前端
ssshooter4 小时前
现在网页都能提供 MCP 了?!
前端·人工智能·程序员
杉氧4 小时前
状态管理变迁史:为什么我们放弃了 Redux 选择 Zustand?
android·前端·react native
cidy_984 小时前
OpenCode 手动配置火山方舟 Agent Plan 教程
前端
鹏多多5 小时前
PC 网站接入微信登录,这 10 个坑我替你踩完了!
前端·javascript·vue.js
律宏阔5 小时前
微信小程序使用 Orval + OpenAPI 自动生成接口:Axios 兼容踩坑记录
前端·微信小程序
律宏阔5 小时前
微信小程序集成 TDesign 完整记录:解决 NPM packages not found
前端·微信小程序
律宏阔5 小时前
微信小程序 ECharts 瘦身实战:分包异步化 + componentPlaceholder 避开主包 2MB 限制
前端·微信小程序