pet/src/components/ActionMenu.vue

144 lines
4.1 KiB
Vue
Raw Normal View History

2025-11-20 09:15:38 +00:00
<template>
<div class="action-menu">
2025-11-20 16:00:13 +00:00
<button class="icon-btn icon-clean" @click="$emit('clean')" :disabled="disabled || poopCount === 0" title="清理"></button>
<button class="icon-btn icon-medicine" @click="$emit('medicine')" :disabled="disabled || !isSick" title="治療"></button>
2025-11-22 15:50:28 +00:00
<button class="icon-btn icon-sleep" @click="$emit('sleep')" :disabled="disabled" title="關燈"></button>
2025-11-21 14:26:10 +00:00
<button class="icon-btn icon-backpack" @click="$emit('inventory')" :disabled="disabled" title="背包"></button>
2025-11-20 09:15:38 +00:00
</div>
</template>
<script setup>
const props = defineProps({
disabled: {
type: Boolean,
default: false
},
poopCount: {
type: Number,
default: 0
},
health: {
type: Number,
default: 100
},
isSick: {
type: Boolean,
default: false
}
});
2025-11-22 15:50:28 +00:00
defineEmits(['clean', 'medicine', 'sleep', 'inventory']);
2025-11-20 09:15:38 +00:00
</script>
<style scoped>
.action-menu {
display: flex;
justify-content: space-around;
align-items: center;
padding: 6px 12px;
background: rgba(155, 188, 15, 0.05);
border-top: 2px solid rgba(0, 0, 0, 0.1);
}
.icon-btn {
width: 16px;
height: 16px;
border: none;
background: transparent;
cursor: pointer;
position: relative;
padding: 0;
}
.icon-btn:disabled {
opacity: 0.3;
cursor: not-allowed;
}
/* Clean Icon (Broom) */
.icon-clean::before {
content: '';
position: absolute;
width: 2px;
height: 2px;
background: #8B4513;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow:
0px -6px 0 #8B4513, 0px -4px 0 #8B4513,
0px -2px 0 #8B4513, 0px 0px 0 #8B4513,
-4px 2px 0 #ffcc00, -2px 2px 0 #ffcc00, 0px 2px 0 #ffcc00, 2px 2px 0 #ffcc00, 4px 2px 0 #ffcc00,
-4px 4px 0 #ffcc00, -2px 4px 0 #ffcc00, 0px 4px 0 #ffcc00, 2px 4px 0 #ffcc00, 4px 4px 0 #ffcc00,
-2px 6px 0 #ffcc00, 0px 6px 0 #ffcc00, 2px 6px 0 #ffcc00;
}
/* Medicine Icon (Pill/Cross) */
.icon-medicine::before {
content: '';
position: absolute;
width: 2px;
height: 2px;
background: #ff4444;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow:
0px -6px 0 #ff4444, 0px -4px 0 #ff4444,
-4px -2px 0 #ff4444, -2px -2px 0 #ff4444, 0px -2px 0 #ff4444, 2px -2px 0 #ff4444, 4px -2px 0 #ff4444,
0px 0px 0 #ff4444, 0px 2px 0 #ff4444,
0px 4px 0 #ff4444, 0px 6px 0 #ff4444;
}
2025-11-22 18:22:32 +00:00
/* Sleep Icon (Light Bulb/燈泡) - Enhanced */
2025-11-22 15:50:28 +00:00
.icon-sleep::before {
2025-11-20 09:15:38 +00:00
content: '';
position: absolute;
width: 2px;
height: 2px;
2025-11-22 18:22:32 +00:00
background: transparent;
2025-11-20 09:15:38 +00:00
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
2025-11-22 18:22:32 +00:00
transform: translate(-50%, -50%);
2025-11-20 09:15:38 +00:00
box-shadow:
2025-11-22 15:50:28 +00:00
/* 燈泡主體 (圓形) */
-2px -6px 0 #ffd700, 0px -6px 0 #ffd700, 2px -6px 0 #ffd700,
-4px -4px 0 #ffd700, -2px -4px 0 #ffd700, 0px -4px 0 #ffd700, 2px -4px 0 #ffd700, 4px -4px 0 #ffd700,
-4px -2px 0 #ffd700, -2px -2px 0 #ffd700, 0px -2px 0 #ffd700, 2px -2px 0 #ffd700, 4px -2px 0 #ffd700,
-4px 0px 0 #ffd700, -2px 0px 0 #ffd700, 0px 0px 0 #ffd700, 2px 0px 0 #ffd700, 4px 0px 0 #ffd700,
-2px 2px 0 #ffd700, 0px 2px 0 #ffd700, 2px 2px 0 #ffd700,
/* 燈泡底部 (螺旋) */
-1px 4px 0 #8B4513, 0px 4px 0 #8B4513, 1px 4px 0 #8B4513,
/* 光線 (向下) */
0px 6px 0 #ffd700, 0px 8px 0 #ffd700;
2025-11-20 09:15:38 +00:00
}
2025-11-21 14:26:10 +00:00
/* Backpack Icon */
.icon-backpack::before {
2025-11-20 09:15:38 +00:00
content: '';
position: absolute;
width: 2px;
height: 2px;
2025-11-21 14:26:10 +00:00
background: #8d6e63;
2025-11-20 09:15:38 +00:00
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow:
2025-11-21 14:26:10 +00:00
/* Top flap */
-2px -6px 0 #8d6e63, 0px -6px 0 #8d6e63, 2px -6px 0 #8d6e63,
-4px -4px 0 #8d6e63, -2px -4px 0 #a1887f, 0px -4px 0 #a1887f, 2px -4px 0 #a1887f, 4px -4px 0 #8d6e63,
/* Body */
-4px -2px 0 #8d6e63, -2px -2px 0 #5d4037, 0px -2px 0 #5d4037, 2px -2px 0 #5d4037, 4px -2px 0 #8d6e63,
-4px 0px 0 #8d6e63, -2px 0px 0 #5d4037, 0px 0px 0 #5d4037, 2px 0px 0 #5d4037, 4px 0px 0 #8d6e63,
-4px 2px 0 #8d6e63, -2px 2px 0 #5d4037, 0px 2px 0 #5d4037, 2px 2px 0 #5d4037, 4px 2px 0 #8d6e63,
-4px 4px 0 #8d6e63, -2px 4px 0 #5d4037, 0px 4px 0 #5d4037, 2px 4px 0 #5d4037, 4px 4px 0 #8d6e63,
/* Bottom */
-2px 6px 0 #8d6e63, 0px 6px 0 #8d6e63, 2px 6px 0 #8d6e63;
2025-11-20 09:15:38 +00:00
}
2025-11-22 03:23:02 +00:00
2025-11-20 09:15:38 +00:00
</style>