diff --git a/src/admin-client/src/app.css b/src/admin-client/src/app.css index 7bb1a9f..e37a57d 100644 --- a/src/admin-client/src/app.css +++ b/src/admin-client/src/app.css @@ -52,6 +52,10 @@ section { .spacer { display: inline-block; width: 24px; } #pnlImportErrors { white-space: pre-wrap; color: var(--clrError); } +#cnvIcon { + width: 256px; height: 256px; background-color: black; +} + @font-face { font-display: swap; font-family: 'Open Sans'; diff --git a/src/admin-client/src/app.js b/src/admin-client/src/app.js index c94eb88..68d6848 100644 --- a/src/admin-client/src/app.js +++ b/src/admin-client/src/app.js @@ -1,4 +1,5 @@ import {feedUrls} from "./urls-debug.js"; +import {initGenIcon} from "./gen-icon.js"; const elmTxtServerUrl = document.getElementById("txtServerUrl"); const elmTxtApiKey = document.getElementById("txtApiKey"); @@ -31,6 +32,7 @@ const feedImportStats = { initParams(); initFeedImport(); +initGenIcon(); function initParams() { let stgs = null; diff --git a/src/admin-client/src/gen-icon.js b/src/admin-client/src/gen-icon.js new file mode 100644 index 0000000..c5dd35d --- /dev/null +++ b/src/admin-client/src/gen-icon.js @@ -0,0 +1,18 @@ +let elmCanvas, elmLink; + +export function initGenIcon() { + + // Get elements + elmCanvas = document.getElementById("cnvIcon"); + elmLink = document.getElementById("lnkSaveIcon"); + + // Draw parrot emoji + const ctx = elmCanvas.getContext("2d"); + ctx.font = "192px Arial"; + ctx.fillText("🦜", 36, 196); + + // Get PNG image and add to link as data URL + const dataURL = elmCanvas.toDataURL("image/png"); + elmLink.href = dataURL; + elmLink.download = "favicon-256.png"; +} diff --git a/src/admin-client/src/index.html b/src/admin-client/src/index.html index af08c57..bd33586 100644 --- a/src/admin-client/src/index.html +++ b/src/admin-client/src/index.html @@ -45,5 +45,12 @@