colorcoded favicon donut

This commit is contained in:
ed 2021-10-29 02:40:17 +02:00
parent cd5c56e601
commit 1cb0dc7f8e

View file

@ -490,7 +490,7 @@ function Donut(st) {
function svg(v) {
var ico = v !== undefined,
bg = ico ? '#333' : 'transparent';
bg = ico ? '#' + r.bg : 'transparent';
return (
'<svg version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">\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;