Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29633a94c0 | ||
|
|
3d3a177b7c | ||
|
|
07b84586b6 | ||
|
|
5267eb6ab1 |
@@ -30,7 +30,8 @@
|
|||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "public"
|
"input": "public"
|
||||||
}
|
},
|
||||||
|
"src/sw.js"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
||||||
|
|||||||
@@ -25,14 +25,6 @@
|
|||||||
"/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
|
"/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "excluded-redirects",
|
|
||||||
"installMode": "lazy",
|
|
||||||
"updateMode": "lazy",
|
|
||||||
"resources": {
|
|
||||||
"urls": [ "/**" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
<style>
|
|
||||||
*{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<main class="main">
|
<main class="main">
|
||||||
<div class="row justify-content-md-center">
|
<div class="row justify-content-md-center">
|
||||||
<h1>Please select the number of teams:</h1>
|
<h1>Please select the number of teams:</h1>
|
||||||
@@ -40,7 +35,7 @@
|
|||||||
<button type="button" (click)="onButtonGenerate(playerNames.value)" class="btn btn-primary">Generate</button>
|
<button type="button" (click)="onButtonGenerate(playerNames.value)" class="btn btn-primary">Generate</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped custom-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Size</th>
|
<th scope="col">Size</th>
|
||||||
@@ -50,8 +45,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@for (team of teamsArray; track $index) {
|
@for (team of teamsArray; track $index) {
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ team.length | number }}</td>
|
<td style="text-wrap: wrap;">{{ team.length | number }}</td>
|
||||||
<td>{{ team }}</td>
|
<td class="wrap-cell">{{ team }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
*{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.custom-table {
|
||||||
|
//table-layout: fixed;
|
||||||
|
width: 100%; /* Or a specific max-width */
|
||||||
|
}
|
||||||
|
.wrap-cell{
|
||||||
|
word-break: break-word;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ export class AppComponent implements OnInit {
|
|||||||
constructor(private activatedRoute: ActivatedRoute){}
|
constructor(private activatedRoute: ActivatedRoute){}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
//consiedr using Angular's ActivatedRoute here instead
|
//TODO consider using Angular's ActivatedRoute here instead
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const names = params.get('names')?.replaceAll(',', '\n');
|
const names = params.get('names')?.replaceAll(',', '\n');
|
||||||
if (names) this.playerNamesValue = names;
|
if (names) this.playerNamesValue = names;
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import { provideAnimationsAsync } from '@angular/platform-browser/animations/asy
|
|||||||
import { provideServiceWorker } from '@angular/service-worker';
|
import { provideServiceWorker } from '@angular/service-worker';
|
||||||
|
|
||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes),
|
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(withEventReplay()), provideAnimationsAsync('noop'), provideServiceWorker('./sw.js', {
|
||||||
provideClientHydration(withEventReplay()), provideAnimationsAsync('noop'),
|
|
||||||
provideServiceWorker('ngsw-worker.js', {
|
|
||||||
enabled: !isDevMode(),
|
enabled: !isDevMode(),
|
||||||
registrationStrategy: 'registerWhenStable:30000'
|
registrationStrategy: 'registerWhenStable:30000'
|
||||||
})]
|
})]
|
||||||
|
|||||||
12
src/sw.js
Normal file
12
src/sw.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
self.addEventListener('fetch', event => {
|
||||||
|
if (event &&
|
||||||
|
event.request &&
|
||||||
|
event.request.url &&
|
||||||
|
// check if basename includes a dot, i.e. if it is not a file
|
||||||
|
! event.request.url.split(/[\\/]/).pop().includes(".")
|
||||||
|
) {
|
||||||
|
event.stopImmediatePropagation();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
self.importScripts('./ngsw-worker.js');
|
||||||
Reference in New Issue
Block a user