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>
相关推荐
yuanyxh5 小时前
Mac 软件推荐
前端·javascript·程序员
万少5 小时前
AtomCode开发微信小程序《谁去呀》 全流程
前端·javascript·后端
某人辛木5 小时前
Web自动化测试
前端·python·pycharm·pytest
Kagol6 小时前
Superpowers GSD gstack AgentSkills深度测评
前端·人工智能
excel7 小时前
JavaScript 字符串与模板字面量:从表象到本质理解
前端
京东云开发者7 小时前
当AI成为导演-如何用AI创作动漫短剧
前端
李白的天不白7 小时前
使用 SmartAdmin 进行前后端开发
java·前端
乘风gg8 小时前
🤡PUA AI Coding 工具 的 10 条终极语录
前端·ai编程·claude
学Linux的语莫8 小时前
Vue 3 入门教程
前端·javascript·vue.js
怕浪猫8 小时前
第一章、Chrome DevTools Protocol (CDP) 详解
前端·javascript·chrome