mirror of https://github.com/dirtbags/moth.git
Merge branch 'master' of https://github.com/dirtbags/moth into v3.5_devel
This commit is contained in:
commit
0ac8a9fae6
|
@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- URL parameter to points.json to allow returning only the JSON for a single
|
- URL parameter to points.json to allow returning only the JSON for a single
|
||||||
team by its team id (e.g., points.json?id=abc123).
|
team by its team id (e.g., points.json?id=abc123).
|
||||||
|
|
||||||
|
## [3.4.3] - 2019-11-20
|
||||||
|
### Fixed
|
||||||
|
- Made top-scoring teams full-width
|
||||||
|
|
||||||
## [3.4.2] - 2019-11-18
|
## [3.4.2] - 2019-11-18
|
||||||
### Fixed
|
### Fixed
|
||||||
- Issue with multiple answers in devel server and YAML-format .moth
|
- Issue with multiple answers in devel server and YAML-format .moth
|
||||||
|
|
|
@ -67,7 +67,7 @@ you can copy the example puzzles as a starting point:
|
||||||
|
|
||||||
Then launch the development server:
|
Then launch the development server:
|
||||||
|
|
||||||
$ python3 tools/devel-server.py
|
$ python3 devel/devel-server.py
|
||||||
|
|
||||||
Point a web browser at http://localhost:8080/
|
Point a web browser at http://localhost:8080/
|
||||||
and start hacking on things in your `puzzles` directory.
|
and start hacking on things in your `puzzles` directory.
|
||||||
|
|
|
@ -28,6 +28,7 @@ If you can't use docker,
|
||||||
try this:
|
try this:
|
||||||
|
|
||||||
apt install python3
|
apt install python3
|
||||||
|
pip3 install scapy pillow PyYAML
|
||||||
git clone https://github.com/dirtbags/moth/
|
git clone https://github.com/dirtbags/moth/
|
||||||
cd moth
|
cd moth
|
||||||
python3 devel/devel-server.py --puzzles example-puzzles
|
python3 devel/devel-server.py --puzzles example-puzzles
|
||||||
|
|
|
@ -112,10 +112,14 @@ function scoreboardInit() {
|
||||||
winners.sort(teamCompare)
|
winners.sort(teamCompare)
|
||||||
winners.reverse()
|
winners.reverse()
|
||||||
|
|
||||||
|
// Let's make some better names for things we've computed
|
||||||
|
let winningScore = winners[0].overallScore
|
||||||
|
let numCategories = Object.keys(highestCategoryScore).length
|
||||||
|
|
||||||
// Clear out the element we're about to populate
|
// Clear out the element we're about to populate
|
||||||
Array.from(element.childNodes).map(e => e.remove())
|
Array.from(element.childNodes).map(e => e.remove())
|
||||||
|
|
||||||
let maxWidth = 100 / Object.keys(highestCategoryScore).length
|
let maxWidth = 100 / winningScore
|
||||||
for (let team of winners) {
|
for (let team of winners) {
|
||||||
let row = document.createElement("div")
|
let row = document.createElement("div")
|
||||||
let ncat = 0
|
let ncat = 0
|
||||||
|
@ -125,8 +129,6 @@ function scoreboardInit() {
|
||||||
let catPct = catTeam / catHigh
|
let catPct = catTeam / catHigh
|
||||||
let width = maxWidth * catPct
|
let width = maxWidth * catPct
|
||||||
|
|
||||||
console.log(catHigh, catTeam, catPct)
|
|
||||||
|
|
||||||
let bar = document.createElement("span")
|
let bar = document.createElement("span")
|
||||||
bar.classList.add("category")
|
bar.classList.add("category")
|
||||||
bar.classList.add("cat" + ncat)
|
bar.classList.add("cat" + ncat)
|
||||||
|
|
Loading…
Reference in New Issue