From 4ae9c10d76ef142000e4e0f163e0401f489a96a9 Mon Sep 17 00:00:00 2001 From: zurdi Date: Mon, 26 May 2025 12:29:53 +0000 Subject: [PATCH] feat: add 3D tilt effect and hover functionality to collection cards --- frontend/src/components/Home/Collections.vue | 17 +- .../src/components/Home/ContinuePlaying.vue | 2 +- frontend/src/components/Home/Platforms.vue | 2 +- frontend/src/components/Home/RecentAdded.vue | 2 +- .../components/Home/VirtualCollections.vue | 20 +- .../src/components/common/Collection/Card.vue | 176 +++++++++++------- 6 files changed, 147 insertions(+), 72 deletions(-) diff --git a/frontend/src/components/Home/Collections.vue b/frontend/src/components/Home/Collections.vue index ac8319e69..897090d3d 100644 --- a/frontend/src/components/Home/Collections.vue +++ b/frontend/src/components/Home/Collections.vue @@ -14,6 +14,10 @@ const storedCollections = localStorage.getItem("settings.gridCollections"); const gridCollections = ref( isNull(storedCollections) ? false : storedCollections === "true", ); +const isHovering = ref(false); +const hoveringCollectionId = ref(); + +// Functions function toggleGridCollections() { gridCollections.value = !gridCollections.value; localStorage.setItem( @@ -21,6 +25,11 @@ function toggleGridCollections() { gridCollections.value.toString(), ); } + +function onHover(emitData: { isHovering: boolean; id: number }) { + isHovering.value = emitData.isHovering; + hoveringCollectionId.value = emitData.id; +}