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

View File

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