Fraser commited on
Commit
748b3b3
·
1 Parent(s): 5c9dd93

make platforms static

Browse files
src/lib/components/Battle/BattleField.svelte CHANGED
@@ -118,6 +118,20 @@
118
  isPlayer={false}
119
  />
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  {#if enemyVisible}
122
  <div class="enemy-piclet-wrapper" class:animate-in={showIntro} class:lunge={enemyLunge}>
123
  <!-- Enemy Battle Effects wrap the image for flicker animation -->
@@ -133,19 +147,6 @@
133
  />
134
  </BattleEffects>
135
 
136
- <img
137
- class="platform enemy-platform"
138
- src="/assets/grass.PNG"
139
- alt="Platform"
140
- on:error={(e) => {
141
- const target = e.currentTarget as HTMLImageElement;
142
- const nextSibling = target.nextElementSibling as HTMLElement;
143
- target.style.display = 'none';
144
- if (nextSibling) nextSibling.style.display = 'block';
145
- }}
146
- />
147
- <div class="platform-fallback enemy-platform-fallback" style="display: none;"></div>
148
-
149
  <!-- Enemy Status Effects -->
150
  {#if battleState?.opponentPiclet?.statusEffects}
151
  <div class="enemy-status-effects">
@@ -162,6 +163,21 @@
162
  <!-- Player Row -->
163
  <div class="player-row">
164
  <div class="player-stack" class:intro-animations={showIntro}>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  {#if playerVisible}
166
  <div class="player-piclet-wrapper" class:animate-in={showIntro} class:lunge={playerLunge}>
167
  <!-- Player Battle Effects wrap the image for flicker animation -->
@@ -177,19 +193,6 @@
177
  />
178
  </BattleEffects>
179
 
180
- <img
181
- class="platform player-platform"
182
- src="/assets/grass.PNG"
183
- alt="Platform"
184
- on:error={(e) => {
185
- const target = e.currentTarget as HTMLImageElement;
186
- const nextSibling = target.nextElementSibling as HTMLElement;
187
- target.style.display = 'none';
188
- if (nextSibling) nextSibling.style.display = 'block';
189
- }}
190
- />
191
- <div class="platform-fallback player-platform-fallback" style="display: none;"></div>
192
-
193
  <!-- Player Status Effects -->
194
  {#if battleState?.playerPiclet?.statusEffects}
195
  <div class="player-status-effects">
@@ -309,7 +312,7 @@
309
  height: 160px;
310
  position: absolute;
311
  bottom: -60px;
312
- left: -20px;
313
  z-index: 0;
314
  object-fit: cover;
315
  }
@@ -345,7 +348,7 @@
345
  height: 160px;
346
  position: absolute;
347
  bottom: -80px;
348
- left: -20px;
349
  z-index: 0;
350
  object-fit: cover;
351
  }
@@ -360,15 +363,15 @@
360
  .enemy-platform-fallback {
361
  width: 160px;
362
  height: 160px;
363
- bottom: -80px;
364
- left: -20px;
365
  }
366
 
367
  .player-platform-fallback {
368
  width: 160px;
369
  height: 160px;
370
  bottom: -80px;
371
- left: -20px;
372
  }
373
 
374
  /* Piclet images */
 
118
  isPlayer={false}
119
  />
120
 
121
+ <!-- Static Enemy Platform (always visible) -->
122
+ <img
123
+ class="platform enemy-platform"
124
+ src="/assets/grass.PNG"
125
+ alt="Platform"
126
+ on:error={(e) => {
127
+ const target = e.currentTarget as HTMLImageElement;
128
+ const nextSibling = target.nextElementSibling as HTMLElement;
129
+ target.style.display = 'none';
130
+ if (nextSibling) nextSibling.style.display = 'block';
131
+ }}
132
+ />
133
+ <div class="platform-fallback enemy-platform-fallback" style="display: none;"></div>
134
+
135
  {#if enemyVisible}
136
  <div class="enemy-piclet-wrapper" class:animate-in={showIntro} class:lunge={enemyLunge}>
137
  <!-- Enemy Battle Effects wrap the image for flicker animation -->
 
147
  />
148
  </BattleEffects>
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  <!-- Enemy Status Effects -->
151
  {#if battleState?.opponentPiclet?.statusEffects}
152
  <div class="enemy-status-effects">
 
163
  <!-- Player Row -->
164
  <div class="player-row">
165
  <div class="player-stack" class:intro-animations={showIntro}>
166
+
167
+ <!-- Static Player Platform (always visible) -->
168
+ <img
169
+ class="platform player-platform"
170
+ src="/assets/grass.PNG"
171
+ alt="Platform"
172
+ on:error={(e) => {
173
+ const target = e.currentTarget as HTMLImageElement;
174
+ const nextSibling = target.nextElementSibling as HTMLElement;
175
+ target.style.display = 'none';
176
+ if (nextSibling) nextSibling.style.display = 'block';
177
+ }}
178
+ />
179
+ <div class="platform-fallback player-platform-fallback" style="display: none;"></div>
180
+
181
  {#if playerVisible}
182
  <div class="player-piclet-wrapper" class:animate-in={showIntro} class:lunge={playerLunge}>
183
  <!-- Player Battle Effects wrap the image for flicker animation -->
 
193
  />
194
  </BattleEffects>
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  <!-- Player Status Effects -->
197
  {#if battleState?.playerPiclet?.statusEffects}
198
  <div class="player-status-effects">
 
312
  height: 160px;
313
  position: absolute;
314
  bottom: -60px;
315
+ right: 20px; /* Align with enemy-piclet-wrapper position */
316
  z-index: 0;
317
  object-fit: cover;
318
  }
 
348
  height: 160px;
349
  position: absolute;
350
  bottom: -80px;
351
+ left: 20px; /* Align with player-piclet-wrapper position */
352
  z-index: 0;
353
  object-fit: cover;
354
  }
 
363
  .enemy-platform-fallback {
364
  width: 160px;
365
  height: 160px;
366
+ bottom: -60px;
367
+ right: 20px;
368
  }
369
 
370
  .player-platform-fallback {
371
  width: 160px;
372
  height: 160px;
373
  bottom: -80px;
374
+ left: 20px;
375
  }
376
 
377
  /* Piclet images */