diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..a2c00c5 Binary files /dev/null and b/favicon.png differ diff --git a/favicon.svg b/favicon.svg new file mode 100644 index 0000000..dae6b80 --- /dev/null +++ b/favicon.svg @@ -0,0 +1,121 @@ + + + + diff --git a/src/app.css b/src/app.css index 0f06bb4..aacfa9d 100644 --- a/src/app.css +++ b/src/app.css @@ -66,4 +66,10 @@ textarea, input, #output-graph { footer { grid-area: footer; margin: 1em 1em 0.5em 1em; +} + + +.icon { + max-width: 1.25em; + vertical-align: middle; } \ No newline at end of file diff --git a/src/esbuild.mjs b/src/esbuild.mjs index 65623d7..06c9130 100644 --- a/src/esbuild.mjs +++ b/src/esbuild.mjs @@ -9,6 +9,11 @@ import esbuild from 'esbuild'; const __dirname = import.meta.url.slice(7, import.meta.url.lastIndexOf("/")); const outdir = path.resolve(__dirname, "../dist"); +const copy = [ + "../favicon.png", + "../favicon.svg", +] + /** * Hashes the contents of a file. * @ref https://stackoverflow.com/a/44643479/1460422 @@ -34,7 +39,7 @@ async function do_html() { let algorithm = "sha256"; let css_hash = await hash_file(algorithm, path.join(outdir, "app.css")); let js_hash = await hash_file(algorithm, path.join(outdir, "app.js")); - + let html = (await fs.promises.readFile(path.join(__dirname, "index.html"), "utf-8")) .replace(/\{JS_HASH\}/g, js_hash) .replace(/\{CSS_HASH\}/g, css_hash) @@ -43,6 +48,13 @@ async function do_html() { .replace(/\{ALGO\}/g, algorithm); await fs.promises.writeFile(path.join(outdir, "index.html"), html); + + for (const filepath of copy) { + await fs.promises.copyFile( + path.join(__dirname, filepath), + path.join(outdir, path.basename(filepath)) + ) + } } (async () => { diff --git a/src/index.html b/src/index.html index 26d35f2..a6b2a7e 100644 --- a/src/index.html +++ b/src/index.html @@ -3,9 +3,15 @@