From 3aafb96af338d54d256a6e1dcbe9ef63126b4ab2 Mon Sep 17 00:00:00 2001 From: Nicholas Jitkoff Date: Fri, 10 Jun 2022 22:29:43 -0700 Subject: [PATCH] Add theme color support --- docs/index.html | 1 + docs/index.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/index.html b/docs/index.html index 8134a78..6d771f8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,6 +4,7 @@ + diff --git a/docs/index.js b/docs/index.js index 8e4ca24..77ccb9d 100644 --- a/docs/index.js +++ b/docs/index.js @@ -25,6 +25,10 @@ // ` } + function setThemeColor(color) { + document.getElementById("themeColor").content = color; + } + function setFavicon(favicon) { document.getElementById("favicon").href = 'data:image/svg+xml,'+ favicon + '' } @@ -48,6 +52,7 @@ console.debug("Message:", e.origin, e.data) if (e.data.title) document.title = e.data.title; if (e.data.favicon) setFavicon(e.data.favicon); + if (e.data.themeColor) setThemeColor(e.data.themeColor); if (e.data.updateURL) { let path = ["/" + e.data.title.replace(/\s/g, "-")]; if (e.data.description) path.push("d/" + encodeURIComponent(e.data.description));