Skip to content

Commit 38ba425

Browse files
committed
feat(ui): add new components
This commit adds the following components: - Glyph
1 parent 8e083d2 commit 38ba425

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/UI/Components/Glyph.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Component } from "../../util/Component.js";
2+
3+
export default def(class Glyph extends Component {
4+
static ID = 'ui.component.Glyph';
5+
6+
static PROPERTIES = {
7+
size: {
8+
value: 24,
9+
},
10+
codepoint: {
11+
value: '✅',
12+
},
13+
}
14+
15+
static CSS = `
16+
div {
17+
text-align: center;
18+
}
19+
`;
20+
21+
create_template ({ template }) {
22+
template.innerHTML = /*html*/`
23+
<div style="font-size: ${this.get('size')}px;">
24+
${this.get('codepoint')}
25+
</div>
26+
`;
27+
}
28+
});

src/init_async.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ logger.info('start -> async initialization');
33

44
import './util/TeePromise.js';
55
import './util/Component.js';
6+
import './UI/Components/Glyph.js';
67

78
logger.info('end -> async initialization');
89
globalThis.init_promise.resolve();

0 commit comments

Comments
 (0)