Move link to source code to bottom of page
This commit is contained in:
parent
9529bafac6
commit
24f9d89fec
2 changed files with 9 additions and 5 deletions
10
index.html
10
index.html
|
@ -6,15 +6,17 @@
|
||||||
</title>
|
</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<h1 id="progress">
|
||||||
|
Loading...
|
||||||
|
</h1>
|
||||||
|
<div id="results">
|
||||||
|
</div>
|
||||||
<h1>
|
<h1>
|
||||||
Source:
|
Source code:
|
||||||
<a href="https://gitdab.com/endie/team-big">
|
<a href="https://gitdab.com/endie/team-big">
|
||||||
https://gitdab.com/endie/team-big
|
https://gitdab.com/endie/team-big
|
||||||
</a>
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
<h1 id="progress">
|
|
||||||
Loading...
|
|
||||||
</h1>
|
|
||||||
<script src="main.js">
|
<script src="main.js">
|
||||||
</script>
|
</script>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
|
4
main.js
4
main.js
|
@ -10,12 +10,14 @@ request.onload = function() {
|
||||||
|
|
||||||
let teams = JSON.parse(this.response)
|
let teams = JSON.parse(this.response)
|
||||||
let totals = teams.map(team => team.lineup.length + team.rotation.length)
|
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
|
// Get all player counts that there are from greatest to least
|
||||||
// & make headers & lists for them
|
// & make headers & lists for them
|
||||||
totals.slice().sort((x, y) => y - x)
|
totals.slice().sort((x, y) => y - x)
|
||||||
.filter((item, pos, array) => !pos || item !== array[pos - 1])
|
.filter((item, pos, array) => !pos || item !== array[pos - 1])
|
||||||
.forEach(function(item) {
|
.forEach(function(item) {
|
||||||
document.body.insertAdjacentHTML("beforeend",
|
results.insertAdjacentHTML("beforeend",
|
||||||
`<h1>${item} player${ending(item)}</h1>
|
`<h1>${item} player${ending(item)}</h1>
|
||||||
<ul id="tlist${item}"></ul>`)
|
<ul id="tlist${item}"></ul>`)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue