Optimize the code

This commit is contained in:
Ember 2021-12-18 19:24:50 -05:00
parent f1ddad807c
commit 63974723d7
No known key found for this signature in database
GPG key ID: D84A93D6860F93FD
6 changed files with 36 additions and 12 deletions

2
.gitattributes vendored
View file

@ -3,4 +3,4 @@
*.woff filter=lfs diff=lfs merge=lfs -text
*.woff2 filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
static/miniquad.js filter=lfs diff=lfs merge=lfs -text
static/glow/glow.js filter=lfs diff=lfs merge=lfs -text

View file

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=525">
<title>{{ site.title }}</title>
<link rel="stylesheet" href="{{ site.base_url }}/static/landing-style.css"/>
<link rel="stylesheet" href="{{ site.base_url }}/static/landing-style.css?1"/>
<link rel="stylesheet" href="{{ site.base_url }}/static/common-style.css"/>
<meta property="twitter:card" content="summary_large_image" />
<meta property="og:site_name" content="Ember's Homepage" />
@ -18,10 +18,34 @@
</head>
<body>
<div>
<canvas id="glcanvas" tabindex='1'></canvas>
<!-- Downloaded from https://not-fl3.github.io/miniquad-samples/gl.js -->
<script src="{{ site.base_url }}/static/miniquad.js"></script>
<script>load("{{ site.base_url }}/static/glow.wasm");</script>
<canvas id="canvas"></canvas>
<script type="module">
import init, {create, cycle, check_resize} from '{{ site.base_url }}/static/glow/glow.js';
async function run() {
await init();
let dd = await create();
async function resize() {
let canvas = document.getElementById("canvas");
if(
canvas.width != canvas.clientWidth ||
canvas.height != canvas.clientHeight
) {
canvas.width = canvas.clientWidth
canvas.height = canvas.clientHeight
check_resize(dd)
}
}
resize();
setInterval(cycle, 33, dd);
setInterval(resize, 500);
}
run()
</script>
</div>
<header>
<p>Welcome to</p>

BIN
static/glow.wasm (Stored with Git LFS)

Binary file not shown.

BIN
static/glow/glow.js (Stored with Git LFS) Normal file

Binary file not shown.

BIN
static/glow/glow_bg.wasm (Stored with Git LFS) Normal file

Binary file not shown.

BIN
static/miniquad.js (Stored with Git LFS)

Binary file not shown.