Move link to source code to bottom of page

This commit is contained in:
Lavender 2021-04-04 20:50:04 -07:00
parent 9529bafac6
commit 24f9d89fec
Signed by: endie
GPG Key ID: CC5162D7C2146F01
2 changed files with 9 additions and 5 deletions

View File

@ -6,15 +6,17 @@
</title>
</head>
<body>
<h1 id="progress">
Loading...
</h1>
<div id="results">
</div>
<h1>
Source:
Source code:
<a href="https://gitdab.com/endie/team-big">
https://gitdab.com/endie/team-big
</a>
</h1>
<h1 id="progress">
Loading...
</h1>
<script src="main.js">
</script>
<noscript>

View File

@ -10,12 +10,14 @@ request.onload = function() {
let teams = JSON.parse(this.response)
let totals = teams.map(team => team.lineup.length + team.rotation.length)
let results = document.getElementById("results")
// Get all player counts that there are from greatest to least
// & make headers & lists for them
totals.slice().sort((x, y) => y - x)
.filter((item, pos, array) => !pos || item !== array[pos - 1])
.forEach(function(item) {
document.body.insertAdjacentHTML("beforeend",
results.insertAdjacentHTML("beforeend",
`<h1>${item} player${ending(item)}</h1>
<ul id="tlist${item}"></ul>`)
})