Compare commits
4 Commits
feat/rotat
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66fff4ee07 | ||
|
|
8493e742e9 | ||
|
|
2999d8eee7 | ||
|
|
c4a2307530 |
@@ -3,8 +3,8 @@
|
|||||||
</main>
|
</main>
|
||||||
<nav>
|
<nav>
|
||||||
<ul ngbNav [activeId]="route.fragment | async" class="nav-tabs custom-navbar bg-body-secondary">
|
<ul ngbNav [activeId]="route.fragment | async" class="nav-tabs custom-navbar bg-body-secondary">
|
||||||
<li ngbNavItem="/edit" class="custom-navitem"><a ngbNavLink routerLink="/edit" routerLinkActive="active"><i class="bi bi-pencil-square"></i>{{ data.getPlayers().length }}</a></li>
|
<li ngbNavItem="" class="custom-navitem"><a ngbNavLink routerLink="" routerLinkActive="active"><i class="bi bi-pencil-square"></i>{{ data.getPlayers().length }}</a></li>
|
||||||
<li ngbNavItem="/basic" class="custom-navitem"><a ngbNavLink routerLink="/basic" routerLinkActive="active"><i class="bi bi-shuffle"></i></a></li>
|
<li ngbNavItem="/basic.t" class="custom-navitem"><a ngbNavLink routerLink="/basic.t" routerLinkActive="active"><i class="bi bi-shuffle"></i></a></li>
|
||||||
<li ngbNavItem="/rotations" class="custom-navitem"><a ngbNavLink routerLink="/rotations" routerLinkActive="active"><i class="bi bi-arrow-repeat"></i></a></li>
|
<li ngbNavItem="/rotations.t" class="custom-navitem"><a ngbNavLink routerLink="/rotations.t" routerLinkActive="active"><i class="bi bi-arrow-repeat"></i></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -22,7 +22,6 @@ tr{
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.custom-navbar{
|
.custom-navbar{
|
||||||
height: 3rem;
|
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@@ -33,6 +32,4 @@ tr{
|
|||||||
.custom-navitem{
|
.custom-navitem{
|
||||||
text-align: center; /* Center the content of each item */
|
text-align: center; /* Center the content of each item */
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
|
||||||
.nav-link.active{
|
|
||||||
}
|
}
|
||||||
@@ -2,16 +2,14 @@ import { Routes } from '@angular/router';
|
|||||||
import { ScreenBasicComponent } from './screen-basic/screen-basic.component';
|
import { ScreenBasicComponent } from './screen-basic/screen-basic.component';
|
||||||
import { ScreenEditComponent } from './screen-edit/screen-edit.component';
|
import { ScreenEditComponent } from './screen-edit/screen-edit.component';
|
||||||
import { ScreenRotationsComponent } from './screen-rotations/screen-rotations.component';
|
import { ScreenRotationsComponent } from './screen-rotations/screen-rotations.component';
|
||||||
import { AppComponent } from './app.component';
|
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
children: [
|
children: [
|
||||||
{ path: '', redirectTo: 'edit', pathMatch: 'full' },
|
{ path: '', component: ScreenEditComponent },
|
||||||
{ path: 'edit', component: ScreenEditComponent },
|
{ path: 'basic.t', component: ScreenBasicComponent },
|
||||||
{ path: 'basic', component: ScreenBasicComponent },
|
{ path: 'rotations.t', component: ScreenRotationsComponent }
|
||||||
{ path: 'rotations', component: ScreenRotationsComponent }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { Player } from './model';
|
|||||||
})
|
})
|
||||||
export class DataService {
|
export class DataService {
|
||||||
private players: Player[] = [];
|
private players: Player[] = [];
|
||||||
|
teams: Player[][] = [];
|
||||||
|
|
||||||
setPlayers(players: Player[]){
|
setPlayers(players: Player[]){
|
||||||
for (let player of players){
|
for (let player of players){
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class Player{
|
|||||||
return [this.name, values];
|
return [this.name, values];
|
||||||
}
|
}
|
||||||
|
|
||||||
valueOf(): string{
|
toString(): string{
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
static deSerialize(name: string, values: string): Player{
|
static deSerialize(name: string, values: string): Player{
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@for (team of teamsArray; track $index) {
|
@for (team of data.teams; track $index) {
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-wrap: wrap;">{{ team.length | number }}</td>
|
<td style="text-wrap: wrap;">{{ team.length | number }}</td>
|
||||||
<td class="wrap-cell">{{ team }}</td>
|
<td class="wrap-cell">{{ team }}</td>
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export class ScreenBasicComponent {
|
|||||||
numTeamsSelectorValue = "2";
|
numTeamsSelectorValue = "2";
|
||||||
numTeamsSelected = 2;
|
numTeamsSelected = 2;
|
||||||
nTeamsValue = "4";
|
nTeamsValue = "4";
|
||||||
teamsArray: string[][] = [];
|
|
||||||
|
|
||||||
onButtonGenerate(): void{
|
onButtonGenerate(): void{
|
||||||
if(this.numTeamsSelectorValue === 'n'){
|
if(this.numTeamsSelectorValue === 'n'){
|
||||||
@@ -40,10 +39,10 @@ export class ScreenBasicComponent {
|
|||||||
let n = localPlayers[index];
|
let n = localPlayers[index];
|
||||||
localPlayers.splice(index,1);
|
localPlayers.splice(index,1);
|
||||||
let team = iterator.next().value;
|
let team = iterator.next().value;
|
||||||
team.push(n.name);
|
team.push(n);
|
||||||
|
|
||||||
}
|
}
|
||||||
this.teamsArray = teams;
|
this.data.teams = teams;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ html, body {
|
|||||||
body {
|
body {
|
||||||
margin:3em auto;
|
margin:3em auto;
|
||||||
font-family: Roboto, "Helvetica Neue", sans-serif;
|
font-family: Roboto, "Helvetica Neue", sans-serif;
|
||||||
padding:0 .5em;
|
padding:.5em auto;
|
||||||
}
|
}
|
||||||
h1,h2,h3{
|
h1,h2,h3{
|
||||||
line-height:1.2;
|
line-height:1.2;
|
||||||
|
|||||||
Reference in New Issue
Block a user