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>
相关推荐
一条上岸小咸鱼36 分钟前
Kotlin 基本数据类型(一):Numbers
android·前端·kotlin
前端小巷子1 小时前
Vue 事件绑定机制
前端·vue.js·面试
uhakadotcom1 小时前
开源:subdomainpy快速高效的 Python 子域名检测工具
前端·后端·面试
爱加班的猫1 小时前
Node.js 中 require 函数的原理深度解析
前端·node.js
用户8165111263971 小时前
WWDC 2025 Build a SwiftUI app with the new design
前端
伍哥的传说1 小时前
Vue 3.5重磅更新:响应式Props解构,让组件开发更简洁高效
前端·javascript·vue.js·defineprops·vue 3.5·响应式props解构·vue.js新特性
阅文作家助手开发团队_山神1 小时前
第一章: Mac Flutter Engine开发准备工作
前端·flutter
菜牙买菜1 小时前
Hicharts入门
前端·vue.js·数据可视化
摸着石头过河的石头2 小时前
手把手教你入门 MCP:模型上下文协议与 Trae IDE 中的实践
前端·mcp