future proof demo

This commit is contained in:
Jörg Breitbart
2024-10-04 05:31:47 +02:00
parent 7907f13774
commit b0389a2ed1
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -1430,12 +1430,14 @@ function testEvents(): void {
}
function testWebfonts() {
document.getElementById('webfont-kongtime').addEventListener('click', async () => {
document.getElementById('webfont-kongtext').addEventListener('click', async () => {
const ff = new FontFace('Kongtext', "url(/kongtext.regular.ttf) format('truetype')");
await loadFonts([ff]);
term.options.fontFamily = 'Kongtext';
term.options.lineHeight = 1.3;
addons.fit.instance?.fit();
setTimeout(() => term.write('\x1b[?12h\x1b]12;#776CF9\x07\x1b[38;2;119;108;249;48;2;21;8;150m\x1b[2J\x1b[2;5H**** COMMODORE 64 BASIC V2 ****\r\n\r\n 64K RAM SYSTEM 38911 BASIC BYTES FREE\r\n\r\nREADY.\r\nLOAD '), 1000);
setTimeout(() => {term.write('🤣\x1b[m\x1b[99;1H'); term.input('\r');}, 5000);
});
document.getElementById('webfont-bpdots').addEventListener('click', async () => {
document.styleSheets[0].insertRule("@font-face { font-family: 'BPdots'; src: url(/bpdots.regular.otf) format('opentype'); weight: 400 }", 0);
+2 -2
View File
@@ -118,8 +118,8 @@
<dd><button id="event-blur">blur</button></dd>
<dt>Webfonts</dt>
<dd><button id="webfont-kongtime">Kongtext (JS)</button></dd>
<dd><button id="webfont-bpdots">BPdots (CSS)</button></dd>
<dd><button id="webfont-kongtext">The future is near! (from JS)</button></dd>
<dd><button id="webfont-bpdots">BPdots (from CSS)</button></dd>
</dl>
</div>
</div>