js+css实现颜色声音识别代码

代码语言:html

所属分类:其他

代码描述:js+css实现颜色声音识别代码,主要通过SpeechRecognition

代码标签: js css 颜色 声音 识别 代码

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

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

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


  <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
  
  
  
<style>
/* import font(s) */
@import url("https://fonts.googleapis.com/css?family=Open+Sans");

/* root variables */
:root {
  --font: "Open Sans", sans-serif;
  /* colors for the app */
  --color-main: #f3eee6;
  --color-text: #010711;
  --color-bg: #031634;
  --color-highlight: #398a8711;
  /* colors for the parrot */
  --color-head: #398a87;
  --color-beak: #ffd046;
  --color-beak-d: #d1a82b;
  /* color accent for the paragraph elements, modified according to a color potentially registered in the application */
  --color-accent: #e03e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 100%;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
}
/* ditance the main container notably from the top of the window, to give space to the parror + speech bubble */
main {
  max-width: 400px;
  width: 90vw;
  margin: 4rem auto;
  /* set a fixed height */
  height: 80vh;
  background: var(--color-main);
  box-shadow: 0 1px 10px -1px var(--color-text);
  /* position relative to absolute position the parrot in relation to this container */
  position: relative;
}

/* stretch the container nesting the text (and eventually the speech retrieved from the web speech api) to cover the entirety of the parent width and height */
.app__speech {
  width: 100%;
  height: 100%;
  padding: 1rem;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0