SpeechRecognition实现浏览器端语音识别成文字搜索框输入效果代码

代码语言:html

所属分类:搜索

代码描述:SpeechRecognition实现浏览器端语音识别成文字搜索框输入效果代码

代码标签: SpeechRecognition 浏览器 语音 识别 文字 搜索框 输入

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.0.css">

<link href="https://fonts.googleapis.com/css2?family=Lato&family=Roboto&display=swap" rel="stylesheet" />
  
  
  
<style>
body {
  align-items: center;
  background-color: #eee;
  display: flex;
  height: 100vh;
  justify-content: center;
  margin: 0;
}

.a11y-hidden {
  position: absolute;
  left: -1000in;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: polygon(0 0, 0 0);
}

.search {
  width: 90%;
  max-width: 30rem;
  position: relative;
}
.search .input-bar {
  --active: #eee;
  align-items: center;
  background: #fff;
  border: 2px solid #0000;
  border-radius: 4rem;
  box-sizing: border-box;
  box-shadow: 0 1rem 2rem -1.5rem #0005;
  display: inline-flex;
  height: 4rem;
  overflow: hidden;
  transition: box-shadow 0.5s;
  width: 100%;
}
.search .input-bar:focus-within {
  background: #fffffc;
  border: 2px solid #444;
  box-shadow: 0 1rem 2rem -1.5rem #0007;
}
.search .input-bar:hover {
  box-shadow: 0 1rem 2rem -1.5rem #0007;
}
..........完整代码请登录后点击上方下载按钮下载查看

网友评论0