Skip to content

Commit

Permalink
Merge pull request #6 from arongida/development
Browse files Browse the repository at this point in the history
add default image to items
  • Loading branch information
arongida committed May 17, 2024
2 parents c18bedd + 2d0b292 commit 00341ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/draft/components/shop/shop.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@if (shop.length > 0) {
<div id="shop" class="grid-cols-3 grid-rows-2 gap-5 grid max-w-fit bg-slate-600 rounded-md p-4">
@for (item of shop; track $index) {
<mat-card style="background-image: url({{item.image}});" #tooltip="matTooltip" [matTooltip]="getTooltip(item)"
<mat-card [style.background-image]="'url(' + getItemImage(item) + ')'" #tooltip="matTooltip" [matTooltip]="getTooltip(item)"
matTooltipClass="item-tooltip" matTooltipPosition="right" id="item-{{$index}}"
class="m-2 w-60 h-80 items-center flex flex-col justify-between" (click)="toggleBuyButton($index.toString())">
<mat-card-header class="mb-5">
Expand Down
6 changes: 5 additions & 1 deletion src/app/draft/components/shop/shop.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ export class ShopComponent {
Health: ${item.affectedStats.hp}
Attack Speed: ${item.affectedStats.attackSpeed}
Level: ${item.levelRequirement}
Description: ${item.description}`;
return tooltip;
}

getItemImage(item: Item): string {
return item.image ? item.image : 'https://chungus-battles.b-cdn.net/chungus-battles-assets/Item_ID_21_Cloak_of_Invisibility.png';
}

}

0 comments on commit 00341ca

Please sign in to comment.