anim
Browse files
src/lib/components/Battle/BattleField.svelte
CHANGED
|
@@ -28,7 +28,7 @@
|
|
| 28 |
|
| 29 |
setTimeout(() => {
|
| 30 |
playerVisible = true;
|
| 31 |
-
},
|
| 32 |
} else {
|
| 33 |
// Skip intro
|
| 34 |
playerVisible = true;
|
|
@@ -49,7 +49,7 @@
|
|
| 49 |
<div class="battle-content">
|
| 50 |
<!-- Enemy Row -->
|
| 51 |
<div class="enemy-row">
|
| 52 |
-
<div class="enemy-stack">
|
| 53 |
<PicletInfo
|
| 54 |
piclet={enemyPiclet}
|
| 55 |
hpPercentage={enemyHpPercentage}
|
|
@@ -58,7 +58,7 @@
|
|
| 58 |
/>
|
| 59 |
|
| 60 |
{#if enemyVisible}
|
| 61 |
-
<div class="enemy-piclet-wrapper"
|
| 62 |
<img
|
| 63 |
class="piclet-image enemy-image"
|
| 64 |
src={enemyPiclet.imageData || enemyPiclet.imageUrl}
|
|
@@ -84,9 +84,9 @@
|
|
| 84 |
|
| 85 |
<!-- Player Row -->
|
| 86 |
<div class="player-row">
|
| 87 |
-
<div class="player-stack">
|
| 88 |
{#if playerVisible}
|
| 89 |
-
<div class="player-piclet-wrapper"
|
| 90 |
<img
|
| 91 |
class="piclet-image player-image"
|
| 92 |
src={playerPiclet.imageData || playerPiclet.imageUrl}
|
|
@@ -142,6 +142,19 @@
|
|
| 142 |
.trainer-intro img {
|
| 143 |
width: 200px;
|
| 144 |
height: auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
}
|
| 146 |
|
| 147 |
.battle-content {
|
|
@@ -255,6 +268,82 @@
|
|
| 255 |
flex: 1;
|
| 256 |
}
|
| 257 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
@media (max-width: 768px) {
|
| 259 |
.enemy-image {
|
| 260 |
width: 100px;
|
|
|
|
| 28 |
|
| 29 |
setTimeout(() => {
|
| 30 |
playerVisible = true;
|
| 31 |
+
}, 1000);
|
| 32 |
} else {
|
| 33 |
// Skip intro
|
| 34 |
playerVisible = true;
|
|
|
|
| 49 |
<div class="battle-content">
|
| 50 |
<!-- Enemy Row -->
|
| 51 |
<div class="enemy-row">
|
| 52 |
+
<div class="enemy-stack" class:intro-animations={showIntro}>
|
| 53 |
<PicletInfo
|
| 54 |
piclet={enemyPiclet}
|
| 55 |
hpPercentage={enemyHpPercentage}
|
|
|
|
| 58 |
/>
|
| 59 |
|
| 60 |
{#if enemyVisible}
|
| 61 |
+
<div class="enemy-piclet-wrapper" class:animate-in={showIntro}>
|
| 62 |
<img
|
| 63 |
class="piclet-image enemy-image"
|
| 64 |
src={enemyPiclet.imageData || enemyPiclet.imageUrl}
|
|
|
|
| 84 |
|
| 85 |
<!-- Player Row -->
|
| 86 |
<div class="player-row">
|
| 87 |
+
<div class="player-stack" class:intro-animations={showIntro}>
|
| 88 |
{#if playerVisible}
|
| 89 |
+
<div class="player-piclet-wrapper" class:animate-in={showIntro}>
|
| 90 |
<img
|
| 91 |
class="piclet-image player-image"
|
| 92 |
src={playerPiclet.imageData || playerPiclet.imageUrl}
|
|
|
|
| 142 |
.trainer-intro img {
|
| 143 |
width: 200px;
|
| 144 |
height: auto;
|
| 145 |
+
animation: trainerPulse 0.5s ease-in-out;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
@keyframes trainerPulse {
|
| 149 |
+
0% {
|
| 150 |
+
transform: scale(1);
|
| 151 |
+
}
|
| 152 |
+
50% {
|
| 153 |
+
transform: scale(1.05);
|
| 154 |
+
}
|
| 155 |
+
100% {
|
| 156 |
+
transform: scale(1);
|
| 157 |
+
}
|
| 158 |
}
|
| 159 |
|
| 160 |
.battle-content {
|
|
|
|
| 268 |
flex: 1;
|
| 269 |
}
|
| 270 |
|
| 271 |
+
/* Animations */
|
| 272 |
+
.enemy-piclet-wrapper {
|
| 273 |
+
animation-fill-mode: both;
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
.enemy-piclet-wrapper.animate-in {
|
| 277 |
+
animation: enemySlideIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
.player-piclet-wrapper {
|
| 281 |
+
animation-fill-mode: both;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
.player-piclet-wrapper.animate-in {
|
| 285 |
+
animation: playerSlideIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
@keyframes enemySlideIn {
|
| 289 |
+
0% {
|
| 290 |
+
transform: translateX(150px) translateY(-50px) scale(1.5);
|
| 291 |
+
opacity: 0;
|
| 292 |
+
}
|
| 293 |
+
50% {
|
| 294 |
+
opacity: 1;
|
| 295 |
+
}
|
| 296 |
+
100% {
|
| 297 |
+
transform: translateX(0) translateY(0) scale(1);
|
| 298 |
+
opacity: 1;
|
| 299 |
+
}
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
@keyframes playerSlideIn {
|
| 303 |
+
0% {
|
| 304 |
+
transform: translateX(-150px) translateY(50px) scale(0.5);
|
| 305 |
+
opacity: 0;
|
| 306 |
+
}
|
| 307 |
+
50% {
|
| 308 |
+
opacity: 1;
|
| 309 |
+
}
|
| 310 |
+
100% {
|
| 311 |
+
transform: translateX(0) translateY(0) scale(1);
|
| 312 |
+
opacity: 1;
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
/* Info box animations */
|
| 317 |
+
.enemy-stack.intro-animations :global(.piclet-info-wrapper) {
|
| 318 |
+
animation: fadeSlideDown 0.5s ease-out 0.3s both;
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
.player-stack.intro-animations :global(.piclet-info-wrapper) {
|
| 322 |
+
animation: fadeSlideUp 0.5s ease-out 0.3s both;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
@keyframes fadeSlideDown {
|
| 326 |
+
0% {
|
| 327 |
+
opacity: 0;
|
| 328 |
+
transform: translateY(-20px);
|
| 329 |
+
}
|
| 330 |
+
100% {
|
| 331 |
+
opacity: 1;
|
| 332 |
+
transform: translateY(0);
|
| 333 |
+
}
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
@keyframes fadeSlideUp {
|
| 337 |
+
0% {
|
| 338 |
+
opacity: 0;
|
| 339 |
+
transform: translateY(20px);
|
| 340 |
+
}
|
| 341 |
+
100% {
|
| 342 |
+
opacity: 1;
|
| 343 |
+
transform: translateY(0);
|
| 344 |
+
}
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
@media (max-width: 768px) {
|
| 348 |
.enemy-image {
|
| 349 |
width: 100px;
|