From 1cb0dc7f8e28182763c1909ab41ce062bb7b072a Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 29 Oct 2021 02:40:17 +0200 Subject: [PATCH] colorcoded favicon donut --- copyparty/web/up2k.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index cbecaa48..3fca9811 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -490,7 +490,7 @@ function Donut(st) { function svg(v) { var ico = v !== undefined, - bg = ico ? '#333' : 'transparent'; + bg = ico ? '#' + r.bg : 'transparent'; return ( '\n' + @@ -504,6 +504,7 @@ function Donut(st) { r.on = function (ya) { r.fc = 99; + r.bg = '333'; r.base = st.bytes.finished; optab.innerHTML = ya ? svg() : optab.getAttribute('ico'); el = QS('#ops a .donut'); @@ -1117,6 +1118,9 @@ function up2k_init(subtle) { continue; } + if (a == t.length - 1) + donut.bg = eta < 10 ? 'da0' : eta < 30 ? '380' : eta < 60 ? '048' : '333'; + if (etaskip) continue;