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>
相关推荐
vvilkim3 小时前
深入理解 TypeScript 中的 implements 和 extends:区别与应用场景
前端·javascript·typescript
GISer_Jing3 小时前
前端算法实战:大小堆原理与应用详解(React中优先队列实现|求前K个最大数/高频元素)
前端·算法·react.js
写代码的小王吧5 小时前
【安全】Web渗透测试(全流程)_渗透测试学习流程图
linux·前端·网络·学习·安全·网络安全·ssh
小小小小宇5 小时前
CSS 渐变色
前端
snow@li6 小时前
前端:开源软件镜像站 / 清华大学开源软件镜像站 / 阿里云 / 网易 / 搜狐
前端·开源软件镜像站
小小小小宇6 小时前
配置 Gemini Code Assist 插件
前端
one 大白(●—●)6 小时前
前端用用jsonp的方式解决跨域问题
前端·jsonp跨域
刺客-Andy6 小时前
前端加密方式 AES对称加密 RSA非对称加密 以及 MD5哈希算法详解
前端·javascript·算法·哈希算法
记得早睡~7 小时前
leetcode122-买卖股票的最佳时机II
javascript·数据结构·算法·leetcode
前端开发张小七7 小时前
13.Python Socket服务端开发指南
前端·python