Mercurial
diff mrjunejune/src/blog/wasm-bunny/index.html @ 100:65e5a5b89a4e
[Seobeo] Migrated everything to this page.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Sat, 03 Jan 2026 07:48:07 -0800 |
| parents | |
| children | 295ac2e5ec00 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mrjunejune/src/blog/wasm-bunny/index.html Sat Jan 03 07:48:07 2026 -0800 @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>WASM using c3</title> + {{/parts/base_head.html}} + <link rel="stylesheet" href="/tools/markdown_to_html/index.css" /> +</head> +<body> + {{/parts/header.html}} + <main> + <div id="content"></div> + <div style="display: flex; justify-content: center; align-items: center; height: 100vh;"> + <canvas id='bunnies'></canvas> + </div> + </main> + {{/parts/footer.html}} + <script src="/markdown_to_html.js"></script> + <script> + fetch('/blog/wasm-bunny/index.md').then(res => res.text()).then(text => renderMarkdown(content, text)); + </script> + <script src='/public/raylib.js'></script> + <script> + async function startRaylib() { + if (typeof RaylibJs !== 'undefined') { + const raylibjs = new RaylibJs(); + raylibjs.start({ + wasmPath: '/public/bunny.wasm', + canvasId: 'bunnies', + }); + } else { + console.error('RaylibJs is not loaded'); + } + } + + // Ensure raylib.js is loaded, then initialize + window.addEventListener('load', startRaylib); + </script> +</body>