Fraser commited on
Commit
ea83c78
Β·
1 Parent(s): 1bb845a

show act type

Browse files
src/lib/components/Battle/ActionViewSelector.svelte CHANGED
@@ -22,6 +22,11 @@
22
  // Enhanced move information from battle state
23
  $: enhancedMoves = battleState?.playerPiclet?.moves || [];
24
 
 
 
 
 
 
25
  // Main action items
26
  const actions = [
27
  { title: 'Act', icon: 'βš”οΈ', view: 'moves' as ActionView },
@@ -75,19 +80,12 @@
75
  on:click={() => !isDisabled && onMoveSelected(move)}
76
  disabled={isDisabled || processingTurn}
77
  >
78
- <span class="type-emoji" class:disabled={isDisabled}>
79
- {move.type === 'normal' ? 'βšͺ' :
80
- move.type === 'beast' ? '🦁' :
81
- move.type === 'bug' ? 'πŸ›' :
82
- move.type === 'aquatic' ? '🌊' :
83
- move.type === 'flora' ? '🌿' :
84
- move.type === 'mineral' ? 'πŸ’Ž' :
85
- move.type === 'space' ? '🌌' :
86
- move.type === 'machina' ? 'βš™οΈ' :
87
- move.type === 'structure' ? 'πŸ—οΈ' :
88
- move.type === 'culture' ? '🎭' :
89
- move.type === 'cuisine' ? '🍽️' : '❓'}
90
- </span>
91
  <div class="move-info">
92
  <div class="move-name" class:disabled={isDisabled}>
93
  {move.name}
@@ -143,7 +141,11 @@
143
  <div class="piclet-info">
144
  <div class="piclet-header">
145
  <span class="piclet-name">{piclet.nickname}</span>
146
- <span class="type-emoji">πŸ”₯</span>
 
 
 
 
147
  <span class="level-badge">Lv.{piclet.level}</span>
148
  </div>
149
  <div class="hp-row">
@@ -338,17 +340,23 @@
338
  }
339
 
340
  /* Move items */
341
- .type-emoji {
342
- font-size: 20px;
 
343
  margin-right: 12px;
344
- width: 32px;
345
- text-align: center;
346
  }
347
 
348
- .type-emoji.disabled {
349
  opacity: 0.3;
350
  }
351
 
 
 
 
 
 
 
352
  .move-info {
353
  flex: 1;
354
  }
 
22
  // Enhanced move information from battle state
23
  $: enhancedMoves = battleState?.playerPiclet?.moves || [];
24
 
25
+ // Helper function to get type logo path
26
+ function getTypeLogo(type: string): string {
27
+ return `/classes/${type}.png`;
28
+ }
29
+
30
  // Main action items
31
  const actions = [
32
  { title: 'Act', icon: 'βš”οΈ', view: 'moves' as ActionView },
 
80
  on:click={() => !isDisabled && onMoveSelected(move)}
81
  disabled={isDisabled || processingTurn}
82
  >
83
+ <img
84
+ src={getTypeLogo(move.type)}
85
+ alt={move.type}
86
+ class="type-logo"
87
+ class:disabled={isDisabled}
88
+ />
 
 
 
 
 
 
 
89
  <div class="move-info">
90
  <div class="move-name" class:disabled={isDisabled}>
91
  {move.name}
 
141
  <div class="piclet-info">
142
  <div class="piclet-header">
143
  <span class="piclet-name">{piclet.nickname}</span>
144
+ <img
145
+ src={getTypeLogo(piclet.primaryType)}
146
+ alt={piclet.primaryType}
147
+ class="type-logo-small"
148
+ />
149
  <span class="level-badge">Lv.{piclet.level}</span>
150
  </div>
151
  <div class="hp-row">
 
340
  }
341
 
342
  /* Move items */
343
+ .type-logo {
344
+ width: 24px;
345
+ height: 24px;
346
  margin-right: 12px;
347
+ object-fit: contain;
 
348
  }
349
 
350
+ .type-logo.disabled {
351
  opacity: 0.3;
352
  }
353
 
354
+ .type-logo-small {
355
+ width: 16px;
356
+ height: 16px;
357
+ object-fit: contain;
358
+ }
359
+
360
  .move-info {
361
  flex: 1;
362
  }
