Merge pull request 'ui/scene: refactor simplify select animation' (#4325) from ui-scene-1 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4325
This commit is contained in:
@@ -3,7 +3,7 @@ import { render } from "solid-js/web";
|
|||||||
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { QueryClient } from "@tanstack/solid-query";
|
import { QueryClient } from "@tanstack/solid-query";
|
||||||
import { CubeScene } from "./scene/qubes";
|
import { CubeScene } from "./scene/cubes";
|
||||||
|
|
||||||
export const client = new QueryClient();
|
export const client = new QueryClient();
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user