Modernise website by migrating to vite

This commit is contained in:
Andras Schmelczer 2026-05-03 17:09:30 +01:00
commit f350b1ff37
34 changed files with 3185 additions and 21045 deletions

View file

@ -1,19 +0,0 @@
const setIndexAlias = (name: string, index: number, type: any) => {
if (!Object.prototype.hasOwnProperty.call(type.prototype, name)) {
Object.defineProperty(type.prototype, name, {
get() {
return this[index];
},
set(value) {
this[index] = value;
},
});
}
};
export const applyArrayPlugins = () => {
setIndexAlias('x', 0, Array);
setIndexAlias('y', 1, Array);
setIndexAlias('x', 0, Float32Array);
setIndexAlias('y', 1, Float32Array);
};

View file

@ -1,14 +1,17 @@
import { CopyPipeline } from '../../pipelines/copy/copy-pipeline';
import { vec2 } from 'gl-matrix';
import { CopyPipeline } from '../../pipelines/copy/copy-pipeline';
export class ResizableTexture {
private texture: GPUTexture;
private textureView: GPUTextureView;
private readonly copyPipeline: CopyPipeline;
private size: vec2 | null = null;
public constructor(private readonly device: GPUDevice, size: vec2) {
public constructor(
private readonly device: GPUDevice,
size: vec2
) {
this.copyPipeline = new CopyPipeline(this.device);
this.resize(size);
}
@ -21,8 +24,8 @@ export class ResizableTexture {
const newTexture = this.device.createTexture({
format: 'rgba16float',
size: {
width: size.x,
height: size.y,
width: size[0],
height: size[1],
},
usage:
GPUTextureUsage.STORAGE_BINDING |

View file

@ -1,7 +1,7 @@
import { rgb } from './rgb';
import { vec3 } from 'gl-matrix';
import { rgb } from './rgb';
export const hsl = (hue: number, saturation: number, lightness: number): vec3 => {
hue /= 360;
saturation /= 100;

View file

@ -2,7 +2,7 @@ export const persist = <T extends Record<string, number>>(wrapee: T): T => {
const keys = Object.keys(wrapee);
keys.sort();
const keysToShortKeys = Object.fromEntries(keys.map((key, i) => [key, key]));
const keysToShortKeys = Object.fromEntries(keys.map((key) => [key, key]));
const params = new URLSearchParams(window.location.search);
const newParams = new URLSearchParams();