Use Left Alt Key (for now) Closes #13
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user