This commit is contained in:
zyqunix 2025-06-12 11:25:00 +02:00
parent eb2229631a
commit b5d4387c95
3 changed files with 9 additions and 10 deletions

View file

@ -9,7 +9,7 @@
</head>
<body>
<h1>Microphone Test</h1>
<div class="shadow card">
<div class="shadow cards">
<canvas id="visualizer"></canvas>
<button id="btn">Start Listening</button>
</div>

View file

@ -35,11 +35,11 @@ function draw() {
analyser.getByteTimeDomainData(dataArray);
ctx.fillStyle = '#fff';
ctx.fillStyle = '#313244';
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.lineWidth = 2;
ctx.strokeStyle = '#000';
ctx.strokeStyle = '#fff';
ctx.beginPath();
const sliceWidth = canvas.width / dataArray.length;

View file

@ -2,24 +2,23 @@
canvas {
width: 100%;
background-color: #fff;
background-color: var(--surface0);
border-radius: 10px;
pointer-events: none;
}
button {
cursor: pointer;
background-color: #2a2a2a;
background-color: var(--surface0);
padding: 7px;
color: #c0c0c0;
border: #2c2c2c solid 2px;
color: var(--text);
border: var(--surface2) solid 2px;
border-radius: 4px;
margin-top: 10px;
font-size: 16px;
}
button:hover {
background-color: #2c2c2c;
color: #d0d0d0;
border: #2e2e2e solid 2px;
background-color: var(--surface1);
border: var(--surface2) solid 2px;
}