From 9517aab1f83f78e4d39ca83154e68d85454664a2 Mon Sep 17 00:00:00 2001 From: xjq7 Date: Fri, 10 Jan 2025 15:22:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=9F=B3=E4=B9=90=E5=BE=8B=E5=8A=A8):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=B3=A2=E5=BD=A2=E5=8A=A8=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/marching-music/marching-music.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/pages/marching-music/marching-music.ts b/src/pages/marching-music/marching-music.ts index 0726cdb..9d3f26f 100644 --- a/src/pages/marching-music/marching-music.ts +++ b/src/pages/marching-music/marching-music.ts @@ -292,13 +292,13 @@ export class MarchingMusic { let intensity = 0; for (let i = 0; i < dataArray.length; i++) { - if (dataArray[i] > 200 || dataArray[i] < 50) { + if (dataArray[i] > 220 || dataArray[i] < 30) { intensity = 3; break; - } else if (dataArray[i] > 175 || dataArray[i] < 75) { + } else if (dataArray[i] > 190 || dataArray[i] < 60) { intensity = 2; break; - } else if (dataArray[i] > 150 || dataArray[i] < 50) { + } else if (dataArray[i] > 160 || dataArray[i] < 80) { intensity = 1; break; } @@ -317,7 +317,16 @@ export class MarchingMusic { keyboard.shadow = undefined; }); } else if (intensity === 2) { - this.waveData[0].concat(this.waveData[1]).forEach((keyboard) => { + this.waveData[0].forEach((keyboard) => { + keyboard.shadow = { + x: 0, + y: 0, + blur: 12, + color: this.color, + }; + }); + + this.waveData[1].forEach((keyboard) => { keyboard.shadow = { x: 0, y: 0, @@ -347,6 +356,10 @@ export class MarchingMusic { }); i++; } + } else { + this.waveData[0].forEach((keyboard) => { + keyboard.shadow = undefined; + }); } this.center.shadow = {