-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from arongida/development
UI improvements, fix duplicate fight bug
- Loading branch information
Showing
8 changed files
with
102 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
src/app/draft/components/draft-menu/draft-menu.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
<div class="fixed-button"> | ||
<button mat-raised-button color="warn" (click)="startFight()"> | ||
<button [disabled]="loading" mat-raised-button color="warn" (click)="startFight()"> | ||
@if (loading) { | ||
Loading... | ||
} @else { | ||
Ready to Chungus! | ||
} | ||
</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
::ng-deep .item-tooltip { | ||
white-space: pre-line; | ||
} | ||
|
||
#refresh-button { | ||
position: fixed; | ||
left: 50%; | ||
transform: translate(-50%); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,66 @@ | ||
<div | ||
id="shop" | ||
class="grid-cols-3 grid-rows-2 gap-1 grid max-w-fit bg-cover bg-center p-4 border-4 border-black" | ||
[style.background-image]=" | ||
<div id="shop" class="relative"> | ||
<div class="grid-cols-3 grid-rows-2 gap-1 grid max-w-fit bg-cover bg-center p-4 border-4 border-black" | ||
[style.background-image]=" | ||
'url(https://chungus-battles.b-cdn.net/chungus-battles-assets/Chungus_table_01.png)' | ||
" | ||
> | ||
@for (item of shop; track $index) { | ||
<mat-card | ||
[style.background-image]="'url(' + getItemImage(item) + ')'" | ||
id="item-{{ $index }}" | ||
"> | ||
@for (item of shop; track $index) { | ||
<mat-card [style.background-image]="'url(' + getItemImage(item) + ')'" id="item-{{ $index }}" | ||
class="w-60 h-80 items-center rounded-lg shadow-lg transform transition-transform scale-75 hover:scale-90" | ||
(mouseenter)="onMouseEnterItem(item)" | ||
(mouseleave)="onMouseLeaveItem(item)" | ||
> | ||
(mouseenter)="onMouseEnterItem(item)" (mouseleave)="onMouseLeaveItem(item)"> | ||
<mat-card-header class="mb-5 text-center mt-2"> | ||
<mat-card-title>{{ item.name }}</mat-card-title> | ||
<mat-card-title>{{ item.name | titlecase }}</mat-card-title> | ||
</mat-card-header> | ||
|
||
@if (item.showDetails) { | ||
<mat-card-content | ||
class="flex flex-col flex-1 text-center text-white p-1 rounded-b-lg content-evenly" | ||
> | ||
<div class="mb-2"> | ||
<p class="font-semibold"> | ||
Price: <span class="text-yellow-300">{{ item.price }} 🪙</span> | ||
</p> | ||
</div> | ||
<div class="grid grid-cols-2 gap-1 text-xs"> | ||
<p> | ||
Attack: | ||
<span class="text-red-500" | ||
>{{ item.affectedStats.attack }} ⚔️</span | ||
> | ||
</p> | ||
<p> | ||
A.speed: | ||
<span class="text-blue-500" | ||
>{{ item.affectedStats.attackSpeed }} ⏩</span | ||
> | ||
</p> | ||
<p> | ||
Defense: | ||
<span class="text-green-500" | ||
>{{ item.affectedStats.defense }} 🛡️</span | ||
> | ||
</p> | ||
<p> | ||
Health: | ||
<span class="text-pink-500">{{ item.affectedStats.hp }} ❤️</span> | ||
</p> | ||
</div> | ||
<div class="ml-2 mr-2"> | ||
<p class="font-thin text-sm">{{ item.description }}</p> | ||
@for (tag of item.tags; track $index) { | ||
<mat-chip class="mr-1 py-1">{{ tag }}</mat-chip> | ||
} | ||
</div> | ||
</mat-card-content> | ||
<mat-card-footer class="flex justify-center"> | ||
<div class="mt-auto"> | ||
<button | ||
id="buy-{{ $index }}" | ||
mat-raised-button | ||
color="warn" | ||
(click)="draftService.sendMessage('buy', { itemId: item.itemId })" | ||
> | ||
Buy | ||
</button> | ||
</div> | ||
</mat-card-footer> | ||
<mat-card-content class="flex flex-col flex-1 text-center text-white p-1 rounded-b-lg content-evenly"> | ||
<div class="mb-2"> | ||
<p class="font-semibold"> | ||
Price: <span class="text-yellow-300">{{ item.price }} 🪙</span> | ||
</p> | ||
</div> | ||
<div class="grid grid-cols-2 gap-1 text-xs"> | ||
<p> | ||
Attack: | ||
<span class="text-red-500">{{ item.affectedStats.attack }} ⚔️</span> | ||
</p> | ||
<p> | ||
A.speed: | ||
<span class="text-blue-500">{{ item.affectedStats.attackSpeed }} ⏩</span> | ||
</p> | ||
<p> | ||
Defense: | ||
<span class="text-green-500">{{ item.affectedStats.defense }} 🛡️</span> | ||
</p> | ||
<p> | ||
Health: | ||
<span class="text-pink-500">{{ item.affectedStats.hp }} ❤️</span> | ||
</p> | ||
</div> | ||
<div class="ml-2 mr-2"> | ||
<p class="font-thin text-sm">{{ item.description }}</p> | ||
@for (tag of item.tags; track $index) { | ||
<mat-chip class="mr-1 py-1">{{ tag }}</mat-chip> | ||
} | ||
</div> | ||
</mat-card-content> | ||
<mat-card-footer class="flex justify-center"> | ||
<div class="mt-auto"> | ||
<button id="buy-{{ $index }}" mat-raised-button color="warn" | ||
(click)="draftService.sendMessage('buy', { itemId: item.itemId })"> | ||
Buy | ||
</button> | ||
</div> | ||
</mat-card-footer> | ||
} | ||
</mat-card> | ||
} | ||
<div class="min-w-full flex-1 justify-center"> | ||
<button | ||
id="refresh-button" | ||
#tooltip="matTooltip" | ||
matTooltip="2 gold" | ||
matTooltipHideDelay="1000" | ||
mat-raised-button | ||
matTooltipPosition="right" | ||
color="primary" | ||
class="fixed bottom-0 m-7 p-7" | ||
(click)="draftService.sendMessage('refresh_shop', {})" | ||
> | ||
Refresh shop<mat-icon>refresh</mat-icon> | ||
} | ||
</div> | ||
<div class="absolute top-0 right-0 flex-row-reverse"> | ||
<button id="refresh-button" #tooltip="matTooltip" matTooltip="2 gold" mat-stroked-button | ||
matTooltipPosition="right" color="text-white" class="m-2 p-2 flex-1" | ||
(click)="draftService.sendMessage('refresh_shop', {})" (mouseenter)="hoverRefreshButton()" | ||
(mouseleave)="leaveRefreshButton()"> | ||
Refresh shop<mat-icon [ngClass]="{'animate-spin': hoverRefresh}">refresh</mat-icon> | ||
</button> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters