diff --git a/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx b/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx index da6e2e3..d0bb364 100644 --- a/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx +++ b/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx @@ -6,6 +6,7 @@ import PositionInput from "../customInput/PositionInputs"; import RotationInput from "../customInput/RotationInput"; import { useSelectedFloorItem, useObjectPosition, useObjectRotation } from "../../../../store/builder/store"; import { useSceneContext } from "../../../../modules/scene/sceneContext"; +import { center } from "@turf/turf"; interface UserData { id: number; // Unique identifier for the user data @@ -21,7 +22,8 @@ const AssetProperties: React.FC = () => { const { objectRotation } = useObjectRotation(); const { assetStore } = useSceneContext(); const { assets, setCurrentAnimation } = assetStore() - + const [hoveredIndex, setHoveredIndex] = useState(null); + const [isPlaying, setIsplaying] = useState(false); // Function to handle adding new user data const handleAddUserData = () => { const newUserData: UserData = { @@ -106,19 +108,37 @@ const AssetProperties: React.FC = () => { + Add -
+
+ {selectedFloorItem.uuid &&
Animations
} {assets.map((asset) => (
- { - asset.modelUuid === selectedFloorItem.uuid && - asset.animations && asset.animations.length > 0 - && asset.animations.map((animation, index) => ( -
{ handleAnimationClick(animation) }}> - {animation} + {asset.modelUuid === selectedFloorItem.uuid && + asset.animations && + asset.animations.length > 0 && + asset.animations.map((animation, index) => ( +
+
handleAnimationClick(animation)} + onMouseEnter={() => setHoveredIndex(index)} + onMouseLeave={() => setHoveredIndex(null)} + style={{ + height: "20px", + width: "100%", + borderRadius: "5px", + background: + hoveredIndex === index + ? "#7b4cd3" + : "transparent", + }} + > + {animation.charAt(0).toUpperCase() + + animation.slice(1).toLowerCase()} +
- )) - } - + ))}
))}