Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6596d30bd6 | ||
|
|
497b64fe3f | ||
|
|
4d58880493 | ||
|
|
dcf25ea969 | ||
|
|
48bbdab308 | ||
|
|
f7f8482bc9 | ||
|
|
e0a319b32a | ||
|
|
4be3649d43 | ||
|
|
2a596b15c8 | ||
|
|
d2090f30d4 | ||
|
|
97f01f924a | ||
|
|
102f589869 | ||
|
|
7f5978b226 |
261
.gitignore
vendored
261
.gitignore
vendored
@@ -1,245 +1,42 @@
|
|||||||
# Created by https://www.toptal.com/developers/gitignore/api/angular,sonarqube,node,visualstudiocode,sass,yarn,bazel
|
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=angular,sonarqube,node,visualstudiocode,sass,yarn,bazel
|
|
||||||
|
|
||||||
### Angular ###
|
# Compiled output
|
||||||
## Angular ##
|
/dist
|
||||||
# compiled output
|
/tmp
|
||||||
dist/
|
/out-tsc
|
||||||
tmp/
|
/bazel-out
|
||||||
app/**/*.js
|
|
||||||
app/**/*.js.map
|
|
||||||
|
|
||||||
# dependencies
|
# Node
|
||||||
node_modules/
|
/node_modules
|
||||||
bower_components/
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
# IDEs and editors
|
# IDEs and editors
|
||||||
.idea/
|
.idea/
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
.c9/
|
||||||
|
*.launch
|
||||||
|
.settings/
|
||||||
|
*.sublime-workspace
|
||||||
|
|
||||||
# misc
|
# Visual Studio Code
|
||||||
.sass-cache/
|
|
||||||
connect.lock/
|
|
||||||
coverage/
|
|
||||||
libpeerconnection.log/
|
|
||||||
npm-debug.log
|
|
||||||
testem.log
|
|
||||||
typings/
|
|
||||||
.angular/
|
|
||||||
|
|
||||||
# e2e
|
|
||||||
e2e/*.js
|
|
||||||
e2e/*.map
|
|
||||||
|
|
||||||
# System Files
|
|
||||||
.DS_Store/
|
|
||||||
|
|
||||||
### Bazel ###
|
|
||||||
# gitignore template for Bazel build system
|
|
||||||
# website: https://bazel.build/
|
|
||||||
|
|
||||||
# Ignore all bazel-* symlinks. There is no full list since this can change
|
|
||||||
# based on the name of the directory bazel is cloned into.
|
|
||||||
/bazel-*
|
|
||||||
|
|
||||||
# Directories for the Bazel IntelliJ plugin containing the generated
|
|
||||||
# IntelliJ project files and plugin configuration. Seperate directories are
|
|
||||||
# for the IntelliJ, Android Studio and CLion versions of the plugin.
|
|
||||||
/.ijwb/
|
|
||||||
/.aswb/
|
|
||||||
/.clwb/
|
|
||||||
|
|
||||||
### Node ###
|
|
||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
.pnpm-debug.log*
|
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
*.lcov
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# Snowpack dependency directory (https://snowpack.dev/)
|
|
||||||
web_modules/
|
|
||||||
|
|
||||||
# TypeScript cache
|
|
||||||
*.tsbuildinfo
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Optional stylelint cache
|
|
||||||
.stylelintcache
|
|
||||||
|
|
||||||
# Microbundle cache
|
|
||||||
.rpt2_cache/
|
|
||||||
.rts2_cache_cjs/
|
|
||||||
.rts2_cache_es/
|
|
||||||
.rts2_cache_umd/
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|
||||||
# dotenv environment variable files
|
|
||||||
.env
|
|
||||||
.env.development.local
|
|
||||||
.env.test.local
|
|
||||||
.env.production.local
|
|
||||||
.env.local
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
|
||||||
.cache
|
|
||||||
.parcel-cache
|
|
||||||
|
|
||||||
# Next.js build output
|
|
||||||
.next
|
|
||||||
out
|
|
||||||
|
|
||||||
# Nuxt.js build / generate output
|
|
||||||
.nuxt
|
|
||||||
dist
|
|
||||||
|
|
||||||
# Gatsby files
|
|
||||||
.cache/
|
|
||||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
||||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
||||||
# public
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# vuepress v2.x temp and cache directory
|
|
||||||
.temp
|
|
||||||
|
|
||||||
# Docusaurus cache and generated files
|
|
||||||
.docusaurus
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
|
|
||||||
# TernJS port file
|
|
||||||
.tern-port
|
|
||||||
|
|
||||||
# Stores VSCode versions used for testing VSCode extensions
|
|
||||||
.vscode-test
|
|
||||||
|
|
||||||
# yarn v2
|
|
||||||
.yarn/cache
|
|
||||||
.yarn/unplugged
|
|
||||||
.yarn/build-state.yml
|
|
||||||
.yarn/install-state.gz
|
|
||||||
.pnp.*
|
|
||||||
|
|
||||||
### Node Patch ###
|
|
||||||
# Serverless Webpack directories
|
|
||||||
.webpack/
|
|
||||||
|
|
||||||
# Optional stylelint cache
|
|
||||||
|
|
||||||
# SvelteKit build / generate output
|
|
||||||
.svelte-kit
|
|
||||||
|
|
||||||
### Sass ###
|
|
||||||
*.css.map
|
|
||||||
*.sass.map
|
|
||||||
*.scss.map
|
|
||||||
|
|
||||||
### SonarQube ###
|
|
||||||
# SonarQube ignore files.
|
|
||||||
#
|
|
||||||
# https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
|
|
||||||
# Sonar Scanner working directories
|
|
||||||
.sonar/
|
|
||||||
.sonarqube/
|
|
||||||
.scannerwork/
|
|
||||||
|
|
||||||
# http://www.sonarlint.org/commandline/
|
|
||||||
# SonarLint working directories, configuration files (including credentials)
|
|
||||||
.sonarlint/
|
|
||||||
|
|
||||||
### VisualStudioCode ###
|
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
!.vscode/launch.json
|
!.vscode/launch.json
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
!.vscode/*.code-snippets
|
.history/*
|
||||||
|
|
||||||
# Local History for Visual Studio Code
|
# Miscellaneous
|
||||||
.history/
|
/.angular/cache
|
||||||
|
.sass-cache/
|
||||||
# Built Visual Studio Code Extensions
|
/connect.lock
|
||||||
*.vsix
|
/coverage
|
||||||
|
/libpeerconnection.log
|
||||||
### VisualStudioCode Patch ###
|
testem.log
|
||||||
# Ignore all local history of files
|
/typings
|
||||||
.history
|
|
||||||
.ionide
|
|
||||||
|
|
||||||
### yarn ###
|
|
||||||
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
|
|
||||||
|
|
||||||
.yarn/*
|
|
||||||
!.yarn/releases
|
|
||||||
!.yarn/patches
|
|
||||||
!.yarn/plugins
|
|
||||||
!.yarn/sdks
|
|
||||||
!.yarn/versions
|
|
||||||
|
|
||||||
# if you are NOT using Zero-installs, then:
|
|
||||||
# comment the following lines
|
|
||||||
!.yarn/cache
|
|
||||||
|
|
||||||
# and uncomment the following lines
|
|
||||||
# .pnp.*
|
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/angular,sonarqube,node,visualstudiocode,sass,yarn,bazel
|
|
||||||
|
|
||||||
|
# System files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|||||||
46
README.md
46
README.md
@@ -1,11 +1,8 @@
|
|||||||
# Vb
|
# Vb
|
||||||
A Team Randomizer built using Angular and Bootstrap, installable as a progressive web app (PWA).
|
|
||||||
Supports setting names using URL query parameters:
|
|
||||||
```url
|
|
||||||
https://vb.example.org?names=Me,Myself,I
|
|
||||||
```
|
|
||||||
|
|
||||||
## Development
|
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.2.
|
||||||
|
|
||||||
|
## Development server
|
||||||
|
|
||||||
To start a local development server, run:
|
To start a local development server, run:
|
||||||
|
|
||||||
@@ -15,10 +12,18 @@ ng serve
|
|||||||
|
|
||||||
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
||||||
|
|
||||||
Alternatively, to open the server to the network instead of just localhost, use
|
## Code scaffolding
|
||||||
|
|
||||||
|
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run serve
|
ng generate component component-name
|
||||||
|
```
|
||||||
|
|
||||||
|
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng generate --help
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
@@ -29,5 +34,26 @@ To build the project run:
|
|||||||
ng build
|
ng build
|
||||||
```
|
```
|
||||||
|
|
||||||
This will compile your project and store the build artifacts in the `dist/` directory.
|
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
||||||
As this is a static site, simply move the contents of `dist/vb/browser/` to a directory that can be served by nginx or apache.
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running end-to-end tests
|
||||||
|
|
||||||
|
For end-to-end (e2e) testing, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||||
|
|
||||||
|
## Additional Resources
|
||||||
|
|
||||||
|
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||||
|
|||||||
@@ -30,8 +30,7 @@
|
|||||||
{
|
{
|
||||||
"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",
|
||||||
|
|||||||
5030
package-lock.json
generated
5030
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
36
package.json
36
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vb",
|
"name": "vb",
|
||||||
"version": "1.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
@@ -12,33 +12,31 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^19.2.7",
|
"@angular/animations": "^19.0.5",
|
||||||
"@angular/cdk": "~19.2.10",
|
"@angular/cdk": "~19.0.1",
|
||||||
"@angular/common": "^19.2.7",
|
"@angular/common": "^19.0.5",
|
||||||
"@angular/compiler": "^19.2.7",
|
"@angular/compiler": "^19.0.5",
|
||||||
"@angular/core": "^19.2.7",
|
"@angular/core": "^19.0.5",
|
||||||
"@angular/forms": "^19.2.7",
|
"@angular/forms": "^19.0.5",
|
||||||
"@angular/platform-browser": "^19.2.7",
|
"@angular/platform-browser": "^19.0.5",
|
||||||
"@angular/platform-browser-dynamic": "^19.2.7",
|
"@angular/platform-browser-dynamic": "^19.0.5",
|
||||||
"@angular/platform-server": "^19.2.7",
|
"@angular/platform-server": "^19.0.5",
|
||||||
"@angular/router": "^19.2.7",
|
"@angular/router": "^19.0.5",
|
||||||
"@angular/service-worker": "^19.2.7",
|
"@angular/service-worker": "^19.0.5",
|
||||||
"@angular/ssr": "^19.2.9",
|
"@angular/ssr": "^19.0.6",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^18.0.0",
|
"@ng-bootstrap/ng-bootstrap": "^18.0.0",
|
||||||
"@popperjs/core": "^2.11.8",
|
"@popperjs/core": "^2.11.8",
|
||||||
"bootstrap": "^5.3.3",
|
"bootstrap": "^5.3.3",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
"sonarqube-scanner": "^4.3.0",
|
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"zone.js": "~0.15.0"
|
"zone.js": "~0.15.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^19.2.9",
|
"@angular-devkit/build-angular": "^19.0.6",
|
||||||
"@angular/cli": "^19.2.9",
|
"@angular/cli": "^19.0.6",
|
||||||
"@angular/compiler-cli": "^19.2.7",
|
"@angular/compiler-cli": "^19.0.5",
|
||||||
"@angular/localize": "^19.2.7",
|
"@angular/localize": "^19.0.5",
|
||||||
"@sonar/scan": "^4.3.0",
|
|
||||||
"@types/express": "^4.17.17",
|
"@types/express": "^4.17.17",
|
||||||
"@types/jasmine": "~5.1.0",
|
"@types/jasmine": "~5.1.0",
|
||||||
"@types/node": "^18.18.0",
|
"@types/node": "^18.18.0",
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
<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>
|
||||||
@@ -18,25 +23,21 @@
|
|||||||
<input type="number" pattern="\d*" [(ngModel)]="nTeamsValue" id="nTeamsField" class="form-control" >
|
<input type="number" pattern="\d*" [(ngModel)]="nTeamsValue" id="nTeamsField" class="form-control" >
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<label for="playerNames">Names</label>
|
<label for="playerNames">Names</label>
|
||||||
<textarea [(ngModel)]="playerNamesValue"
|
<textarea class="form-control mb-3"
|
||||||
class="form-control mb-3"
|
|
||||||
rows="18"
|
rows="18"
|
||||||
cols="30"
|
cols="30"
|
||||||
style="text-align: left;"
|
style="text-align: left;"
|
||||||
name="playerNames"
|
|
||||||
#playerNames
|
#playerNames
|
||||||
id="playerNames"
|
id="playerNames"
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
<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>
|
|
||||||
|
|
||||||
<table class="table table-striped custom-table">
|
</form>
|
||||||
<caption *ngIf="duplicateNames.length >0">Removed: {{ duplicateNames }}</caption>
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Size</th>
|
<th scope="col">Size</th>
|
||||||
@@ -46,8 +47,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@for (team of teamsArray; track $index) {
|
@for (team of teamsArray; track $index) {
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-wrap: wrap;">{{ team.length | number }}</td>
|
<td>{{ team.length | number }}</td>
|
||||||
<td class="wrap-cell">{{ team }}</td>
|
<td>{{ team }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
html, body{
|
|
||||||
max-width: 100%;
|
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
|
||||||
*{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.custom-table {
|
|
||||||
//table-layout: fixed;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
tr{
|
|
||||||
padding-right: .2em;
|
|
||||||
}
|
|
||||||
.wrap-cell{
|
|
||||||
word-break: break-all;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { AfterViewInit, Component, OnInit} from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterOutlet, ActivatedRoute } from '@angular/router';
|
import { RouterOutlet } from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
@@ -11,25 +11,13 @@ import { CommonModule } from '@angular/common';
|
|||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrl: './app.component.less'
|
styleUrl: './app.component.less'
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit {
|
export class AppComponent {
|
||||||
title = 'vb';
|
title = 'vb';
|
||||||
playerNamesValue = "";
|
|
||||||
numTeamsSelectorValue = "2";
|
numTeamsSelectorValue = "2";
|
||||||
numTeamsSelected = 2;
|
numTeamsSelected = 2;
|
||||||
nTeamsValue = "4";
|
nTeamsValue = "4";
|
||||||
teamsArray: string[][] = [];
|
teamsArray: string[][] = [];
|
||||||
duplicateNames: string[] = [];
|
displayedColumns = ["teamCount", "teamNames"];
|
||||||
|
|
||||||
constructor(private activatedRoute: ActivatedRoute){}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
this.activatedRoute.queryParams.subscribe(params => {
|
|
||||||
const names = params['names']?.replaceAll(',', '\n');
|
|
||||||
if (names) {
|
|
||||||
this.playerNamesValue = names;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onButtonGenerate(textinput: string): void{
|
onButtonGenerate(textinput: string): void{
|
||||||
if(this.numTeamsSelectorValue === 'n'){
|
if(this.numTeamsSelectorValue === 'n'){
|
||||||
@@ -38,20 +26,18 @@ export class AppComponent implements OnInit {
|
|||||||
else{
|
else{
|
||||||
this.numTeamsSelected = Number(this.numTeamsSelectorValue);
|
this.numTeamsSelected = Number(this.numTeamsSelectorValue);
|
||||||
}
|
}
|
||||||
let nameslist = this.playerNamesValue
|
let names = textinput
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(function(str){return str.trim();})
|
.map(function(str){return str.trim();})
|
||||||
.filter(function(str){return str}); // boolean interpretation is same as non-empty
|
.filter(function(str){return str}); // boolean interpretation is same as non-empty
|
||||||
// remove duplicates by using a Set
|
// remove duplicates by using a Set
|
||||||
let namesset = new Set(nameslist);
|
names = [...new Set(names)];
|
||||||
let names = [...namesset];
|
|
||||||
|
|
||||||
|
|
||||||
var teams = Array.from({ length: this.numTeamsSelected }, () => []);
|
var teams = Array.from({ length: this.numTeamsSelected }, () => []);
|
||||||
var playersPerTeam = Math.floor(names.length / this.numTeamsSelected);
|
var playersPerTeam = Math.floor(names.length / this.numTeamsSelected);
|
||||||
|
|
||||||
let nameslen = names.length;
|
let nameslen = names.length;
|
||||||
function* iter(list: any[]){
|
function* iter(list: any){
|
||||||
let index = 0;
|
let index = 0;
|
||||||
while(true){
|
while(true){
|
||||||
yield list[index % list.length];
|
yield list[index % list.length];
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ import { ApplicationConfig, provideZoneChangeDetection, isDevMode } from '@angul
|
|||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
|
|
||||||
import { routes } from './app.routes';
|
import { routes } from './app.routes';
|
||||||
|
import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
|
||||||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||||
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), provideAnimationsAsync('noop'), provideServiceWorker('./sw.js', {
|
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(withEventReplay()), provideAnimationsAsync('noop'), provideServiceWorker('ngsw-worker.js', {
|
||||||
enabled: !isDevMode(),
|
enabled: !isDevMode(),
|
||||||
registrationStrategy: 'registerWhenStable:30000'
|
registrationStrategy: 'registerWhenStable:30000'
|
||||||
})]
|
})]
|
||||||
|
|||||||
@@ -1,17 +1,4 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
|
||||||
html, body {
|
html, body { height: 100%; }
|
||||||
height: 100%;
|
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
|
||||||
max-width: 100%;
|
|
||||||
overflow-x: hidden;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin:3em auto;
|
|
||||||
font-family: Roboto, "Helvetica Neue", sans-serif;
|
|
||||||
padding:0 .5em;
|
|
||||||
}
|
|
||||||
h1,h2,h3{
|
|
||||||
line-height:1.2;
|
|
||||||
letter-spacing: -2%;
|
|
||||||
}
|
|
||||||
|
|||||||
12
src/sw.js
12
src/sw.js
@@ -1,12 +0,0 @@
|
|||||||
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