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}}
<div *ngIf="ability.canSaveThrows" class="diagonal-line" style="margin-left: auto"></div>
<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>
</mat-card-header>
<mat-divider [style.border-top-color]="'black'"></mat-divider>

View File

@ -35,3 +35,10 @@
.mat-list-item.active{
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-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>
</div>

View File

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import {AbilityViewModel} from "../../../types/viewmodels/ability-viewmodels/AbilityViewModel";
@Component({
selector: 'app-player-dashboard',
@ -9,6 +10,22 @@ export class PlayerDashboardComponent {
isExpanded = 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() {
this.isExpanded = false;
}

View File

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