diff options
author | metamuffin <metamuffin@disroot.org> | 2024-08-15 21:28:03 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-08-15 21:28:03 +0200 |
commit | 3b5e46e4118b0c5e3f2f9a4ea0f2860a1641e842 (patch) | |
tree | 185f1f8dc37a6699cd91268e418438909c893875 /test-client/visual.ts | |
parent | 1cb35341481cb76feb5bb794a304d1c4e3c7b372 (diff) | |
download | hurrycurry-3b5e46e4118b0c5e3f2f9a4ea0f2860a1641e842.tar hurrycurry-3b5e46e4118b0c5e3f2f9a4ea0f2860a1641e842.tar.bz2 hurrycurry-3b5e46e4118b0c5e3f2f9a4ea0f2860a1641e842.tar.zst |
nice timeout colors
Diffstat (limited to 'test-client/visual.ts')
-rw-r--r-- | test-client/visual.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test-client/visual.ts b/test-client/visual.ts index 59734234..a54ca143 100644 --- a/test-client/visual.ts +++ b/test-client/visual.ts @@ -221,10 +221,11 @@ function draw_message(m: MessageData) { ctx.closePath() ctx.fill() + const t = m.timeout.remaining / m.timeout.initial; ctx.beginPath() - ctx.strokeStyle = "red" + ctx.strokeStyle = `hsl(${Math.sqrt(t) * 0.3}turn, 100%, 50%)` ctx.lineWidth = 0.1 - ctx.arc(0, -1, 0.45, -Math.PI / 2, -Math.PI / 2 + Math.PI * 2 * (1 - m.timeout.remaining / m.timeout.initial)) + ctx.arc(0, -1, 0.45, -Math.PI / 2, -Math.PI / 2 + Math.PI * 2 * (1 - t)) ctx.stroke() ctx.translate(0, -1) |