From c5758bceeb550edcebcc5e596d5e5e520c8614e6 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Fri, 12 Sep 2025 15:36:59 -0400 Subject: [PATCH] use v-img with webp and fallback in console mode --- frontend/assets/console/default/theme.css | 1 - frontend/assets/console/neon/theme.css | 1 - .../src/components/common/Collection/Card.vue | 8 +- .../components/common/Collection/RAvatar.vue | 8 +- .../src/components/common/Game/Card/Base.vue | 8 +- .../src/console/components/CollectionCard.vue | 8 +- frontend/src/console/components/GameCard.vue | 73 +++++++++++++------ frontend/src/utils/covers.ts | 2 + 8 files changed, 73 insertions(+), 36 deletions(-) diff --git a/frontend/assets/console/default/theme.css b/frontend/assets/console/default/theme.css index 5708dfa73..f3899e16f 100644 --- a/frontend/assets/console/default/theme.css +++ b/frontend/assets/console/default/theme.css @@ -75,7 +75,6 @@ --console-system-card-text: var(--console-text-primary); /* Game Cards */ - --console-game-card-bg: linear-gradient(180deg, #1f2430 0%, #2b3242 100%); --console-game-card-text: var(--console-text-primary); --console-game-card-focus-border: var(--console-accent-secondary); --console-game-card-star: var(--console-accent-secondary); diff --git a/frontend/assets/console/neon/theme.css b/frontend/assets/console/neon/theme.css index 3649afc18..2745427ce 100644 --- a/frontend/assets/console/neon/theme.css +++ b/frontend/assets/console/neon/theme.css @@ -75,7 +75,6 @@ --console-system-card-text: var(--console-text-secondary); /* Game Cards */ - --console-game-card-bg: linear-gradient(180deg, #212121 0%, #303030 100%); --console-game-card-text: var(--console-text-secondary); --console-game-card-focus-border: var(--console-accent-secondary); --console-game-card-star: var(--console-accent-secondary); diff --git a/frontend/src/components/common/Collection/Card.vue b/frontend/src/components/common/Collection/Card.vue index aa5c7c96a..3af7a4d4a 100644 --- a/frontend/src/components/common/Collection/Card.vue +++ b/frontend/src/components/common/Collection/Card.vue @@ -14,9 +14,11 @@ import { ROUTES } from "@/plugins/router"; import type { CollectionType } from "@/stores/collections"; import storeGalleryView from "@/stores/galleryView"; import storeHeartbeat from "@/stores/heartbeat"; -import { getCollectionCoverImage, getFavoriteCoverImage } from "@/utils/covers"; - -const EXTENSION_REGEX = /\.png|\.jpg|\.jpeg$/; +import { + getCollectionCoverImage, + getFavoriteCoverImage, + EXTENSION_REGEX, +} from "@/utils/covers"; const props = withDefaults( defineProps<{ diff --git a/frontend/src/components/common/Collection/RAvatar.vue b/frontend/src/components/common/Collection/RAvatar.vue index 622ebed8f..fcb3b620b 100644 --- a/frontend/src/components/common/Collection/RAvatar.vue +++ b/frontend/src/components/common/Collection/RAvatar.vue @@ -3,9 +3,11 @@ import { computed, ref, watchEffect } from "vue"; import Skeleton from "@/components/common/Game/Card/Skeleton.vue"; import { type CollectionType } from "@/stores/collections"; import storeHeartbeat from "@/stores/heartbeat"; -import { getCollectionCoverImage, getFavoriteCoverImage } from "@/utils/covers"; - -const EXTENSION_REGEX = /\.png|\.jpg|\.jpeg$/; +import { + getCollectionCoverImage, + getFavoriteCoverImage, + EXTENSION_REGEX, +} from "@/utils/covers"; const props = withDefaults( defineProps<{ diff --git a/frontend/src/components/common/Game/Card/Base.vue b/frontend/src/components/common/Game/Card/Base.vue index 5af46bc4f..30190bfec 100644 --- a/frontend/src/components/common/Game/Card/Base.vue +++ b/frontend/src/components/common/Game/Card/Base.vue @@ -26,9 +26,11 @@ import storePlatforms from "@/stores/platforms"; import storeRoms from "@/stores/roms"; import { type SimpleRom } from "@/stores/roms"; import type { Events } from "@/types/emitter"; -import { getMissingCoverImage, getUnmatchedCoverImage } from "@/utils/covers"; - -const EXTENSION_REGEX = /\.png|\.jpg|\.jpeg$/; +import { + getMissingCoverImage, + getUnmatchedCoverImage, + EXTENSION_REGEX, +} from "@/utils/covers"; const props = withDefaults( defineProps<{ diff --git a/frontend/src/console/components/CollectionCard.vue b/frontend/src/console/components/CollectionCard.vue index b5eafd653..8e9bd789e 100644 --- a/frontend/src/console/components/CollectionCard.vue +++ b/frontend/src/console/components/CollectionCard.vue @@ -14,9 +14,11 @@ import { } from "@/console/composables/useElementRegistry"; import type { CollectionType } from "@/stores/collections"; import storeHeartbeat from "@/stores/heartbeat"; -import { getCollectionCoverImage, getFavoriteCoverImage } from "@/utils/covers"; - -const EXTENSION_REGEX = /\.png|\.jpg|\.jpeg$/; +import { + getCollectionCoverImage, + getFavoriteCoverImage, + EXTENSION_REGEX, +} from "@/utils/covers"; const props = defineProps<{ collection: CollectionType; diff --git a/frontend/src/console/components/GameCard.vue b/frontend/src/console/components/GameCard.vue index c2d8e4131..3357a5381 100644 --- a/frontend/src/console/components/GameCard.vue +++ b/frontend/src/console/components/GameCard.vue @@ -1,11 +1,18 @@