From 2ad09b51fafa2bce4248ed7fdbd4c712b7ebe260 Mon Sep 17 00:00:00 2001 From: Aden Lindsay Date: Sat, 15 Feb 2025 16:41:32 +1030 Subject: [PATCH] style(library): Re-designed Library UI with new features --- desktop/components/GameStatusButton.vue | 28 +- desktop/components/LibrarySearch.vue | 137 ++++++++++ desktop/pages/library.vue | 81 ++---- desktop/pages/library/[id]/index.vue | 323 +++++++++++++++++++++--- desktop/pages/library/index.vue | 23 +- desktop/src-tauri/src/games/library.rs | 1 + desktop/types.ts | 1 + 7 files changed, 483 insertions(+), 111 deletions(-) create mode 100644 desktop/components/LibrarySearch.vue diff --git a/desktop/components/GameStatusButton.vue b/desktop/components/GameStatusButton.vue index d9722d29..36468508 100644 --- a/desktop/components/GameStatusButton.vue +++ b/desktop/components/GameStatusButton.vue @@ -12,7 +12,8 @@
@@ -25,10 +26,11 @@ class="absolute right-0 z-50 mt-2 w-32 origin-top-right rounded-md bg-zinc-900 shadow-lg ring-1 ring-zinc-100/5 focus:outline-none">
- +
@@ -63,14 +65,14 @@ const emit = defineEmits<{ const showDropdown = computed(() => props.status.type === GameStatusEnum.Installed || props.status.type === GameStatusEnum.SetupRequired); const styles: { [key in GameStatusEnum]: string } = { - [GameStatusEnum.Remote]: "bg-blue-600 text-white hover:bg-blue-500 focus-visible:outline-blue-600", - [GameStatusEnum.Queued]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700", - [GameStatusEnum.Downloading]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700", - [GameStatusEnum.SetupRequired]: "bg-yellow-600 text-white hover:bg-yellow-500 focus-visible:outline-yellow-600", - [GameStatusEnum.Installed]: "bg-green-600 text-white hover:bg-green-500 focus-visible:outline-green-600", - [GameStatusEnum.Updating]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700", - [GameStatusEnum.Uninstalling]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700", - [GameStatusEnum.Running]: "bg-zinc-800 text-white focus-visible:outline-zinc-700" + [GameStatusEnum.Remote]: "bg-blue-600 text-white hover:bg-blue-500 focus-visible:outline-blue-600 hover:bg-blue-500", + [GameStatusEnum.Queued]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700 hover:bg-zinc-700", + [GameStatusEnum.Downloading]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700 hover:bg-zinc-700", + [GameStatusEnum.SetupRequired]: "bg-yellow-600 text-white hover:bg-yellow-500 focus-visible:outline-yellow-600 hover:bg-yellow-500", + [GameStatusEnum.Installed]: "bg-green-600 text-white hover:bg-green-500 focus-visible:outline-green-600 hover:bg-green-500", + [GameStatusEnum.Updating]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700 hover:bg-zinc-700", + [GameStatusEnum.Uninstalling]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700 hover:bg-zinc-700", + [GameStatusEnum.Running]: "bg-zinc-800 text-white hover:bg-zinc-700 focus-visible:outline-zinc-700 hover:bg-zinc-700" }; const buttonNames: { [key in GameStatusEnum]: string } = { diff --git a/desktop/components/LibrarySearch.vue b/desktop/components/LibrarySearch.vue new file mode 100644 index 00000000..b437804f --- /dev/null +++ b/desktop/components/LibrarySearch.vue @@ -0,0 +1,137 @@ + + + + + \ No newline at end of file diff --git a/desktop/pages/library.vue b/desktop/pages/library.vue index ab5079af..e0abafb8 100644 --- a/desktop/pages/library.vue +++ b/desktop/pages/library.vue @@ -1,78 +1,35 @@ -async function calculateGames(): Promise { - try { - return await invoke("fetch_library"); - } - catch(e) { - libraryDownloadError = true; - return new Array(); - } + diff --git a/desktop/pages/library/[id]/index.vue b/desktop/pages/library/[id]/index.vue index 539ec613..4d094ae0 100644 --- a/desktop/pages/library/[id]/index.vue +++ b/desktop/pages/library/[id]/index.vue @@ -1,41 +1,169 @@ + + +
+
+ + + + + + + + + +
+

+ {{ currentImageIndex + 1 }} / {{ mediaUrls.length }} +

+
+
+
+
+ + diff --git a/desktop/pages/library/index.vue b/desktop/pages/library/index.vue index dd245b63..e95d9dc4 100644 --- a/desktop/pages/library/index.vue +++ b/desktop/pages/library/index.vue @@ -1,9 +1,24 @@ - \ No newline at end of file +
+
+
+
+ +
+
+

Select a game

+

Choose a game from your library to view details

+
+
+
+
+ + \ No newline at end of file diff --git a/desktop/src-tauri/src/games/library.rs b/desktop/src-tauri/src/games/library.rs index b2f2fe25..4eda5347 100644 --- a/desktop/src-tauri/src/games/library.rs +++ b/desktop/src-tauri/src/games/library.rs @@ -36,6 +36,7 @@ pub struct Game { m_banner_id: String, m_cover_id: String, m_image_library: Vec, + m_image_carousel: Vec, } #[derive(serde::Serialize, Clone)] pub struct GameUpdateEvent { diff --git a/desktop/types.ts b/desktop/types.ts index 60a5b23f..0533cfd0 100644 --- a/desktop/types.ts +++ b/desktop/types.ts @@ -34,6 +34,7 @@ export type Game = { mBannerId: string; mCoverId: string; mImageLibrary: string[]; + mImageCarousel: string[]; }; export enum AppStatus {