diff --git a/Energy_Pie/module.html b/Energy_Pie/module.html index 3952247..89b4a2e 100644 --- a/Energy_Pie/module.html +++ b/Energy_Pie/module.html @@ -144,43 +144,64 @@ } // --- donut card --- - function donutCard({ title, percent, subtitle, color }) { - const share = clamp01(percent / 100); - const r = 56; - const c = 2 * Math.PI * r; - const dash = share * c; - const gap = c - dash; +function donutCard({ title, percent, subtitle, color }) { + const share = clamp01(percent / 100); + const r = 56; + const c = 2 * Math.PI * r; + const dash = share * c; + const gap = c - dash; - return ` -
-
- - - - + return ` +
-
-
- ${escapeHtml(percent.toFixed(1))}% -
-
- ${escapeHtml(title)} -
-
- ${escapeHtml(subtitle)} -
-
+ +
+ ${escapeHtml(title)} +
+ + +
+ + + + + + +
+ ${escapeHtml(percent.toFixed(1))}%
- `; - } + + +
+ ${escapeHtml(subtitle)} +
+
+ `; +} function render(data) { const values = data?.values || {}; @@ -235,8 +256,6 @@ }) ].join(''); - elDbg.textContent = `Letzte Daten: ${new Date().toLocaleTimeString()} · range=${data?.range ?? '-'} · date=${data?.date ?? '-'}`; - elErr.textContent = ''; } // --- cache ---