12 Commits

Author SHA1 Message Date
eneller
563116331f fix: edit list items 2026-02-01 10:28:19 +01:00
eneller
1946c599be fix: minor misc ui and data 2026-02-01 10:19:16 +01:00
eneller
7c7762515b feat: navbar 2026-01-31 23:03:42 +01:00
eneller
aaa0ab0638 feat: remove players 2026-01-31 21:05:23 +01:00
eneller
4082932095 feat: dataservice 2026-01-31 20:36:49 +01:00
eneller
b6d34ce262 wip: rotations accordion 2026-01-31 17:12:37 +01:00
eneller
764ce43138 refactor: basic screen 2026-01-31 16:29:11 +01:00
eneller
1bc97df0da feat: deduplicated player adding 2026-01-31 15:52:06 +01:00
eneller
5408a8d9b6 central players list 2026-01-31 00:37:32 +01:00
eneller
665cb25d34 feat: modal 2026-01-30 23:15:42 +01:00
eneller
3b8e5145c3 wip: player modal 2026-01-30 22:51:09 +01:00
eneller
51414f5a99 refactor: extract randomizer to component 2026-01-30 22:03:48 +01:00
8 changed files with 17 additions and 12 deletions

View File

@@ -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="" class="custom-navitem"><a ngbNavLink routerLink="" routerLinkActive="active"><i class="bi bi-pencil-square"></i>{{ data.getPlayers().length }}</a></li> <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="/basic.t" class="custom-navitem"><a ngbNavLink routerLink="/basic.t" routerLinkActive="active"><i class="bi bi-shuffle"></i></a></li> <li ngbNavItem="/basic" class="custom-navitem"><a ngbNavLink routerLink="/basic" routerLinkActive="active"><i class="bi bi-shuffle"></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> <li ngbNavItem="/rotations" class="custom-navitem"><a ngbNavLink routerLink="/rotations" routerLinkActive="active"><i class="bi bi-arrow-repeat"></i></a></li>
</ul> </ul>
</nav> </nav>

View File

@@ -22,6 +22,7 @@ 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,3 +34,5 @@ tr{
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{
}

View File

@@ -2,14 +2,16 @@ 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: '', component: ScreenEditComponent }, { path: '', redirectTo: 'edit', pathMatch: 'full' },
{ path: 'basic.t', component: ScreenBasicComponent }, { path: 'edit', component: ScreenEditComponent },
{ path: 'rotations.t', component: ScreenRotationsComponent } { path: 'basic', component: ScreenBasicComponent },
{ path: 'rotations', component: ScreenRotationsComponent }
] ]
} }
]; ];

View File

@@ -6,7 +6,6 @@ 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){

View File

@@ -26,7 +26,7 @@ export class Player{
return [this.name, values]; return [this.name, values];
} }
toString(): string{ valueOf(): string{
return this.name; return this.name;
} }
static deSerialize(name: string, values: string): Player{ static deSerialize(name: string, values: string): Player{

View File

@@ -30,7 +30,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@for (team of data.teams; track $index) { @for (team of teamsArray; 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>

View File

@@ -19,6 +19,7 @@ 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'){
@@ -39,10 +40,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); team.push(n.name);
} }
this.data.teams = teams; this.teamsArray = teams;
} }
} }

View File

@@ -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:.5em auto; padding:0 .5em;
} }
h1,h2,h3{ h1,h2,h3{
line-height:1.2; line-height:1.2;