ui/scene: simplify select animation

This commit is contained in:
Johannes Kirschbauer
2025-07-13 20:44:12 +02:00
parent d87a771a78
commit 8627398e3e

View File

@@ -402,24 +402,16 @@ export function CubeScene() {
if (selected) { if (selected) {
// When selected, make all faces red-ish but maintain the lighting difference // When selected, make all faces red-ish but maintain the lighting difference
materials.forEach((material, index) => { materials.forEach((material, index) => {
(material as THREE.MeshBasicMaterial).color.set( if (index === 2) {
index === 2 (material as THREE.MeshBasicMaterial).color.set(0xff6666);
? 0xff6666 // Top face - lighter red }
: index === 0 || index === 4
? 0xdce4e5 // Front/right faces - keep
: 0xa4b3b5, // Shadow faces - keep
);
}); });
} else { } else {
// Normal colors - restore original face colors // Normal colors - restore original face colors
materials.forEach((material, index) => { materials.forEach((material, index) => {
(material as THREE.MeshBasicMaterial).color.set( if (index === 2) {
index === 2 (material as THREE.MeshBasicMaterial).color.set(0xffffff);
? 0xffffff // Top face - light }
: index === 0 || index === 4
? 0xdce4e5 // Front/right faces - medium
: 0xa4b3b5, // Shadow faces - dark
);
}); });
} }
} }