mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
update epoxy and remove lag
This commit is contained in:
parent
cd1128c896
commit
a1abb6c494
3 changed files with 10 additions and 94 deletions
|
@ -28,7 +28,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fastify/static": "^8.0.1",
|
"@fastify/static": "^8.0.1",
|
||||||
"@mercuryworkshop/bare-as-module3": "^2.2.2",
|
"@mercuryworkshop/bare-as-module3": "^2.2.2",
|
||||||
"@mercuryworkshop/epoxy-transport": "^2.1.16",
|
"@mercuryworkshop/epoxy-transport": "^2.1.17",
|
||||||
"@mercuryworkshop/libcurl-transport": "^1.3.10",
|
"@mercuryworkshop/libcurl-transport": "^1.3.10",
|
||||||
"@rsdoctor/rspack-plugin": "^0.4.6",
|
"@rsdoctor/rspack-plugin": "^0.4.6",
|
||||||
"@rspack/cli": "^1.0.10",
|
"@rspack/cli": "^1.0.10",
|
||||||
|
|
18
pnpm-lock.yaml
generated
18
pnpm-lock.yaml
generated
|
@ -40,8 +40,8 @@ importers:
|
||||||
specifier: ^2.2.2
|
specifier: ^2.2.2
|
||||||
version: 2.2.2
|
version: 2.2.2
|
||||||
'@mercuryworkshop/epoxy-transport':
|
'@mercuryworkshop/epoxy-transport':
|
||||||
specifier: ^2.1.16
|
specifier: ^2.1.17
|
||||||
version: 2.1.16
|
version: 2.1.17
|
||||||
'@mercuryworkshop/libcurl-transport':
|
'@mercuryworkshop/libcurl-transport':
|
||||||
specifier: ^1.3.10
|
specifier: ^1.3.10
|
||||||
version: 1.3.10(typescript@5.6.3)
|
version: 1.3.10(typescript@5.6.3)
|
||||||
|
@ -223,11 +223,11 @@ packages:
|
||||||
'@mercuryworkshop/bare-mux@2.1.2':
|
'@mercuryworkshop/bare-mux@2.1.2':
|
||||||
resolution: {integrity: sha512-RKjvM+3Ly2QK5U+AVyMSeJPyaU+xEfjoJDf97XJ9lohs9/JrbfFWeO7Nf65qfL+3WEAjvGzi/oWdN90rWKh1bw==}
|
resolution: {integrity: sha512-RKjvM+3Ly2QK5U+AVyMSeJPyaU+xEfjoJDf97XJ9lohs9/JrbfFWeO7Nf65qfL+3WEAjvGzi/oWdN90rWKh1bw==}
|
||||||
|
|
||||||
'@mercuryworkshop/epoxy-tls@2.1.8-1':
|
'@mercuryworkshop/epoxy-tls@2.1.9-1':
|
||||||
resolution: {integrity: sha512-om8EtaoGhghLWFFzueAAUBgKzBzCJzkrqnT5xCyQfJuXRiyBb1aaKejjUWpHF6knEjNVyKejc6kAEW6gX2SA0A==}
|
resolution: {integrity: sha512-BB+dT1ChgEVLr1A0ZV7vJvvcaSB/UUIJFcHRK+AOHnmU8nbbHna6qdXdP0MjO00sd/8vWS0BaBIEmkhItbclKw==}
|
||||||
|
|
||||||
'@mercuryworkshop/epoxy-transport@2.1.16':
|
'@mercuryworkshop/epoxy-transport@2.1.17':
|
||||||
resolution: {integrity: sha512-3DQk+5inJt9dVdaz9D6s+BWJVAzePOBXSOmyQ1BbwVsY1KCpEOkmPoeEHK7MBx28kDPCfDICHNiI2YyrUqS3Fw==}
|
resolution: {integrity: sha512-z9qGWH/5J5jY54zyHJ3ZUdf9vxe0OJIn4GQCg332uNOqWUad/vPOw0Sql7PCyA6Y158K6AHPXBNwSeQTUYoG6g==}
|
||||||
|
|
||||||
'@mercuryworkshop/libcurl-transport@1.3.10':
|
'@mercuryworkshop/libcurl-transport@1.3.10':
|
||||||
resolution: {integrity: sha512-XLSkk1n4uMu6M0sS5Rh5ZNT7dBGILHDneJYD9oOpWMU5yxzNDlwcmJggNaYqMfH7B8jjLmw5sK2gPU5hDFPAVg==}
|
resolution: {integrity: sha512-XLSkk1n4uMu6M0sS5Rh5ZNT7dBGILHDneJYD9oOpWMU5yxzNDlwcmJggNaYqMfH7B8jjLmw5sK2gPU5hDFPAVg==}
|
||||||
|
@ -2765,11 +2765,11 @@ snapshots:
|
||||||
|
|
||||||
'@mercuryworkshop/bare-mux@2.1.2': {}
|
'@mercuryworkshop/bare-mux@2.1.2': {}
|
||||||
|
|
||||||
'@mercuryworkshop/epoxy-tls@2.1.8-1': {}
|
'@mercuryworkshop/epoxy-tls@2.1.9-1': {}
|
||||||
|
|
||||||
'@mercuryworkshop/epoxy-transport@2.1.16':
|
'@mercuryworkshop/epoxy-transport@2.1.17':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@mercuryworkshop/epoxy-tls': 2.1.8-1
|
'@mercuryworkshop/epoxy-tls': 2.1.9-1
|
||||||
|
|
||||||
'@mercuryworkshop/libcurl-transport@1.3.10(typescript@5.6.3)':
|
'@mercuryworkshop/libcurl-transport@1.3.10(typescript@5.6.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
|
@ -31,25 +31,6 @@ export function errorTemplate(trace: string, fetchedURL: string) {
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
|
||||||
--doomfire-mult: 1;
|
|
||||||
--doomfire-pixel-size: 3;
|
|
||||||
background-image: paint(doomfire);
|
|
||||||
animation: mult 0.03s infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes mult {
|
|
||||||
0% {
|
|
||||||
--doomfire-mult: 1.1;
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
--doomfire-mult: 1.2;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
--doomfire-mult: 1.1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea,
|
textarea,
|
||||||
button {
|
button {
|
||||||
background-color: var(--shallow);
|
background-color: var(--shallow);
|
||||||
|
@ -157,71 +138,6 @@ export function errorTemplate(trace: string, fetchedURL: string) {
|
||||||
<button id="reload" class="primary">Reload</button>
|
<button id="reload" class="primary">Reload</button>
|
||||||
</div>
|
</div>
|
||||||
<p id="version-wrapper"><i>Scramjet v<span id="version"></span> (build <span id="build"></span>)</i></p>
|
<p id="version-wrapper"><i>Scramjet v<span id="version"></span> (build <span id="build"></span>)</i></p>
|
||||||
<script>
|
|
||||||
CSS.paintWorklet.addModule(\`data:application/javascript;charset=utf8,${encodeURIComponent(`
|
|
||||||
const HTML_COLOR_SCALE = [
|
|
||||||
'#080202', '#1f0707', '#2f0f07',
|
|
||||||
'#470f07', '#571707', '#671f07',
|
|
||||||
'#771f07', '#8f2707', '#9f2f07',
|
|
||||||
'#af3f07', '#bf4707', '#c74707',
|
|
||||||
'#DF4F07', '#DF5707', '#DF5707',
|
|
||||||
'#D75F07', '#D7670F', '#cf6f0f',
|
|
||||||
'#cf770f', '#cf7f0f', '#CF8717',
|
|
||||||
'#C78717', '#C78F17', '#C7971F',
|
|
||||||
'#BF9F1F', '#BF9F1F', '#BFA727',
|
|
||||||
'#BFA727', '#BFAF2F', '#B7AF2F',
|
|
||||||
'#B7B72F', '#B7B737', '#CFCF6F',
|
|
||||||
'#DFDF9F', '#EFEFC7', '#FFFFFF',
|
|
||||||
];
|
|
||||||
|
|
||||||
const PROPERTY_PIXEL_SIZE = '--doomfire-pixel-size';
|
|
||||||
const PROPERTY_MULT = '--doomfire-mult';
|
|
||||||
|
|
||||||
class DoomFire {
|
|
||||||
static get inputProperties() {
|
|
||||||
return [
|
|
||||||
PROPERTY_PIXEL_SIZE,
|
|
||||||
PROPERTY_MULT
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
paint(ctx, geom, properties) {
|
|
||||||
const size = Math.max(parseInt(properties.get(PROPERTY_PIXEL_SIZE) * properties.get(PROPERTY_MULT)), 1);
|
|
||||||
const num_rows = Math.trunc(geom.height / size);
|
|
||||||
const num_cols = Math.trunc(geom.width / size);
|
|
||||||
const num_pixels = num_rows * num_cols;
|
|
||||||
let flames = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < num_pixels; i++) {
|
|
||||||
flames[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.fillStyle = HTML_COLOR_SCALE[HTML_COLOR_SCALE.length - 1];
|
|
||||||
const bottom_row = (num_rows - 1) * num_cols;
|
|
||||||
for (let x = 0; x < num_cols; x++) {
|
|
||||||
flames[bottom_row + x] = HTML_COLOR_SCALE.length - 1;
|
|
||||||
ctx.fillRect(x * size, bottom_row * size, size + 1, size + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let y = num_rows - 2; y > 0; y--) {
|
|
||||||
const row_start = y * num_cols;
|
|
||||||
const previous_row_start = (y + 1) * num_cols;
|
|
||||||
for (let x = 0; x < num_cols; x++) {
|
|
||||||
const rand = Math.trunc(Math.random() * 3);
|
|
||||||
const src_x = Math.min(Math.max(x + rand - 1, 0), num_cols - 1);
|
|
||||||
const src_color = flames[previous_row_start + src_x];
|
|
||||||
const dst_color = Math.max(src_color - (rand & 1), 0);
|
|
||||||
flames[row_start + x] = dst_color;
|
|
||||||
ctx.fillStyle = HTML_COLOR_SCALE[dst_color];
|
|
||||||
ctx.fillRect(x * size, y * size, size + 1, size + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
registerPaint('doomfire', DoomFire);
|
|
||||||
console.log("done");
|
|
||||||
`)}\`)
|
|
||||||
</script>
|
|
||||||
<script src="${"data:application/javascript," + encodeURIComponent(script)}"></script>
|
<script src="${"data:application/javascript," + encodeURIComponent(script)}"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue