js实现带声音频谱显示错误动画效果代码

代码语言:html

所属分类:动画

代码描述:js实现带声音频谱显示错误动画效果代码

代码标签: js 声音 频谱 显示 错误 动画

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

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

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

  
  
  
  
<style>
:root {
	--bg-color: #090909;
	--text-color: #e0e0e0;
	--tile-bg: #121212;
	--accent-color: #ff6347;
	--button-bg: linear-gradient(45deg, #ff0844, #f36);
	--error-bg: hsla(0, 0%, 100%, 0.05);
	--visualizer-bg: hsla(0, 0%, 100%, 0.08);
}

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

body {
	align-items: center;
	background: var(--bg-color);
	color: var(--text-color);
	display: flex;
	flex-direction: column;
	font-family: "Consolas", "Courier New", monospace;
	height: 100vh;
	justify-content: center;
	overflow: hidden;
	width: 100%;
}

.container {
	max-width: 48.75rem;
	padding: 0.5rem;
	text-align: center;
	width: 90%;
}

.visualizer {
	align-items: flex-end;
	background-color: hsla(0, 0%, 100%, 0.1);
	display: flex;
	height: 6.25rem;
	justify-content: space-between;
	margin-bottom: 0.8rem;
	overflow: hidden;
	width: 100%;
}

.wave-bar {
	background: linear-gradient(0deg, #f0f, hsla(0, 0%, 100%, 0.3));
	flex: 1;
	margin: 0 0.0625rem;
	transition: height 0.1s ease-out;
}

.error-display {
	animation: fadeIn 0.3s ease-in-out;
	background: var(--error-bg);
	border-left: 0.1875rem solid var(--accent-color);
	border-radius: 0.375rem;
	padding: 0.75rem;
	text-align: left;
}

.error-display,
button {
	font-size: 0.9rem;
	margin-bottom: 0.8rem;
}

button {
	background: var(--button-bg);
	border: none;
	border-radius: 0.375rem;
	color: #fff;
	cursor: pointer;
	letter-spacing: 0.025em;
	padding: 0.6rem 1.4rem;
}

[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

.note-grid {
	align-items: center;
	background-color: hsla(0, 0%, 100%, 0.1);
	display: flex;
	flex-wrap: nowrap;
	justify-content: space-between;
	margin-bottom: 1.6rem;
	padding: 0;
	width: 100%;
}

.note-tile {.........完整代码请登录后点击上方下载按钮下载查看

网友评论0