diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 29d4a9b..d829109 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -26,6 +26,7 @@ import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import {environment} from '../environments/environment'; import {reducers} from './store/models/app-state.model'; import {CharacterService} from '../services/character.service'; +import { AbilityCardComponent } from './components/ability-card/ability-card.component'; @NgModule({ declarations: [ @@ -36,6 +37,7 @@ import {CharacterService} from '../services/character.service'; GameMasterDashboardComponent, PlayerDashboardComponent, SelectCharacterComponent, + AbilityCardComponent, ], imports: [ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css new file mode 100644 index 0000000..d728057 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css @@ -0,0 +1,31 @@ +#main{ + width: 480px; + height: 480px; +} +#main>.mat-card{ + padding: 0; +} +.diagonal-line{ + width:50px; + background:linear-gradient(45deg,rgb(16 32 40 / 0%) 49%,black,#ffffff00 51%); +} +#ability-card-content{ + display: flex; + flex-wrap: wrap; + justify-content: space-around; + padding-top: 10px; + padding-bottom: 10px; +} +#skill-btn{ + border-color: black; + flex: 1 0 auto; + margin-bottom: 10px; + margin-left: 10px; + margin-right: 10px; +} +#skill-btn-divider{ + border-left: black 1px solid; + padding-right: 10px; + padding-top: 10px; + padding-bottom: 10px; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html new file mode 100644 index 0000000..376fea9 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html @@ -0,0 +1,24 @@ +
+ + + {{ability.value}} +
+ Mod: {{ability.modification > 0? '+' + ability.modification : '-' + ability.modification}} +
+ {{ability.name}} +
+
+ ST: {{ability.savingThrows > 0? '+' + ability.savingThrows : '-' + ability.savingThrows}} +
+
+ + + + {{skill.name}} +     + + {{skill.value > 0? '+' + skill.value : '-' + skill.value}} + + +
+
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts new file mode 100644 index 0000000..f525ccd --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts @@ -0,0 +1,19 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { AbilityViewModel } from '../../../types/viewmodels/ability-viewmodels/AbilityViewModel'; + +@Component({ + selector: 'app-ability-card', + templateUrl: './ability-card.component.html', + styleUrls: ['./ability-card.component.css'], +}) +export class AbilityCardComponent implements OnInit { + @Input() ability: AbilityViewModel; + @Input() headStyle: { bgColor: string; textColor: string }; + @Input() contentStyle: { bgColor: string; textColor: string }; + + constructor() {} + + ngOnInit() { + this.ability.skills.sort((a, b) => (a.name > b.name ? 1 : -1)); + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css index cc4b1d7..544e80b 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css @@ -35,3 +35,10 @@ .mat-list-item.active{ color: #e9cca7; } + +.ability_card_container { + margin: 5%; + display: flex; + justify-content: center; + align-items: center; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html index 5777963..994aab5 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html @@ -52,6 +52,8 @@ - Main content + + + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts index 3b42801..91157af 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts @@ -1,14 +1,31 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import {AbilityViewModel} from "../../../types/viewmodels/ability-viewmodels/AbilityViewModel"; @Component({ selector: 'app-player-dashboard', templateUrl: './player-dashboard.component.html', - styleUrls: ['./player-dashboard.component.css'] + styleUrls: ['./player-dashboard.component.css'], }) 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; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts index e3537d1..3faceea 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts @@ -10,5 +10,5 @@ export enum scIcon { rogue = 'rogue', Sorcerer = 'sorcerer', Warlock = 'warlock', - Wizard = 'wizard' + Wizard = 'wizard', } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css index 311e04a..cbfb6da 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css @@ -70,7 +70,7 @@ } mat-divider { - border-top-color: #e9cca7 !important; + border-top-color: #e9cca7; } .arrow-select { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts new file mode 100644 index 0000000..8c4fb29 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts @@ -0,0 +1,11 @@ +import {SkillViewModel} from './SkillViewModel'; + +export interface AbilityViewModel { + id: number; + name: string; + value: number; + modification: number; + savingThrows: number; + canSaveThrows: boolean; + skills: SkillViewModel[]; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/SkillViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/SkillViewModel.ts new file mode 100644 index 0000000..94418d4 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/SkillViewModel.ts @@ -0,0 +1,5 @@ +export interface SkillViewModel { + name: string; + value: number; + can: boolean; +}