68d072bProject picker landing page with per-project file systemsJeremy Magland 1/** A sample PNG, generated on the fly, to exercise the binary file path. */
2export async function generateSampleImage(): Promise<Uint8Array> {
3 const canvas = document.createElement('canvas');
4 canvas.width = 320;
5 canvas.height = 200;
6 const ctx = canvas.getContext('2d')!;
7 const gradient = ctx.createLinearGradient(0, 0, 320, 200);
8 gradient.addColorStop(0, '#0078d4');
9 gradient.addColorStop(1, '#4ec9b0');
10 ctx.fillStyle = gradient;
11 ctx.fillRect(0, 0, 320, 200);
12 ctx.fillStyle = 'white';
13 ctx.font = 'bold 28px sans-serif';
14 ctx.textAlign = 'center';
15 ctx.fillText('minwebide', 160, 108);
16 const blob = await new Promise<Blob>((resolve, reject) =>
17 canvas.toBlob(b => b ? resolve(b) : reject(new Error('toBlob failed')), 'image/png'));
18 return new Uint8Array(await blob.arrayBuffer());
19}