3 changed files with 65 additions and 78 deletions
@ -0,0 +1,59 @@ |
|||
<script setup lang="ts"> |
|||
defineProps<{ |
|||
text: string |
|||
}>() |
|||
|
|||
defineEmits<{ |
|||
click: [event: MouseEvent] |
|||
}>() |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="ink-button" @click="$emit('click', $event)"> |
|||
<span class="ink-button-text">{{ text }}</span> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
.ink-button { |
|||
position: relative; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 220px; |
|||
height: 80px; |
|||
margin: 0 auto; |
|||
font-family: "STKaiti", "KaiTi", "华文楷体", "Microsoft YaHei", cursive; |
|||
font-size: 18px; |
|||
font-weight: bold; |
|||
color: #ffffff; |
|||
letter-spacing: 4px; |
|||
cursor: pointer; |
|||
border: none; |
|||
background: transparent; |
|||
z-index: 1; |
|||
} |
|||
|
|||
.ink-button::before { |
|||
content: ''; |
|||
position: absolute; |
|||
inset: 0; |
|||
background: url(@/assets/brushbutton.png) no-repeat center; |
|||
background-size: contain; |
|||
transition: transform 0.3s ease; |
|||
z-index: -1; |
|||
} |
|||
|
|||
.ink-button:hover::before { |
|||
transform: scale(1.05); |
|||
} |
|||
|
|||
.ink-button:active::before { |
|||
transform: scale(0.95); |
|||
} |
|||
|
|||
.ink-button-text { |
|||
position: relative; |
|||
z-index: 1; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue