SES-124 display component, small changes

This commit is contained in:
Natalia Gawron 2021-01-02 20:36:55 +01:00
parent 03366a3540
commit 9781b5da1f
5 changed files with 29 additions and 3 deletions

View File

@ -8,7 +8,7 @@
{{ability.name}} {{ability.name}}
<div *ngIf="ability.canSaveThrows" class="diagonal-line" style="margin-left: auto"></div> <div *ngIf="ability.canSaveThrows" class="diagonal-line" style="margin-left: auto"></div>
<div *ngIf="ability.canSaveThrows" style="margin-right: 10px"> <div *ngIf="ability.canSaveThrows" style="margin-right: 10px">
ST: {{ability.savingthrows > 0? '+' + ability.savingthrows : '-' + ability.savingthrows}} ST: {{ability.savingThrows > 0? '+' + ability.savingThrows : '-' + ability.savingThrows}}
</div> </div>
</mat-card-header> </mat-card-header>
<mat-divider [style.border-top-color]="'black'"></mat-divider> <mat-divider [style.border-top-color]="'black'"></mat-divider>

View File

@ -35,3 +35,10 @@
.mat-list-item.active{ .mat-list-item.active{
color: #e9cca7; color: #e9cca7;
} }
.ability_card_container {
margin: 5%;
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -52,6 +52,8 @@
</mat-nav-list> </mat-nav-list>
</mat-sidenav> </mat-sidenav>
<mat-sidenav-content class="content">Main content</mat-sidenav-content> <mat-sidenav-content class="content">
<app-ability-card class="ability_card_container" [ability]="ability" [contentStyle]="{bgColor: 'red', textColor: 'white'}" [headStyle]="{bgColor: 'red', textColor: 'white'}"></app-ability-card>
</mat-sidenav-content>
</mat-sidenav-container> </mat-sidenav-container>
</div> </div>

View File

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {AbilityViewModel} from "../../../types/viewmodels/ability-viewmodels/AbilityViewModel";
@Component({ @Component({
selector: 'app-player-dashboard', selector: 'app-player-dashboard',
@ -9,6 +10,22 @@ export class PlayerDashboardComponent {
isExpanded = false; isExpanded = false;
selected = false; selected = false;
ability: AbilityViewModel = {
id: 1,
name: 'Strength',
value: 18,
modification: 2,
canSaveThrows: true,
savingThrows: 1,
skills: [
{
name: 'Throw',
value: 1,
can: false
}
]
}
collapse() { collapse() {
this.isExpanded = false; this.isExpanded = false;
} }

View File

@ -5,7 +5,7 @@ export interface AbilityViewModel {
name: string; name: string;
value: number; value: number;
modification: number; modification: number;
savingthrows: number; savingThrows: number;
canSaveThrows: boolean; canSaveThrows: boolean;
skills: SkillViewModel[]; skills: SkillViewModel[];
} }