Skip to content

Commit 6c335fc

Browse files
authored
feat: add simple text power overlay (#291)
* feat: add simple text power overlay The one we currently have doesnt use the power data but calculates it. This uses the listener for power. * chore: rename to units * chore: reorganize * chore: remove console log
1 parent 0a20a5a commit 6c335fc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

public/cycling_power/w.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<script src="https://cdn.jsdelivr.net/npm/@rtirl/api@latest/lib/index.min.js"></script>
6+
<script defer src="../css.js"></script>
7+
</head>
8+
9+
<body>
10+
<div id="text"><span id="power">0</span> watts</div>
11+
<script>
12+
const pullKey = new URLSearchParams(window.location.search).get("key");
13+
RealtimeIRL.forPullKey(pullKey).addCyclingPowerListener(function (
14+
data
15+
) {
16+
if (!data) {
17+
return;
18+
}
19+
20+
document.getElementById("power").innerText = data > 0 ? data : 0;
21+
});
22+
</script>
23+
</body>
24+
25+
</html>

0 commit comments

Comments
 (0)