diff --git a/app/client/app.js b/app/client/app.js index 38f480d..ddcd7bb 100644 --- a/app/client/app.js +++ b/app/client/app.js @@ -23,9 +23,11 @@ export function createApp () { const standalone = (window.location.hash === '#:standalone:') if (standalone) { - document.getElementById('closeButton').style.display = 'inline-block' + document.getElementById('close-button').style.display = 'inline-block' + document.getElementById('fullscreen-button').style.display = 'none' } else { - document.getElementById('fullscreenButton').style.display = 'inline-block' + document.getElementById('fullscreen-button').style.display = 'inline-block' + document.getElementById('close-button').style.display = 'none' } let socket @@ -40,7 +42,7 @@ export function createApp () { socket = new WebSocket(`ws://${location.host}/websocket`) socket.addEventListener('open', (event) => { - console.log('websocket openend') + console.log('websocket opened') }) socket.addEventListener('error', (error) => { @@ -86,19 +88,10 @@ export function createApp () { // In this case we use the good old hacky way of keeping the screen on via a hidden video. // eslint-disable-next-line no-undef const noSleep = new NoSleep() - checkAlwaysOn() document.addEventListener('click', function enableNoSleep () { document.removeEventListener('click', enableNoSleep, false) - noSleep.enable().then(checkAlwaysOn) + noSleep.enable() }, false) - - function checkAlwaysOn () { - if (noSleep.isEnabled) { - document.getElementById('alwaysOnHint').style.display = 'none' - } else { - document.getElementById('alwaysOnHint').style.display = 'grid' - } - } } function resetFields () { diff --git a/app/client/index.html b/app/client/index.html index f678070..8e5cdf7 100644 --- a/app/client/index.html +++ b/app/client/index.html @@ -18,65 +18,118 @@
-
Distance
+
+ +
- - m + + m
-
Split
+
+ +
- - /500m + + /500m
-
Power
+
+ +
- - watt + + watt
-
SPM
+
+ +
- - + + /min
-
Strokes
+
+ +
- - + + total +
+
+ +
+
+ +
+
+ + kcal
-
Calories
-
- - kcal +
+ +
-
-
-
Duration
- - + +
- - - - + + + + +
- diff --git a/app/client/style.css b/app/client/style.css index a252edd..6e29052 100644 --- a/app/client/style.css +++ b/app/client/style.css @@ -2,7 +2,7 @@ Open Rowing Monitor, https://github.com/laberning/openrowingmonitor */ body { - background-color: #000d1b; + background-color: #00091c; color: white; margin: 0; font-size: calc(16px + (60 - 16) * ((100vw - 300px) / (1920 - 300))); @@ -36,47 +36,50 @@ body { } } -div.label, div.content { - padding: 5%; +#windowed-icon { + display: none; } -span.value { +@media (display-mode: fullscreen) { + #fullscreen-icon { + display: none; + } + #windowed-icon { + display: inline; + } +} + +div.label, div.content { + padding: 5% 1%; +} + +.icon { + height: 1.8em; +} + +.metric-value { font-size: 150%; } -span.unit { +.metric-unit { font-size: 80%; } button { outline:none; - background-color: #00468c; + /* background-color: #00468c; */ + background-color: #365080; border: 0; color: white; - padding: 1.2vw 1.5vw; - margin: 0.8vw; + padding: 0.6em 0.9em 0.4em 0.9em; + margin: 0.2em; font-size: 70%; text-align: center; text-decoration: none; display: inline-block; + width: 3.5em; } -#fullscreenButton, #closeButton { +#close-button { display:none; } - -.popup { - display: none; - position: fixed; - border: solid 0.3vw white; - align-items: center; - justify-content: center; - padding: 10px; - width: 50vw; - height: 10vh; - left: 24vw; - top: 5vw; - background: rgba(80, 0, 0, 0.95); - font-size: 60%; - z-index: 20; -} diff --git a/doc/attribution.md b/doc/attribution.md index 0ec60b8..44a0d44 100644 --- a/doc/attribution.md +++ b/doc/attribution.md @@ -6,6 +6,8 @@ Open Rowing Monitor uses some great work by others. Thank you for all the great * Dave Vernooy's project description on [ErgWare](https://dvernooy.github.io/projects/ergware) has some good information on the maths involved in a rowing ergometer. +* Bluetooth is quite a complex beast, luckily the Bluetooth SIG releases all the [specifications here](https://www.bluetooth.com/specifications/specs) + * The app icon is based on this [image of a rowing machine](https://thenounproject.com/term/rowing-machine/659265) by [Gan Khoon Lay](https://thenounproject.com/leremy/) licensed under [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/). -* Bluetooth is quite a complex beast, luckily the Bluetooth SIG releases all the [specifications here](https://www.bluetooth.com/specifications/specs) +* The frontend uses some icons from [Font Awesome](https://fontawesome.com/), licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). diff --git a/doc/backlog.md b/doc/backlog.md index ddff3dd..f754bf4 100644 --- a/doc/backlog.md +++ b/doc/backlog.md @@ -7,6 +7,7 @@ This is the very minimalistic Backlog for further development of this project. * investigate: occasionally stroke rate is too high - seems to happen after rowing pause * figure out where to set the Service Advertising Data (FTMS.pdf p 15) * set up a Raspberry Pi with the installation instructions to see if they are correct +* record a longer rowing session and analyze two encountered problems: 1) rarely the stroke rate doubles for a short duration (might be a problem with stroke detection when measurements are imprecise), 2) in one occasion the measured power jumped to a very high value after a break (40000 watts) ## Later diff --git a/doc/img/openrowingmonitor_frontend.png b/doc/img/openrowingmonitor_frontend.png index 68cd013..a313c32 100644 Binary files a/doc/img/openrowingmonitor_frontend.png and b/doc/img/openrowingmonitor_frontend.png differ diff --git a/package-lock.json b/package-lock.json index 1519b44..61e5df4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1080,12 +1080,6 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, - "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, "expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", @@ -1211,12 +1205,6 @@ "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", "dev": true }, - "follow-redirects": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", - "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==", - "dev": true - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -1454,17 +1442,6 @@ "toidentifier": "1.0.0" } }, - "http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - } - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -2767,12 +2744,6 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true - }, "resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", diff --git a/package.json b/package.json index 8e5e890..db6aacd 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,6 @@ "test": "uvu", "test:watch": "uvu --watch" }, - "ava": { - "verbose": true - }, "dependencies": { "@abandonware/bleno": "^0.5.1-3", "finalhandler": "^1.1.2", @@ -42,7 +39,6 @@ "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", - "http-proxy": "^1.18.1", "husky": "^5.1.3", "markdownlint-cli": "^0.27.1", "npm-run-all": "^4.1.5",