声音波浪 js+css

html 复制代码
<span class="voice-wave">
  <span class="voice-line"></span>
  <span class="voice-line"></span>
  <span class="voice-line"></span>
  <span class="voice-line"></span>
  <span class="voice-line"></span>
</span>
css 复制代码
// 语音输入波浪动画
.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;

  .voice-line {
    display: inline-block;
    width: 2px;
    height: 12px;
    background-color: #3366FF;
    margin: 0 1px;
    border-radius: 2px;
    animation: voice-pulse 1.2s infinite ease-in-out;
  }

  // 为每个线条设置不同的动画延迟,形成波浪效果
  .voice-line:nth-child(1) {
    animation-delay: 0s;
  }

  .voice-line:nth-child(2) {
    animation-delay: 0.2s;
  }

  .voice-line:nth-child(3) {
    animation-delay: 0.4s;
  }

  .voice-line:nth-child(4) {
    animation-delay: 0.6s;
  }

  .voice-line:nth-child(5) {
    animation-delay: 0.8s;
  }
}

// 语音波浪动画定义
@keyframes voice-pulse {

  0%,
  100% {
    height: 4px;
    opacity: 0.3;
  }

  50% {
    height: 16px;
    opacity: 1;
  }
}
相关推荐
GGGG寄了12 分钟前
HTML——表单标签
前端·html
PieroPc26 分钟前
用FastAPI 和Html+css+js 写的 发票PDF文件管理系统
css·html·fastapi
一个帅气昵称啊26 分钟前
AI搜索增强C#实现多平台联网搜索并且将HTML内容转换为结构化的Markdown格式并整合内容输出结果
人工智能·c#·html
假装我不帅37 分钟前
传统html方式开发spreadjs
前端·html·spreadjs
荔枝一杯酸牛奶12 小时前
HTML 表单与表格布局实战:两个经典作业案例详解
前端·html
米奇妙妙wuu13 小时前
css实现文字和边框同样的渐变色效果
css·html·css3
EEEzhenliang17 小时前
CSS样式所有使用方式(书写位置)
前端·css
十六年开源服务商1 天前
WordPress在线聊天系统推荐
大数据·javascript·html
jzlhll1231 天前
android经常用到的一个小工具颜色计算器
html
Yan.love1 天前
【CSS-核心属性】“高频词”速查清单
前端·css