Skip to content

Commit

Permalink
future proof demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jerch committed Oct 4, 2024
1 parent 7907f13 commit b0389a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion demo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ <h3>Test</h3>
<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>
Expand Down

0 comments on commit b0389a2

Please sign in to comment.