From 1698b66f435f95622e98eaac90989632ea9ff5c8 Mon Sep 17 00:00:00 2001 From: Gawron Date: Sat, 19 Dec 2020 22:31:38 +0100 Subject: [PATCH] added basic mock select character component --- .../ClientApp/src/app.routing.ts | 6 ++ .../ClientApp/src/app/app.module.ts | 4 +- .../select-character.component.css | 75 +++++++++++++++++++ .../select-character.component.html | 21 ++++++ .../select-character.component.ts | 30 ++++++++ .../SessionCompanion/ClientApp/src/styles.css | 8 ++ 6 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app.routing.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app.routing.ts index a2f9ceb..5fe70f9 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app.routing.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app.routing.ts @@ -4,6 +4,7 @@ import { SignInComponent } from './app/components/sign-in/sign-in.component'; import { RegistrationComponent } from './app/components/registration/registration.component'; import {GameMasterDashboardComponent} from './app/components/game-master-dashboard/game-master-dashboard.component'; import {PlayerDashboardComponent} from './app/components/player-dashboard/player-dashboard.component'; +import { SelectCharacterComponent } from './app/components/select-character/select-character.component'; const routes: Routes = [ { @@ -30,6 +31,11 @@ const routes: Routes = [ path: 'player', component: PlayerDashboardComponent, pathMatch: 'full' + }, + { + path: 'select-character', + component: SelectCharacterComponent, + pathMatch: 'full' } ]; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index c0eccab..65581ca 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -10,6 +10,7 @@ import { SignInComponent } from './components/sign-in/sign-in.component'; import { RegistrationComponent } from './components/registration/registration.component'; import { GameMasterDashboardComponent} from './components/game-master-dashboard/game-master-dashboard.component'; import {PlayerDashboardComponent} from './components/player-dashboard/player-dashboard.component'; +import { SelectCharacterComponent } from './components/select-character/select-character.component'; import { MatCardModule, MatTabsModule, @@ -28,7 +29,8 @@ import {UserService} from '../services/user.service'; SignInComponent, RegistrationComponent, GameMasterDashboardComponent, - PlayerDashboardComponent + PlayerDashboardComponent, + SelectCharacterComponent, ], imports: [ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css new file mode 100644 index 0000000..ccf116c --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css @@ -0,0 +1,75 @@ +@import "../../../styles.css"; +mat-form-field { + color: #df7c0f; +} + +:host { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +input { + min-width: 150px; + max-width: 500px; + width: 100%; +} + +.container { + margin: 5%; + display: flex; + flex-direction: column; +} +.container h1 { + margin-bottom: 1rem; +} + +.form-container { + padding: 10px; + margin: 5px; +} + +.primary-text { + height: 100px; + color: #df7c0f; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 1%; + margin: 1%; +} + +.header { + font-size: 20px; +} + +.align-to-right { + text-align: right; +} + +@media (max-width: 400px) { + .container { + margin-left: 0%; + width: 300px; + padding-top: 5%; + } +} + +@media (min-width: 401px) { + .container { + margin-left: 1%; + width: 450px; + padding-top: 10%; + } +} + +@media (min-width: 768px) { + .container { + width: 550px; + padding-top: 5%; + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html new file mode 100644 index 0000000..178319d --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html @@ -0,0 +1,21 @@ +
+ arrow_back +
Select character
+ + + Oweja + arrow_forward + + + James + arrow_forward + + + Legolas + arrow_forward + + + + +
+ diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts new file mode 100644 index 0000000..2409f57 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts @@ -0,0 +1,30 @@ +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-select-character', + templateUrl: './select-character.component.html', + styleUrls: ['./select-character.component.css'] +}) +export class SelectCharacterComponent { + isExpanded = false; + + collapse() { + this.isExpanded = false; + } + + toggle() { + this.isExpanded = !this.isExpanded; + } + + constructor(private router: Router) {} + + onCharacterClick(){ + this.router.navigate(['player']) + } + + onArrowBackClick(){ + this.router.navigate(['login']) + } +} + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css index 5fcfd4a..86e75ab 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css @@ -57,6 +57,14 @@ background-color: #df7c0f !important; } +::ng-deep mat-list-item { + color: #df7c0f !important; +} + +mat-divider { + border-top-color: #e9cca7 !important; +} + html, body { height: 100%;