Support dynamic dark/light themes

This commit is contained in:
2022-03-30 19:35:26 +02:00
parent e18e4303b3
commit 13f697e5de
45 changed files with 194 additions and 261 deletions

View File

@@ -2,6 +2,7 @@
import { onDestroy, onMount } from "svelte";
import { formatDataVolume, formatThousands, formatDate, formatNumber, formatDuration } from "../util/Formatting.svelte";
import Chart from "../util/Chart.svelte";
import { color_by_name } from "../util/Util.svelte";
let graphViews
let graphBandwidth
@@ -115,15 +116,15 @@ onMount(() => {
label: "Bandwidth (free)",
borderWidth: 2,
pointRadius: 0,
borderColor: "#"+window.style.highlightColor,
backgroundColor: "#"+window.style.highlightColor,
borderColor: color_by_name("highlight_color"),
backgroundColor: color_by_name("highlight_color"),
},
{
label: "Bandwidth (premium)",
borderWidth: 2,
pointRadius: 0,
borderColor: "#"+window.style.dangerColor,
backgroundColor: "#"+window.style.dangerColor,
borderColor: color_by_name("danger_color"),
backgroundColor: color_by_name("danger_color"),
},
];
graphViews.data().datasets = [
@@ -131,15 +132,15 @@ onMount(() => {
label: "Views",
borderWidth: 2,
pointRadius: 0,
borderColor: "#"+window.style.highlightColor,
backgroundColor: "#"+window.style.highlightColor,
borderColor: color_by_name("highlight_color"),
backgroundColor: color_by_name("highlight_color"),
},
{
label: "Downloads",
borderWidth: 2,
pointRadius: 0,
borderColor: "#"+window.style.dangerColor,
backgroundColor: "#"+window.style.dangerColor,
borderColor: color_by_name("danger_color"),
backgroundColor: color_by_name("danger_color"),
},
];