src/lib/components/Battle/PicletInfo.svelte CHANGED
@@ -17,7 +17,7 @@
17
  $: typeColor = typeData.color;
18
  $: typeLogoPath = `/classes/${piclet.primaryType}.png`;
19
 
20
- $: hpColor = hpPercentage > 0.5 ? '#4caf50' : hpPercentage > 0.2 ? '#ffc107' : '#f44336';
21
  $: displayHp = Math.ceil(piclet.currentHp);
22
 
23
  // Track HP changes for animations
@@ -42,28 +42,33 @@
42
  <span class="level-badge">Lv.{piclet.level}</span>
43
  </div>
44
 
45
- <!-- HP Bar -->
46
- <div class="hp-bar">
47
- <div
48
- class="hp-fill"
49
- style="width: {hpPercentage * 100}%; background-color: {hpColor}"
50
- ></div>
 
 
 
 
 
 
 
 
51
  </div>
52
 
53
- <!-- HP Text (Player only) -->
54
  {#if isPlayer}
55
- <div class="hp-text">
56
- <span class="hp-values" class:hp-flash={hpFlash}>{displayHp}/{piclet.maxHp} HP</span>
 
 
 
 
 
 
57
  </div>
58
-
59
- <!-- XP Bar (Player only) -->
60
- <div class="xp-bar">
61
- <div
62
- class="xp-fill"
63
- style="width: {xpTowardsNext.percentage}%"
64
- ></div>
65
- </div>
66
-
67
  {/if}
68
  </div>
69
 
@@ -102,8 +107,8 @@
102
  /* Type Logo Background */
103
  .type-logo-background {
104
  position: absolute;
105
- bottom: 1px;
106
- left: 1px;
107
  width: 35px;
108
  height: 35px;
109
  background-image: var(--type-logo);
@@ -140,6 +145,26 @@
140
  color: #333;
141
  }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  /* HP Bar */
144
  .hp-bar {
145
  width: 120px;
@@ -147,9 +172,7 @@
147
  background: #e0e0e0;
148
  border-radius: 4px;
149
  overflow: hidden;
150
- margin-bottom: 4px;
151
- position: relative;
152
- z-index: 2;
153
  }
154
 
155
  .hp-fill {
@@ -161,9 +184,6 @@
161
  .hp-text {
162
  font-size: 11px;
163
  color: #666;
164
- margin-bottom: 4px;
165
- position: relative;
166
- z-index: 2;
167
  }
168
 
169
  .hp-values {
@@ -186,13 +206,10 @@
186
  /* XP Bar */
187
  .xp-bar {
188
  width: 120px;
189
- height: 4px;
190
  background: #e0e0e0;
191
- border-radius: 2px;
192
  overflow: hidden;
193
- margin-bottom: 2px;
194
- position: relative;
195
- z-index: 2;
196
  }
197
 
198
  .xp-fill {
 
17
  $: typeColor = typeData.color;
18
  $: typeLogoPath = `/classes/${piclet.primaryType}.png`;
19
 
20
+ $: hpColor = hpPercentage > 0.5 ? '#34c759' : hpPercentage > 0.25 ? '#ffcc00' : '#ff3b30';
21
  $: displayHp = Math.ceil(piclet.currentHp);
22
 
23
  // Track HP changes for animations
 
42
  <span class="level-badge">Lv.{piclet.level}</span>
43
  </div>
44
 
45
+ <!-- HP Section -->
46
+ <div class="stat-section">
47
+ <div class="stat-label">HP</div>
48
+ <div class="hp-bar">
49
+ <div
50
+ class="hp-fill"
51
+ style="width: {hpPercentage * 100}%; background-color: {hpColor}"
52
+ ></div>
53
+ </div>
54
+ {#if isPlayer}
55
+ <div class="hp-text">
56
+ <span class="hp-values" class:hp-flash={hpFlash}>{displayHp}/{piclet.maxHp}</span>
57
+ </div>
58
+ {/if}
59
  </div>
60
 
61
+ <!-- XP Section (Player only) -->
62
  {#if isPlayer}
63
+ <div class="stat-section">
64
+ <div class="stat-label">XP</div>
65
+ <div class="xp-bar">
66
+ <div
67
+ class="xp-fill"
68
+ style="width: {xpTowardsNext.percentage}%"
69
+ ></div>
70
+ </div>
71
  </div>
 
 
 
 
 
 
 
 
 
72
  {/if}
73
  </div>
74
 
 
107
  /* Type Logo Background */
108
  .type-logo-background {
109
  position: absolute;
110
+ bottom: -4px;
111
+ right: 0px;
112
  width: 35px;
113
  height: 35px;
114
  background-image: var(--type-logo);
 
145
  color: #333;
146
  }
147
 
148
+ /* Stat Sections */
149
+ .stat-section {
150
+ margin-bottom: 6px;
151
+ position: relative;
152
+ z-index: 2;
153
+ }
154
+
155
+ .stat-section:last-child {
156
+ margin-bottom: 0;
157
+ }
158
+
159
+ .stat-label {
160
+ font-size: 10px;
161
+ font-weight: 600;
162
+ color: #666;
163
+ margin-bottom: 2px;
164
+ text-transform: uppercase;
165
+ letter-spacing: 0.5px;
166
+ }
167
+
168
  /* HP Bar */
169
  .hp-bar {
170
  width: 120px;
 
172
  background: #e0e0e0;
173
  border-radius: 4px;
174
  overflow: hidden;
175
+ margin-bottom: 2px;
 
 
176
  }
177
 
178
  .hp-fill {
 
184
  .hp-text {
185
  font-size: 11px;
186
  color: #666;
 
 
 
187
  }
188
 
189
  .hp-values {
 
206
  /* XP Bar */
207
  .xp-bar {
208
  width: 120px;
209
+ height: 6px;
210
  background: #e0e0e0;
211
+ border-radius: 3px;
212
  overflow: hidden;
 
 
 
213
  }
214
 
215
  .xp-fill {
src/lib/components/Piclets/MoveDisplay.svelte CHANGED
@@ -15,23 +15,12 @@
15
  const battleMove = $derived(enhancedMove?.move);
16
  const currentPp = $derived(enhancedMove?.currentPp ?? move.currentPp);
17
 
18
- function getTypeEmoji(type: string): string {
19
- switch (type) {
20
- case 'normal': return 'βšͺ';
21
- case 'beast': return '🦁';
22
- case 'bug': return 'πŸ›';
23
- case 'aquatic': return '🌊';
24
- case 'flora': return '🌿';
25
- case 'mineral': return 'πŸ’Ž';
26
- case 'space': return '🌌';
27
- case 'machina': return 'βš™οΈ';
28
- case 'structure': return 'πŸ—οΈ';
29
- case 'culture': return '🎭';
30
- case 'cuisine': return '🍽️';
31
- default: return '❓';
32
- }
33
  }
34
 
 
35
  function getTypeColor(type: string): string {
36
  switch (type) {
37
  case 'normal': return '#a8a878';
@@ -138,7 +127,11 @@
138
  <div class="move-display" class:disabled={isOutOfPP}>
139
  <div class="move-header">
140
  <div class="move-title-section">
141
- <span class="type-emoji">{getTypeEmoji(move.type)}</span>
 
 
 
 
142
  <div class="move-info">
143
  <div class="move-name-row">
144
  <span class="move-name">{move.name}</span>
@@ -257,8 +250,10 @@
257
  flex: 1;
258
  }
259
 
260
- .type-emoji {
261
- font-size: 20px;
 
 
262
  margin-top: 2px;
263
  }
264
 
 
15
  const battleMove = $derived(enhancedMove?.move);
16
  const currentPp = $derived(enhancedMove?.currentPp ?? move.currentPp);
17
 
18
+ // Helper function to get type logo path
19
+ function getTypeLogo(type: string): string {
20
+ return `/classes/${type}.png`;
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
+
24
  function getTypeColor(type: string): string {
25
  switch (type) {
26
  case 'normal': return '#a8a878';
 
127
  <div class="move-display" class:disabled={isOutOfPP}>
128
  <div class="move-header">
129
  <div class="move-title-section">
130
+ <img
131
+ src={getTypeLogo(move.type)}
132
+ alt={move.type}
133
+ class="type-logo"
134
+ />
135
  <div class="move-info">
136
  <div class="move-name-row">
137
  <span class="move-name">{move.name}</span>
 
250
  flex: 1;
251
  }
252
 
253
+ .type-logo {
254
+ width: 24px;
255
+ height: 24px;
256
+ object-fit: contain;
257
  margin-top: 2px;
258
  }
259