Skip to content

Commit

Permalink
feat(ui): add background-art component to make it easier to update wh…
Browse files Browse the repository at this point in the history
…en it happens
  • Loading branch information
seiyria committed Jun 25, 2023
1 parent d91848c commit 85a52db
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ion-img
[src]="'https://assets.ateoat.com/assets/backgrounds/' + sprite + '.webp'"
></ion-img>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component, Input, OnInit } from '@angular/core';

@Component({
selector: 'app-background-art',
templateUrl: './background-art.component.html',
styleUrls: ['./background-art.component.scss'],
})
export class BackgroundArtComponent implements OnInit {
@Input({ required: true }) sprite!: string;

constructor() {}

ngOnInit() {}
}
6 changes: 3 additions & 3 deletions client/src/app/pages/collections/collections.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@
class="collect-col"
*ngFor="let background of allBackgrounds; trackBy: trackBy"
>
<ion-img
<app-background-art
[class.uncollected]="!discoveries.backgrounds?.[background]"
[src]="'https://assets.ateoat.com/assets/backgrounds/' + background.toString().padStart(4, '0') + '.webp'"
></ion-img>
[sprite]="background.toString().padStart(4, '0')"
></app-background-art>
</ion-col>
</ion-row>
</div>
Expand Down
6 changes: 3 additions & 3 deletions client/src/app/pages/town/town.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

<ion-card class="location-card" *ngIf="locationInfo">
<div class="image-container">
<ion-img
[src]="'https://assets.ateoat.com/assets/backgrounds/' + locationInfo.background + '.webp'"
></ion-img>
<app-background-art
[sprite]="locationInfo.background"
></app-background-art>
</div>

<ion-card-content>
Expand Down
2 changes: 2 additions & 0 deletions client/src/app/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { AvatarComponent } from '@components/avatar/avatar.component';
import { BackgroundArtComponent } from '@components/background-art/background-art.component';
import { CardOnlineUsersComponent } from '@components/card-online-users/card-online-users.component';
import { HeaderBarComponent } from '@components/header-bar/header-bar.component';
import { HeroComponent } from '@components/hero/hero.component';
Expand All @@ -28,6 +29,7 @@ const components = [
ItemRarityComponent,
ItemStatsComponent,
ItemElementsComponent,
BackgroundArtComponent,
RelativeTimePipe,
];

Expand Down

0 comments on commit 85a52db

Please sign in to comment.