mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 01:03:51 +08:00
update:优化测试页面音波样式
This commit is contained in:
@@ -245,6 +245,7 @@ button:disabled {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@keyframes pulse-speaking {
|
@keyframes pulse-speaking {
|
||||||
|
|
||||||
0%,
|
0%,
|
||||||
100% {
|
100% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@@ -357,6 +358,7 @@ span.connection-status.llm-emoji {
|
|||||||
height: 60px;
|
height: 60px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
margin-bottom: 15px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
@@ -993,4 +995,4 @@ span.connection-status.llm-emoji {
|
|||||||
.mcp-tool-description {
|
.mcp-tool-description {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,12 @@ export class UIController {
|
|||||||
for (let i = 0; i < dataArray.length; i++) {
|
for (let i = 0; i < dataArray.length; i++) {
|
||||||
barHeight = dataArray[i] / 2;
|
barHeight = dataArray[i] / 2;
|
||||||
|
|
||||||
this.visualizerContext.fillStyle = `rgb(${barHeight + 100}, 50, 50)`;
|
// 创建渐变色:从紫色到蓝色到青色
|
||||||
|
const hue = 200 + (barHeight / this.visualizerCanvas.height) * 60; // 200-260度,从青色到紫色
|
||||||
|
const saturation = 80 + (barHeight / this.visualizerCanvas.height) * 20; // 饱和度 80-100%
|
||||||
|
const lightness = 45 + (barHeight / this.visualizerCanvas.height) * 15; // 亮度 45-60%
|
||||||
|
|
||||||
|
this.visualizerContext.fillStyle = `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
||||||
this.visualizerContext.fillRect(x, this.visualizerCanvas.height - barHeight, barWidth, barHeight);
|
this.visualizerContext.fillRect(x, this.visualizerCanvas.height - barHeight, barWidth, barHeight);
|
||||||
|
|
||||||
x += barWidth + 1;
|
x += barWidth + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user