mirror of
https://github.com/rommapp/romm.git
synced 2026-12-02 10:08:40 +01:00
Merge pull request #3093 from rommapp/copilot/add-click-to-zoom-feature
feat: Click to zoom game cover image
This commit is contained in:
@@ -19,6 +19,7 @@ import Skeleton from "@/components/common/Game/Card/Skeleton.vue";
|
||||
import Sources from "@/components/common/Game/Card/Sources.vue";
|
||||
import MissingFromFSIcon from "@/components/common/MissingFromFSIcon.vue";
|
||||
import PlatformIcon from "@/components/common/Platform/PlatformIcon.vue";
|
||||
import RDialog from "@/components/common/RDialog.vue";
|
||||
import { useGameAnimation } from "@/composables/useGameAnimation";
|
||||
import { ROUTES } from "@/plugins/router";
|
||||
import storeCollections from "@/stores/collections";
|
||||
@@ -83,6 +84,7 @@ const { smAndDown } = useDisplay();
|
||||
const romsStore = storeRoms();
|
||||
const activeMenu = ref(false);
|
||||
const gameIsHovering = ref(false);
|
||||
const showCoverZoom = ref(false);
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
emitter?.on("playGame", handlePlayGame);
|
||||
|
||||
@@ -293,6 +295,16 @@ onBeforeUnmount(() => {
|
||||
@touchstart="handleTouchStart"
|
||||
@touchend="handleTouchEnd"
|
||||
>
|
||||
<v-fade-transition>
|
||||
<v-btn
|
||||
v-if="isOuterHovering && !pointerOnHover"
|
||||
icon="mdi-magnify-plus-outline"
|
||||
size="x-small"
|
||||
class="cover-zoom-btn position-absolute"
|
||||
variant="flat"
|
||||
@click.stop="showCoverZoom = true"
|
||||
/>
|
||||
</v-fade-transition>
|
||||
<template v-if="titleOnHover">
|
||||
<v-expand-transition>
|
||||
<div
|
||||
@@ -469,6 +481,27 @@ onBeforeUnmount(() => {
|
||||
</v-card>
|
||||
</div>
|
||||
</v-hover>
|
||||
|
||||
<r-dialog v-model="showCoverZoom" :width="500" icon="mdi-image">
|
||||
<template #header>
|
||||
{{ rom.name }}
|
||||
</template>
|
||||
<template #content>
|
||||
<v-img
|
||||
:src="largeCover || fallbackCoverImage"
|
||||
:alt="rom.name || 'Cover'"
|
||||
contain
|
||||
max-height="70vh"
|
||||
class="pa-2"
|
||||
>
|
||||
<template #placeholder>
|
||||
<div class="d-flex justify-center align-center h-100">
|
||||
<v-progress-circular indeterminate />
|
||||
</div>
|
||||
</template>
|
||||
</v-img>
|
||||
</template>
|
||||
</r-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -504,6 +537,13 @@ onBeforeUnmount(() => {
|
||||
right: 0rem;
|
||||
}
|
||||
|
||||
.cover-zoom-btn {
|
||||
top: 0.25rem;
|
||||
right: 0.25rem;
|
||||
opacity: 0.85;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.v-chip:hover {
|
||||
transform: scale(1.1);
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
Reference in New Issue
Block a user