Compare commits
No commits in common. "5449cd7714a5ecd073305cad67a37274a439525d" and "080fa80f03023abc6703e92d65ce3dfca9ad6933" have entirely different histories.
5449cd7714
...
080fa80f03
|
@ -8,8 +8,7 @@ import {StatsComponent} from './pages/stats/stats.component';
|
||||||
import {GamenightComponent} from './pages/gamenight/gamenight.component';
|
import {GamenightComponent} from './pages/gamenight/gamenight.component';
|
||||||
import {HeaderComponent} from './components/header/header.component';
|
import {HeaderComponent} from './components/header/header.component';
|
||||||
import {ProfileComponent} from './components/profile/profile.component';
|
import {ProfileComponent} from './components/profile/profile.component';
|
||||||
import {AddGameComponent} from './components/add-game/add-game.component';
|
import { MatchHistoryComponent } from './pages/match-history/match-history.component';
|
||||||
import {MatchHistoryComponent} from './pages/match-history/match-history.component';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
@ -19,8 +18,7 @@ import {MatchHistoryComponent} from './pages/match-history/match-history.compone
|
||||||
GamenightComponent,
|
GamenightComponent,
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
ProfileComponent,
|
ProfileComponent,
|
||||||
AddGameComponent,
|
MatchHistoryComponent
|
||||||
MatchHistoryComponent
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
<app-header></app-header>
|
|
||||||
<div id="add-game">
|
|
||||||
<div id="game-infos">
|
|
||||||
<!-- The following divs get displayed one after another, kinda wizard-like -->
|
|
||||||
<div id="which-players" class="visible-{{this.currentPage === 0}}">
|
|
||||||
<div class="active-{{isPlayerActive(player)}}" *ngFor="let player of potentialPlayers" (click)="togglePlayer(player)">{{player.firstName}}</div>
|
|
||||||
<p id="player-amount-warn" *ngIf="not4Players()">Illegal amount of players!</p>
|
|
||||||
<button (click)="switchToNextPage()">Next</button>
|
|
||||||
</div>
|
|
||||||
<div id="announcements" class="visible-{{this.currentPage === 1}}">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="player-teams" class="visible-{{this.currentPage === 2}}">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="player-points" class="visible-{{this.currentPage === 3}}">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="which-solo" class="visible-{{this.currentPage === 4}}">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="extra-points" class="visible-{{this.currentPage === 5}}">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="scores">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -1,33 +0,0 @@
|
||||||
@import '../../../styles';
|
|
||||||
|
|
||||||
#add-game {
|
|
||||||
padding-top: $header_height;
|
|
||||||
}
|
|
||||||
|
|
||||||
#which-players div {
|
|
||||||
padding: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#which-players div:hover {
|
|
||||||
color: $text;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active-true {
|
|
||||||
color: $active;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active-false {
|
|
||||||
color: $inactive;
|
|
||||||
}
|
|
||||||
|
|
||||||
#player-amount-warn {
|
|
||||||
color: $warn;
|
|
||||||
}
|
|
||||||
|
|
||||||
.visible-false {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.visible-true {
|
|
||||||
display: inherit;
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { AddGameComponent } from './add-game.component';
|
|
||||||
|
|
||||||
describe('AddGameComponent', () => {
|
|
||||||
let component: AddGameComponent;
|
|
||||||
let fixture: ComponentFixture<AddGameComponent>;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
await TestBed.configureTestingModule({
|
|
||||||
declarations: [ AddGameComponent ]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(AddGameComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,83 +0,0 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
|
||||||
import {Player} from '../../models/doppelkopf/player';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-add-game',
|
|
||||||
templateUrl: './add-game.component.html',
|
|
||||||
styleUrls: ['./add-game.component.scss']
|
|
||||||
})
|
|
||||||
export class AddGameComponent implements OnInit {
|
|
||||||
potentialPlayers: Player[] = [];
|
|
||||||
actualPlayers: Player[] = [];
|
|
||||||
|
|
||||||
currentPage: number = 0;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.potentialPlayers.push({
|
|
||||||
firebonkId: 1,
|
|
||||||
uuid: 'abc-def-ghi-j',
|
|
||||||
firstName: 'Patrick'
|
|
||||||
});
|
|
||||||
this.potentialPlayers.push({
|
|
||||||
firebonkId: 2,
|
|
||||||
uuid: 'abc-def-ghi-k',
|
|
||||||
firstName: 'Julian'
|
|
||||||
});
|
|
||||||
this.potentialPlayers.push({
|
|
||||||
firebonkId: 3,
|
|
||||||
uuid: 'abc-def-ghi-l',
|
|
||||||
firstName: 'Yannick'
|
|
||||||
});
|
|
||||||
this.potentialPlayers.push({
|
|
||||||
firebonkId: 4,
|
|
||||||
uuid: 'abc-def-ghi-m',
|
|
||||||
firstName: 'Janina'
|
|
||||||
});
|
|
||||||
this.potentialPlayers.push({
|
|
||||||
firebonkId: 5,
|
|
||||||
uuid: 'abc-def-ghi-n',
|
|
||||||
firstName: 'Moritz'
|
|
||||||
});
|
|
||||||
|
|
||||||
this.actualPlayers.push(...this.potentialPlayers.slice(0,4));
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Toggles if the given player is should be an active player for the current game
|
|
||||||
* @param player The player to toggle the activity for
|
|
||||||
*/
|
|
||||||
togglePlayer(player: Player): void {
|
|
||||||
let index = this.actualPlayers.indexOf(player);
|
|
||||||
if(index !== -1){
|
|
||||||
this.actualPlayers.splice(index, 1);
|
|
||||||
} else {
|
|
||||||
this.actualPlayers.push(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks, if the given player is currently marked as active for this game
|
|
||||||
* @param player The player to check the activity status for
|
|
||||||
* @returns boolean If the player is active
|
|
||||||
*/
|
|
||||||
isPlayerActive(player: Player): boolean {
|
|
||||||
return this.actualPlayers.indexOf(player) !== -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns, if the amount of currently active players is greater or less than 4
|
|
||||||
*/
|
|
||||||
not4Players() {
|
|
||||||
return this.actualPlayers.length !== 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Switches the entry mask UI to the next page
|
|
||||||
*/
|
|
||||||
switchToNextPage(): void {
|
|
||||||
this.currentPage++;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -33,7 +33,7 @@ export class HeaderComponent implements OnInit {
|
||||||
return this.user ? this.user.firstName : 'Logged out';
|
return this.user ? this.user.firstName : 'Logged out';
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(path: string): void {
|
navigate(path: String): void {
|
||||||
this.router.navigate([path]);
|
this.router.navigate([path]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,5 +35,4 @@ export class ProfileComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Close modal also when "escape" is clicked
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
export enum Announcement {
|
export enum Announcement {
|
||||||
RE = 0,
|
RE = 0,
|
||||||
CONTRA = 1,
|
KONTRA = 1,
|
||||||
RE_NO_NINETY = 2.1,
|
NO_NINETY = 2,
|
||||||
CONTRA_NO_NINETY = 2.2,
|
NO_SIXTY = 3,
|
||||||
RE_NO_SIXTY = 3.1,
|
NO_THIRTY = 4
|
||||||
CONTRA_NO_SIXTY = 3.2,
|
|
||||||
RE_NO_THIRTY = 4.1,
|
|
||||||
CONTRA_NO_THIRTY = 4.2
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@ export interface Player {
|
||||||
firebonkId: number;
|
firebonkId: number;
|
||||||
uuid: string;
|
uuid: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
finalCardScore?: number;
|
finalCardScore: number;
|
||||||
gamePoints?: number;
|
gamePoints: number;
|
||||||
hadMarriage?: boolean;
|
hadMarriage: boolean;
|
||||||
hadTrumpHandoff?: boolean;
|
hadTrumpHandoff: boolean;
|
||||||
team?: Team;
|
team: Team;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,6 @@ $primary: #050533;
|
||||||
$secondary: #0D698B;
|
$secondary: #0D698B;
|
||||||
$text: #F2F1E8;
|
$text: #F2F1E8;
|
||||||
$accent: #E34234;
|
$accent: #E34234;
|
||||||
$active: green;
|
|
||||||
$inactive: red;
|
|
||||||
$warn: orange;
|
|
||||||
|
|
||||||
/* Global vars */
|
/* Global vars */
|
||||||
$header_height: 3em;
|
$header_height: 3em;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user