48 lines
917 B
Vue
48 lines
917 B
Vue
<script setup>
|
|
import {ref, Transition} from 'vue';
|
|
|
|
const hover = ref(false);
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex-container">
|
|
<Transition>
|
|
<img :src="'/skonk/main_menu_pointer.png'" class="cursor" v-if="hover">
|
|
</Transition>
|
|
<button @click="$emit('click')" @mouseover="hover = true" @mouseleave="hover = false">
|
|
<slot>
|
|
|
|
</slot>
|
|
</button>
|
|
<Transition>
|
|
<img :src="'/skonk/main_menu_pointer.png'" class="cursor flipped" v-if="hover">
|
|
</Transition>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.v-enter-active,
|
|
.v-leave-active {
|
|
transition: opacity 0.15s ease;
|
|
}
|
|
|
|
.v-enter-from,
|
|
.v-leave-to {
|
|
opacity: 0;
|
|
}
|
|
.flex-container {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
button {
|
|
font-size: 3.5vh;
|
|
}
|
|
.cursor {
|
|
height: 30px;
|
|
}
|
|
.flipped {
|
|
rotate: 180deg;
|
|
}
|
|
</style> |