Further smushing

This commit is contained in:
Rezmason
2023-08-25 09:17:06 -07:00
parent 839e261727
commit 428f1d7d16
7 changed files with 9 additions and 34 deletions

0
.gitmodules vendored
View File

View File

@@ -1,6 +0,0 @@
TODO:
Simplify!
Get as much into one file as you possibly can
Remove regl
Record WebGL debug calls

View File

@@ -17,10 +17,6 @@
background: black;
overflow: hidden;
margin: 0;
font-family: monospace;
font-size: 2em;
text-align: center;
}
canvas {
@@ -29,5 +25,8 @@
}
</style>
</head>
<body><script type="module" src="js/main.js"></script></body>
<body>
<canvas></canvas>
<script type="module" src="main.js"></script>
</body>
</html>

View File

@@ -1,23 +1,10 @@
import { init, load, resize, draw } from "./unraveled.js";
const canvas = document.createElement("canvas");
document.body.appendChild(canvas);
document.addEventListener("touchmove", (e) => e.preventDefault(), {
passive: false,
});
document.body.onload = async () => {
const dimensions = { width: 1, height: 1 };
const loadJS = (src) =>
new Promise((resolve, reject) => {
const tag = document.createElement("script");
tag.onload = resolve;
tag.onerror = reject;
tag.src = src;
document.body.appendChild(tag);
});
const start = async () => {
document.addEventListener("touchmove", (e) => e.preventDefault(), { passive: false });
const canvas = document.querySelector("canvas");
const dimensions = { width: 1, height: 1 };
const resizeViewport = () => {
const devicePixelRatio = window.devicePixelRatio ?? 1;
@@ -31,7 +18,7 @@ const start = async () => {
const image = new Image();
image.crossOrigin = "anonymous";
image.src = "./assets/matrixcode_msdf.png";
image.src = "msdf.png";
await image.decode();
const palette = [
@@ -74,7 +61,3 @@ const start = async () => {
update();
};
document.body.onload = () => {
start();
};

View File

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -1 +0,0 @@
prettier --write --use-tabs --print-width 160 "index.html" "./js/**/**.js" "./lib/gpu-buffer.js"