Add Zoom on Card
release-tag / release-image (push) Successful in 38s

Use Left Alt Key (for now)
Closes #13
This commit is contained in:
2024-05-13 16:57:03 +02:00
parent c86232cf6a
commit 2c4f9abc8d
5 changed files with 103 additions and 7 deletions
+9 -7
View File
@@ -1,6 +1,5 @@
<script setup lang="ts">
import type { Card } from '~/netcode/Card';
import goStore from '~/netcode';
export interface Props {
card_id: number | undefined
@@ -24,10 +23,12 @@ function cardClick() {
const rotation = ref(0)
// onBeforeUpdate(() => {
// rotation.value = Math.random() > .5 ? 2 : -2
// })
function mouseenter(e: Event) {
goStore.hoveredCard = props.card_id
}
function mouseleave(e: Event) {
goStore.hoveredCard = undefined
}
watch(
() => props.card_id,
@@ -39,7 +40,8 @@ watch(
<template>
<div :class="`card ${childCount > 0 ? 'active' : ''} ${wrapped ? 'wrapped' : ''} ${props.locked ? 'locked' : ''}`"
@contextmenu.prevent="false" @click.left="cardClick" :style="`rotate:${rotation}deg;`">
@contextmenu.prevent="false" @click.left="cardClick" :style="`rotate:${rotation}deg;`" @mouseenter="mouseenter"
@mouseleave="mouseleave">
<div id="contextMenuButtons" :ref="(el) => { childCount = ((el as Element)?.childElementCount ?? 0) }">
<slot></slot>
</div>