fix health heart animation (#389)

This commit is contained in:
saml33 2022-08-05 03:41:31 +10:00 committed by GitHub
parent d2d9f84629
commit 5daa16f528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,7 @@ const HealthHeart = ({ health, size }: { health: number; size: number }) => {
className={
health > 15 && health < 50
? 'text-th-orange'
: health > 50
: health >= 50
? 'text-th-green'
: 'text-th-red'
}
@ -29,13 +29,17 @@ const HealthHeart = ({ health, size }: { health: number; size: number }) => {
type="scale"
keyTimes="0;0.5;1"
values="1;1.1;1"
dur={health > 15 && health < 50 ? '1s' : health > 50 ? '2s' : '0.33s'}
dur={
health > 15 && health < 50 ? '1s' : health >= 50 ? '2s' : '0.33s'
}
repeatCount="indefinite"
/>
<animate
attributeName="opacity"
values="0.8;1;0.8"
dur={health > 15 && health < 50 ? '1s' : health > 50 ? '2s' : '0.33s'}
dur={
health > 15 && health < 50 ? '1s' : health >= 50 ? '2s' : '0.33s'
}
repeatCount="indefinite"
/>
</g>