Skip to content

Commit

Permalink
fix: styles (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmbanan666 authored Jan 10, 2025
1 parent 26eedca commit f2f778d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 36 deletions.
26 changes: 3 additions & 23 deletions apps/website/app/pages/(games)/wagon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<div class="cards">
<img src="/qr.png" alt="qr" width="150" class="qr">

<div class="hidden wagon-card event">
<div class="hidden wagon-card event px-3 py-2 gap-3">
<Image src="/units/santa/head.png" width="44" />
<p class="title">
<p class="max-w-40 text-xl font-semibold leading-1">
Рождественский переполох
</p>
</div>

<div class="hidden top-players">
<div class="top-players hidden gap-2">
<div v-for="member in leaderboard?.members" :key="member.id" class="card">
<p>{{ member.profile.telegramProfile.firstName }}</p>
<div class="points">
Expand Down Expand Up @@ -131,31 +131,11 @@ onMounted(async () => {
font-size: 32px;
}
.hidden {
display: none;
}
.distance {
font-size: 48px;
}
.event {
padding: 8px 12px;
display: flex;
gap: 12px;
.title {
font-size: 20px;
font-weight: 600;
max-width: 160px;
line-height: 1.05;
}
}
.top-players {
display: flex;
gap: 8px;
.card {
padding: 6px 10px;
min-width: 130px;
Expand Down
34 changes: 21 additions & 13 deletions packages/game/src/lib/objects/unit/unitObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,27 @@ export class UnitObject extends BaseObject implements GameObjectUnit {
this.animationMoving = undefined
}

const idle = await Assets.load(`https://storage.yandexcloud.net/chatgame-assets/units/${codename}/idle.json`)
const idleSprite = new AnimatedSprite(idle.animations.main)
idleSprite.anchor.set(0.5, 1)
idleSprite.scale.set(4)
this.animationIdle = idleSprite
this.addChild(this.animationIdle)

const moving = await Assets.load(`https://storage.yandexcloud.net/chatgame-assets/units/${codename}/moving.json`)
const movingSprite = new AnimatedSprite(moving.animations.main)
movingSprite.anchor.set(0.5, 1)
movingSprite.scale.set(4)
this.animationMoving = movingSprite
this.addChild(this.animationMoving)
try {
const idle = await Assets.load(`https://storage.yandexcloud.net/chatgame-assets/units/${codename}/idle.json`)
const idleSprite = new AnimatedSprite(idle.animations.main)
idleSprite.anchor.set(0.5, 1)
idleSprite.scale.set(4)
this.animationIdle = idleSprite
this.addChild(this.animationIdle)
} catch (error) {
console.error('Error loading idle animation:', error)
}

try {
const moving = await Assets.load(`https://storage.yandexcloud.net/chatgame-assets/units/${codename}/moving.json`)
const movingSprite = new AnimatedSprite(moving.animations.main)
movingSprite.anchor.set(0.5, 1)
movingSprite.scale.set(4)
this.animationMoving = movingSprite
this.addChild(this.animationMoving)
} catch (error) {
console.error('Error loading moving animation:', error)
}
}

addMessage(message: string): void {
Expand Down

0 comments on commit f2f778d

Please sign in to comment.