framepress 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Raj Varsani
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,81 @@
1
- # Temporary Holding Version
1
+ # Framepress
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Export a WebGL page to a silent H.264 MP4, advancing the animation one frame at a time. Comes with three original shader studies. Ember is the default.
4
+
5
+ ![Ember shader](media/ember.png)
6
+
7
+ [Watch the six-second Ember render](media/ember.mp4)
8
+
9
+ ## Run
10
+
11
+ Requires Node 22+ and installed Google Chrome. FFmpeg downloads automatically with the dependencies.
12
+
13
+ ```sh
14
+ npx framepress --demo --out ember.mp4
15
+ ```
16
+
17
+ Record your own local page:
18
+
19
+ ```sh
20
+ npx framepress http://localhost:3000 --seconds 8 --fps 60 --out demo.mp4
21
+ ```
22
+
23
+ Install globally if you prefer:
24
+
25
+ ```sh
26
+ npm install -g framepress
27
+ framepress --demo
28
+ ```
29
+
30
+ ## Develop locally
31
+
32
+ ```sh
33
+ git clone https://github.com/RajVarsani/framepress.git
34
+ cd framepress
35
+ npm ci
36
+ npm run demo
37
+ ```
38
+
39
+ | Option | Default / behavior |
40
+ | --- | --- |
41
+ | `--demo` | Render a bundled shader study. No server required. |
42
+ | `--style` | `ember`; also `indexed` and `phosphor`. Applies to `--demo`. |
43
+ | `--out` | `demo.mp4`; existing files protected unless `--force`. |
44
+ | `--seconds` | `6`; up to 600, rounded to whole frames. |
45
+ | `--fps` | `60`; accepts 1–120. |
46
+ | `--width`, `--height` | `1280`, `720`; even dimensions required. |
47
+ | `--ready` | Wait for a visible CSS selector, e.g. `--ready canvas`. |
48
+ | `--browser` | Chromium executable path. Also accepts `CHROME_PATH`. |
49
+
50
+ ## Frame control
51
+
52
+ Before loading the page, the recorder replaces main-window `requestAnimationFrame` and `performance.now()`. Every captured frame gets its output timestamp, independent of how long rendering takes. Frames stream into FFmpeg without creating a frame folder. The CLI reports measured rendering speed.
53
+
54
+ For a scene you own, expose an explicit render hook:
55
+
56
+ ```js
57
+ window.__demoRender = (seconds) => {
58
+ mesh.rotation.y = seconds * Math.PI / 3;
59
+ renderer.render(scene, camera);
60
+ };
61
+ ```
62
+
63
+ The hook may return a promise. It replaces animation callback stepping. Wait for your assets before rendering or use `--ready` with an element your app reveals when loaded. Fonts are awaited automatically.
64
+
65
+ CSS/Web Animations, native timers, Date, workers, video playback, audio and XR loops are outside the controlled clock. Network data and randomness are not seeded. This is a frame exporter for compatible scenes, not a universal browser-time simulator. Existing page cursors are captured; no pointer is injected.
66
+
67
+ ## Included art
68
+
69
+ - **Ember:** warm luminous stipples, sparse engraved contours and bloom.
70
+ - **Indexed:** quarter-resolution, four-colour ordered dithering.
71
+ - **Phosphor:** green surface contours with a moving illumination pulse and bloom.
72
+
73
+ Original ribbon geometry and shaders. Technical background: [Maxime Heckel's dithering and retro-shading article](https://blog.maximeheckel.com/posts/the-art-of-dithering-and-retro-shading-web/).
74
+
75
+ ## Licence
76
+
77
+ MIT for this source. Dependencies and the downloaded FFmpeg binary retain their own licences; `ffmpeg-static` provides the binary's licence alongside it.
78
+
79
+ ## Publishing from GitHub Actions
80
+
81
+ The manual `publish.yml` workflow uses npm trusted publishing with OIDC. Once the package exists on npm, configure its trusted publisher as GitHub user `RajVarsani`, repository `framepress`, workflow `publish.yml`. Then bump the version, push the commit and run the workflow. No npm token is stored in GitHub.
package/bin/record.mjs ADDED
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from 'node:util';
3
+ import { chromium } from 'playwright-core';
4
+ import ffmpeg from 'ffmpeg-static';
5
+ import { spawn } from 'node:child_process';
6
+ import { once } from 'node:events';
7
+ import { access, mkdir, rename, rm } from 'node:fs/promises';
8
+ import { resolve, dirname } from 'node:path';
9
+ import { fileURLToPath, pathToFileURL } from 'node:url';
10
+
11
+ const help = `framepress <url> [options]
12
+ --demo Render a bundled art study
13
+ --style ember ember | indexed | phosphor
14
+ --out clip.mp4 Output path (default: demo.mp4)
15
+ --seconds 6 Duration
16
+ --fps 60 Frames per second (1–120)
17
+ --width 1280 --height 720
18
+ --ready '#canvas' Wait for a visible element before capture
19
+ --browser /path Chrome/Chromium executable (or CHROME_PATH)
20
+ --force Replace an existing output
21
+ --help
22
+
23
+ Uses installed Chrome. Streams frames into bundled FFmpeg.
24
+ Controls main-window requestAnimationFrame and performance.now.
25
+ For exact custom rendering expose window.__demoRender(timeInSeconds).
26
+ CSS animations, workers, video and native timers are not frame-locked.`;
27
+ let browser, encoder, partial;
28
+ let cancelled = false;
29
+ const cancel = () => { cancelled = true; encoder?.kill('SIGTERM'); void browser?.close(); };
30
+ process.once('SIGINT', cancel); process.once('SIGTERM', cancel);
31
+ try {
32
+ const { values: v, positionals } = parseArgs({ allowPositionals: true, options: {
33
+ demo: { type: 'boolean' }, style: { type: 'string', default: 'ember' }, out: { type: 'string', default: 'demo.mp4' },
34
+ seconds: { type: 'string', default: '6' }, fps: { type: 'string', default: '60' },
35
+ width: { type: 'string', default: '1280' }, height: { type: 'string', default: '720' },
36
+ ready: { type: 'string' }, browser: { type: 'string' }, force: { type: 'boolean' }, help: { type: 'boolean' },
37
+ }});
38
+ if (v.help) { console.log(help); process.exit(0); }
39
+ const width = Number(v.width), height = Number(v.height), fps = Number(v.fps), seconds = Number(v.seconds);
40
+ if (![width, height, fps].every(Number.isInteger) || width < 2 || height < 2 || width > 7680 || height > 7680 || width % 2 || height % 2 || fps < 1 || fps > 120 || !Number.isFinite(seconds) || seconds <= 0 || seconds > 600) throw Error('Use even dimensions 2–7680, fps 1–120 and duration 0–600 seconds.');
41
+ if ((!v.demo && positionals.length !== 1) || (v.demo && positionals.length)) throw Error(help);
42
+ if (!['indexed', 'phosphor', 'ember'].includes(v.style)) throw Error('Style must be ember, indexed or phosphor.');
43
+ const url = v.demo ? pathToFileURL(fileURLToPath(new URL(`../examples/${v.style}.html`, import.meta.url))).href : new URL(positionals[0]).href;
44
+ if (!['http:', 'https:', 'file:'].includes(new URL(url).protocol)) throw Error('URL must use http, https or file.');
45
+ const out = resolve(v.out);
46
+ if (!out.endsWith('.mp4')) throw Error('Output must end in .mp4');
47
+ let exists = false; try { await access(out); exists = true; } catch {}
48
+ if (exists && !v.force) throw Error(`${out} exists. Choose another path or use --force.`);
49
+ await mkdir(dirname(out), { recursive: true });
50
+ partial = `${out}.${process.pid}.partial.mp4`;
51
+ const start = performance.now();
52
+ const frames = Math.max(1, Math.round(seconds * fps));
53
+ console.log(`\n ◈ FRAMEPRESS\n ${width} × ${height} / ${fps} fps / ${frames} frames\n`);
54
+ browser = await chromium.launch({ headless: true, ...(v.browser || process.env.CHROME_PATH ? { executablePath: v.browser || process.env.CHROME_PATH } : { channel: 'chrome' }), args: ['--mute-audio'] });
55
+ const page = await browser.newPage({ viewport: { width, height }, deviceScaleFactor: 1 });
56
+ const errors = [];
57
+ page.on('pageerror', e => errors.push(e.message));
58
+ await page.addInitScript(() => {
59
+ let time = 0, next = 0;
60
+ const callbacks = new Map();
61
+ Object.defineProperty(performance, 'now', { value: () => time });
62
+ window.requestAnimationFrame = callback => { callbacks.set(++next, callback); return next; };
63
+ window.cancelAnimationFrame = id => callbacks.delete(id);
64
+ window.__recorderStep = async ms => {
65
+ time = ms;
66
+ if (typeof window.__demoRender === 'function') await window.__demoRender(ms / 1000);
67
+ else { const batch = [...callbacks.values()]; callbacks.clear(); for (const callback of batch) callback(ms); }
68
+ };
69
+ });
70
+ await page.goto(url, { waitUntil: 'load', timeout: 30000 });
71
+ // Prime applications that create their canvas inside the first animation frame.
72
+ await page.evaluate(() => window.__recorderStep(0));
73
+ if (v.ready) await page.locator(v.ready).waitFor({ state: 'visible', timeout: 15000 });
74
+ await page.evaluate(() => document.fonts.ready);
75
+ if (errors.length) throw Error(errors.join('\n'));
76
+ const cdp = await page.context().newCDPSession(page);
77
+ encoder = spawn(ffmpeg, ['-hide_banner', '-loglevel', 'error', '-y', '-f', 'image2pipe', '-vcodec', 'mjpeg', '-framerate', String(fps), '-i', 'pipe:0', '-an', '-c:v', 'libx264', '-preset', 'veryfast', '-crf', '17', '-pix_fmt', 'yuv420p', '-movflags', '+faststart', partial], { stdio: ['pipe', 'ignore', 'pipe'] });
78
+ let encodingError = ''; encoder.stderr.on('data', b => { encodingError = (encodingError + b).slice(-4000); });
79
+ encoder.stdin.on('error', () => {});
80
+ const encoded = new Promise((res, rej) => { encoder.once('error', rej); encoder.once('close', code => code === 0 ? res() : rej(Error(`FFmpeg exited ${code}: ${encodingError}`))); });
81
+ // Attach immediately so an early encoder failure cannot become an unhandled rejection.
82
+ encoded.catch(() => {});
83
+ for (let i = 0; i < frames; i++) {
84
+ if (cancelled) throw Error('Recording cancelled.');
85
+ if (encoder.exitCode !== null) throw Error(`FFmpeg stopped: ${encodingError}`);
86
+ await page.evaluate(ms => window.__recorderStep(ms), i * 1000 / fps);
87
+ if (errors.length) throw Error(errors.join('\n'));
88
+ const { data } = await cdp.send('Page.captureScreenshot', { format: 'jpeg', quality: 96, fromSurface: true });
89
+ if (!encoder.stdin.write(Buffer.from(data, 'base64'))) await Promise.race([once(encoder.stdin, 'drain'), encoded.then(() => { throw Error('Encoder ended before all frames were written.'); })]);
90
+ if (i % 30 === 0 || i === frames - 1) process.stdout.write(`\r ${'━'.repeat(Math.floor((i + 1) / frames * 24)).padEnd(24, '─')} ${Math.round((i + 1) / frames * 100)}%`);
91
+ }
92
+ encoder.stdin.end(); await encoded;
93
+ await rename(partial, out); partial = undefined;
94
+ const elapsed = (performance.now() - start) / 1000;
95
+ console.log(`\n\n ✓ ${out}\n ${(frames / elapsed).toFixed(1)} render fps · ${elapsed.toFixed(1)}s elapsed · ${(frames / fps).toFixed(2)}s video\n`);
96
+ } catch (e) { console.error(`\n ${e.message}`); process.exitCode = 1; }
97
+ finally {
98
+ encoder?.kill('SIGTERM'); await browser?.close().catch(() => {});
99
+ if (partial) await rm(partial, { force: true });
100
+ process.removeListener('SIGINT', cancel); process.removeListener('SIGTERM', cancel);
101
+ }
@@ -0,0 +1,77 @@
1
+ // Original ribbon, three material studies. No external runtime or media.
2
+ const style = document.querySelector('script[data-style]').dataset.style;
3
+ const mode = ['indexed', 'phosphor', 'ember'].indexOf(style);
4
+ const canvas = document.querySelector('canvas');
5
+ const low = mode === 0;
6
+ canvas.width = low ? Math.round(innerWidth / 4) : innerWidth;
7
+ canvas.height = low ? Math.round(innerHeight / 4) : innerHeight;
8
+ const gl = canvas.getContext('webgl', { antialias: false, preserveDrawingBuffer: true });
9
+ if (!gl) throw Error('WebGL unavailable');
10
+ const vs = `attribute vec2 uv;uniform float time,aspect;varying vec3 normal,world;varying vec2 coord;
11
+ vec3 shape(vec2 p){float u=p.x*6.2831853,v=p.y;float radius=1.45+.18*cos(3.*u);vec3 center=vec3(radius*cos(u),radius*sin(u),.40*sin(3.*u));vec3 across=normalize(vec3(cos(u)*cos(1.5*u),sin(u)*cos(1.5*u),sin(1.5*u)));return center+across*v*.63;}
12
+ vec3 turn(vec3 p){float a=time*6.2831853/6.;mat3 y=mat3(cos(a),0.,sin(a),0.,1.,0.,-sin(a),0.,cos(a));float b=.68;return mat3(1.,0.,0.,0.,cos(b),-sin(b),0.,sin(b),cos(b))*y*p;}
13
+ void main(){vec3 p=shape(uv);normal=normalize(turn(cross(shape(uv+vec2(.0001,0.))-p,shape(uv+vec2(0.,.0001))-p)));world=turn(p);coord=uv;float depth=5.-world.z;gl_Position=vec4(world.x*1.8/aspect,world.y*1.8,depth-2.,depth);}`;
14
+ const fs = `precision highp float;uniform float mode,time;varying vec3 normal,world;varying vec2 coord;
15
+ float hash(vec2 p){return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453);}
16
+ float bayer(vec2 p){vec2 a=mod(floor(p),4.);float v=0.;vec2 b=mod(a,2.);v=2.*b.x+3.*b.y-4.*b.x*b.y;a=floor(a/2.);v=4.*v+2.*a.x+3.*a.y-4.*a.x*a.y;return (v+.5)/16.;}
17
+ float line(float x,float w){return 1.-smoothstep(w,w+.10,abs(fract(x)-.5));}
18
+ void main(){vec3 n=normalize(normal);if(!gl_FrontFacing)n=-n;vec3 eye=normalize(vec3(0.,0.,5.)-world);float facing=abs(dot(n,eye));float light=dot(n,normalize(vec3(-1.2,2.,3.)))*.5+.5;
19
+ if(mode<.5){
20
+ float tone=clamp(.1+light*.54+pow(1.-facing,2.)*.28+pow(max(dot(reflect(-normalize(vec3(-1.,2.,3.)),n),eye),0.),18.)*.28,0.,.99);
21
+ float level=floor(tone*3.+bayer(gl_FragCoord.xy)*.85);
22
+ vec3 c=vec3(.16,.10,.28);if(level>.5)c=vec3(.46,.24,.60);if(level>1.5)c=vec3(.95,.43,.28);if(level>2.5)c=vec3(1.,.88,.57);
23
+ gl_FragColor=vec4(c,1.);
24
+ }else if(mode<1.5){
25
+ float contours=line(coord.y*14.,.035);
26
+ float longitudinal=line(coord.x*40.,.015);
27
+ float weave=max(contours,longitudinal*.28);
28
+ float edge=pow(1.-facing,3.)*.25;
29
+ float pulse=pow(.5+.5*cos(coord.x*6.2831853-time*6.2831853/6.),18.);
30
+ vec3 c=vec3(.48,1.,.14)*(weave*(.25+light*.5)+weave*pulse*.5+edge*.22);
31
+ c+=vec3(.025,.04,.008)*light;
32
+ gl_FragColor=vec4(c,1.);
33
+ }else{
34
+ // Closely packed etched contours, broken into a fixed stipple screen.
35
+ float bands=line(coord.y*14.+sin(coord.x*6.2831853*3.)*.8,.025);
36
+ vec2 grid=vec2(coord.x*240.,coord.y*48.);vec2 cell=floor(grid);
37
+ float grain=hash(cell);vec2 delta=fract(grid)-.5;float dots=exp(-dot(delta,delta)*(22.+grain*55.))*step(.28,grain);
38
+ float ridge=pow(1.-facing,2.5);
39
+ float brightness=bands*.045+dots*(.25+light*.65)+ridge*.025;
40
+ float hot=pow(.5+.5*sin(coord.x*6.2831853*2.-time*6.2831853/6.),8.);
41
+ vec3 c=mix(vec3(.65,.035,.09),vec3(1.,.49,.12),hot)*brightness;
42
+ c+=vec3(1.,.8,.45)*pow(brightness,3.)*.7;c*=3.2;
43
+ gl_FragColor=vec4(c,1.);
44
+ }}
45
+ `;
46
+ const postVS = `attribute vec2 p;varying vec2 q;void main(){q=p*.5+.5;gl_Position=vec4(p,0.,1.);}`;
47
+ const postFS = `precision highp float;uniform sampler2D image;uniform vec2 resolution;uniform float mode;varying vec2 q;
48
+ vec3 sampleAt(vec2 p){return texture2D(image,clamp(p,0.,1.)).rgb;}
49
+ void main(){vec3 c=sampleAt(q);vec2 uv=q-.5;
50
+ if(mode<.5){gl_FragColor=vec4(c,1.);return;}
51
+ vec3 blur=vec3(0.);float total=0.;
52
+ for(int i=-4;i<=4;i++)for(int j=-4;j<=4;j++){vec2 off=vec2(float(i),float(j));float w=exp(-dot(off,off)/8.);blur+=sampleAt(q+off*3./resolution)*w;total+=w;}
53
+ blur/=total;
54
+ vec3 bg=mode<1.5?vec3(.014,.022,.010):vec3(.027,.009,.026);
55
+ bg+=mode<1.5?vec3(.018,.025,.006)*exp(-dot(uv,uv)*6.):vec3(.025,.008,.016)*exp(-dot(uv,uv)*4.);
56
+ c+=blur*(mode<1.5?1.5:2.4);c+=bg;
57
+ if(mode<1.5){float scan=.95+.05*cos(q.y*resolution.y*3.14159);c*=scan;}
58
+ float vignette=1.-.45*dot(uv,uv);c*=vignette;
59
+ c=1.-exp(-c*1.8);gl_FragColor=vec4(pow(c,vec3(.85)),1.);
60
+ }`;
61
+ function shader(type,source){const s=gl.createShader(type);gl.shaderSource(s,source);gl.compileShader(s);if(!gl.getShaderParameter(s,gl.COMPILE_STATUS))throw Error(gl.getShaderInfoLog(s));return s;}
62
+ function program(v,f){const p=gl.createProgram();gl.attachShader(p,shader(gl.VERTEX_SHADER,v));gl.attachShader(p,shader(gl.FRAGMENT_SHADER,f));gl.linkProgram(p);if(!gl.getProgramParameter(p,gl.LINK_STATUS))throw Error(gl.getProgramInfoLog(p));return p;}
63
+ const art=program(vs,fs),post=program(postVS,postFS);
64
+ const points=[];for(let i=0;i<512;i++)for(let j=0;j<32;j++){const a=[i/512,j/16-1],b=[(i+1)/512,j/16-1],c=[i/512,(j+1)/16-1],d=[(i+1)/512,(j+1)/16-1];points.push(...a,...b,...c,...c,...b,...d);}
65
+ function buffer(data){const b=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,b);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(data),gl.STATIC_DRAW);return b;}
66
+ const mesh=buffer(points),quad=buffer([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]);
67
+ const texture=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,texture);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,canvas.width,canvas.height,0,gl.RGBA,gl.UNSIGNED_BYTE,null);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);
68
+ const depth=gl.createRenderbuffer();gl.bindRenderbuffer(gl.RENDERBUFFER,depth);gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_COMPONENT16,canvas.width,canvas.height);
69
+ const target=gl.createFramebuffer();gl.bindFramebuffer(gl.FRAMEBUFFER,target);gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,texture,0);gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,depth);if(gl.checkFramebufferStatus(gl.FRAMEBUFFER)!==gl.FRAMEBUFFER_COMPLETE)throw Error('Framebuffer incomplete');
70
+ function bind(p,b,name){gl.useProgram(p);gl.bindBuffer(gl.ARRAY_BUFFER,b);const a=gl.getAttribLocation(p,name);gl.enableVertexAttribArray(a);gl.vertexAttribPointer(a,2,gl.FLOAT,false,0,0);}
71
+ window.__demoRender=t=>{
72
+ gl.viewport(0,0,canvas.width,canvas.height);gl.bindFramebuffer(gl.FRAMEBUFFER,target);gl.enable(gl.DEPTH_TEST);
73
+ if(low)gl.clearColor(.065,.037,.11,1.);else gl.clearColor(0.,0.,0.,1.);
74
+ gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);bind(art,mesh,'uv');gl.uniform1f(gl.getUniformLocation(art,'time'),t);gl.uniform1f(gl.getUniformLocation(art,'aspect'),canvas.width/canvas.height);gl.uniform1f(gl.getUniformLocation(art,'mode'),mode);gl.drawArrays(gl.TRIANGLES,0,points.length/2);
75
+ gl.bindFramebuffer(gl.FRAMEBUFFER,null);gl.disable(gl.DEPTH_TEST);bind(post,quad,'p');gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,texture);gl.uniform1i(gl.getUniformLocation(post,'image'),0);gl.uniform2f(gl.getUniformLocation(post,'resolution'),canvas.width,canvas.height);gl.uniform1f(gl.getUniformLocation(post,'mode'),mode);gl.drawArrays(gl.TRIANGLES,0,6);gl.finish();
76
+ };
77
+ if(!window.__recorderStep){const tick=t=>{window.__demoRender(t/1000);requestAnimationFrame(tick)};requestAnimationFrame(tick);}
@@ -0,0 +1 @@
1
+ <!doctype html><html lang="en"><meta charset="utf-8"><title>Ember / luminous engraving</title><style>html,body{margin:0;overflow:hidden;background:#100c19}canvas{width:100vw;height:100vh;display:block;image-rendering:pixelated}</style><canvas aria-label="Ember / luminous engraving ribbon sculpture"></canvas><script src="./art-variants.js" data-style="ember"></script></html>
@@ -0,0 +1 @@
1
+ <!doctype html><html lang="en"><meta charset="utf-8"><title>Indexed / 4-colour dither</title><style>html,body{margin:0;overflow:hidden;background:#100c19}canvas{width:100vw;height:100vh;display:block;image-rendering:pixelated}</style><canvas aria-label="Indexed / 4-colour dither ribbon sculpture"></canvas><script src="./art-variants.js" data-style="indexed"></script></html>
@@ -0,0 +1 @@
1
+ <!doctype html><html lang="en"><meta charset="utf-8"><title>Phosphor / vector memory</title><style>html,body{margin:0;overflow:hidden;background:#100c19}canvas{width:100vw;height:100vh;display:block;image-rendering:pixelated}</style><canvas aria-label="Phosphor / vector memory ribbon sculpture"></canvas><script src="./art-variants.js" data-style="phosphor"></script></html>
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "framepress",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Frame-by-frame WebGL to MP4. One command, no frame folders.",
5
+ "type": "module",
6
+ "bin": {
7
+ "framepress": "bin/record.mjs"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "examples",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "engines": {
16
+ "node": ">=22"
17
+ },
18
+ "scripts": {
19
+ "demo": "node bin/record.mjs --demo --style ember --out ember.mp4"
20
+ },
21
+ "dependencies": {
22
+ "playwright-core": "1.65.1",
23
+ "ffmpeg-static": "5.3.0"
24
+ },
25
+ "license": "MIT",
26
+ "author": "Raj Varsani",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/RajVarsani/framepress.git"
30
+ },
31
+ "homepage": "https://github.com/RajVarsani/framepress#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/RajVarsani/framepress/issues"
34
+ },
35
+ "keywords": [
36
+ "webgl",
37
+ "mp4",
38
+ "threejs",
39
+ "recorder",
40
+ "shader"
41
+ ],
42
+ "publishConfig": {
43
+ "access": "public",
44
+ "registry": "https://registry.npmjs.org"
45
+ }
46
+ }