File size: 2,989 Bytes
7428b13 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
<script lang="ts">
export let isWildBattle: boolean;
export let onAction: (action: string) => void;
</script>
<div class="action-grid">
<button class="action-button fight" on:click={() => onAction('fight')}>
<span class="action-icon">βοΈ</span>
<span class="action-label">Fight</span>
</button>
<button class="action-button piclet" on:click={() => onAction('piclet')}>
<span class="action-icon">π</span>
<span class="action-label">Piclet</span>
</button>
{#if isWildBattle}
<button class="action-button catch" on:click={() => onAction('catch')}>
<span class="action-icon">π―</span>
<span class="action-label">Catch</span>
</button>
{:else}
<button class="action-button items" disabled>
<span class="action-icon">π</span>
<span class="action-label">Items</span>
</button>
{/if}
<button class="action-button run" on:click={() => onAction('run')}>
<span class="action-icon">π</span>
<span class="action-label">Run</span>
</button>
</div>
<style>
.action-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
max-width: 400px;
margin: 0 auto;
width: 100%;
}
.action-button {
padding: 2rem 1rem;
background: #f8f9fa;
border: 2px solid #e0e0e0;
border-radius: 12px;
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
transition: all 0.2s ease;
position: relative;
overflow: hidden;
}
.action-button:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.action-button:active:not(:disabled) {
transform: translateY(0);
}
.action-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.action-icon {
font-size: 2rem;
}
.action-label {
font-weight: 600;
font-size: 1rem;
color: #333;
}
/* Action specific colors */
.fight {
background: #ffebee;
border-color: #ef5350;
}
.fight:hover:not(:disabled) {
background: #ffcdd2;
border-color: #e53935;
}
.piclet {
background: #e3f2fd;
border-color: #42a5f5;
}
.piclet:hover:not(:disabled) {
background: #bbdefb;
border-color: #2196f3;
}
.catch {
background: #e8f5e9;
border-color: #66bb6a;
}
.catch:hover:not(:disabled) {
background: #c8e6c9;
border-color: #4caf50;
}
.items {
background: #fff3e0;
border-color: #ffa726;
}
.items:hover:not(:disabled) {
background: #ffe0b2;
border-color: #ff9800;
}
.run {
background: #f3e5f5;
border-color: #ab47bc;
}
.run:hover:not(:disabled) {
background: #e1bee7;
border-color: #9c27b0;
}
@media (max-width: 480px) {
.action-button {
padding: 1.5rem 0.75rem;
}
.action-icon {
font-size: 1.5rem;
}
.action-label {
font-size: 0.875rem;
}
}
</style> |