From 38ba42575ce9f3506f8ce219b9580202b3ed9993 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Thu, 30 May 2024 16:03:03 -0400 Subject: [PATCH] feat(ui): add new components This commit adds the following components: - Glyph --- src/UI/Components/Glyph.js | 28 ++++++++++++++++++++++++++++ src/init_async.js | 1 + 2 files changed, 29 insertions(+) create mode 100644 src/UI/Components/Glyph.js diff --git a/src/UI/Components/Glyph.js b/src/UI/Components/Glyph.js new file mode 100644 index 000000000..2d58dadfc --- /dev/null +++ b/src/UI/Components/Glyph.js @@ -0,0 +1,28 @@ +import { Component } from "../../util/Component.js"; + +export default def(class Glyph extends Component { + static ID = 'ui.component.Glyph'; + + static PROPERTIES = { + size: { + value: 24, + }, + codepoint: { + value: '✅', + }, + } + + static CSS = ` + div { + text-align: center; + } + `; + + create_template ({ template }) { + template.innerHTML = /*html*/` +
+ ${this.get('codepoint')} +
+ `; + } +}); diff --git a/src/init_async.js b/src/init_async.js index 212310431..b738b9aa9 100644 --- a/src/init_async.js +++ b/src/init_async.js @@ -3,6 +3,7 @@ logger.info('start -> async initialization'); import './util/TeePromise.js'; import './util/Component.js'; +import './UI/Components/Glyph.js'; logger.info('end -> async initialization'); globalThis.init_promise.resolve();