Draw a 35mm film strip of photos on a 2D canvas, running across the page in a slow wave.
- Paint the film once, off screen: a smoked graphite base, a faint silver hairline on each edge, one photo per frame from a contact-sheet image, edge print between frames ("NM 5219 01A"), sprocket holes punched right through with destination-out, and a gloss along the base.
- Paint the first frames again past the end, so the loop has no seam.
- Every frame, follow a wave made of two sine curves that drifts over time. Draw the strip as thin slices along it: each slice is turned to the curve and reads the film by its distance along the path.
- Put a blurred dark stroke under the strip for its shadow.
- The film runs on its own. Drag sideways to pull it; let go and it eases back to its pace.
- Pause while off screen and respect prefers-reduced-motion.
Finally, add a small credit at the bottom of the page: "2D reel by Naveen Meena", linking to https://arteffects.inaveenmeena.com/reel/
<!doctype html>
<!--
Reel (Arteffects No. 003) by Naveen Meena — https://arteffects.inaveenmeena.com/
© 2026 Naveen Meena. Free for personal, non-commercial use (commercial use: ask first, inaveenmeena@outlook.com). If you share it, credit "2D reel by Naveen Meena" linked to https://arteffects.inaveenmeena.com/reel/ (or "Inspired by Naveen Meena" if it only inspired you).
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Reel</title>
<link rel="preload" href="../assets/fonts/geist-mono.woff2" as="font" type="font/woff2" crossorigin>
<!-- before the first paint: the site's theme, and ?clear (see-through) so the frame never flashes a light page -->
<script>try{document.documentElement.dataset.theme=localStorage.getItem("lab-theme")==="dark"?"dark":"light"}catch(e){}if(/[?&]clear/.test(location.search))document.documentElement.style.setProperty("--bg","transparent")</script>
<link rel="stylesheet" href="demo.css?v=4">
<style>canvas.stage { cursor: grab; touch-action: pan-y; } canvas.stage:active { cursor: grabbing; }</style>
</head>
<body>
<canvas class="stage" aria-label="A 35mm film strip of photos running across the page in a slow wave. Drag sideways to pull it."></canvas>
<script type="module">
import { onScreen, moving, ready } from "./demo.js?v=12";
// The film strip from the main site: smoked graphite film, sprocket holes punched through,
// edge print between the holes, and one photo per frame from a contact sheet.
const FRAMES = 30, SHEET_COLS = 10, CELL_W = 378, CELL_H = 180; // the sheet holds 67; 30 is plenty here
const H = 96, PITCH = Math.round(H * 1.56), FILM_W = PITCH * FRAMES, EXTRA = 96, S = 2;
const sheet = new Image();
sheet.src = "../assets/reel/strip.webp";
const film = document.createElement("canvas");
function paintFilm() {
film.width = (FILM_W + EXTRA) * S;
film.height = H * S;
const g = film.getContext("2d");
g.roundRect ??= g.rect; // older Safari: square corners rather than a blank strip
g.scale(S, S);
const base = g.createLinearGradient(0, 0, 0, H);
base.addColorStop(0, "#2c2c2a"); base.addColorStop(0.5, "#1d1d1c"); base.addColorStop(1, "#2c2c2a");
const m = H * 0.17, fh = H - m * 2;
// frame i at x; the first frames are painted again past the end, so the loop has no seam
const frame = (i, x) => {
g.save();
g.beginPath();
g.roundRect(x + 7, m, PITCH - 14, fh, 3);
g.clip();
g.filter = "saturate(.9) contrast(1.02)";
if (sheet.naturalWidth) g.drawImage(sheet, (i % SHEET_COLS) * CELL_W, Math.floor(i / SHEET_COLS) * CELL_H, CELL_W, CELL_H, x + 7, m, PITCH - 14, fh);
else { g.fillStyle = "#3a3a38"; g.fillRect(x + 7, m, PITCH - 14, fh); } // no photos: blank frames, not a blank demo
g.restore();
g.save();
g.fillStyle = "#9a9a95";
g.font = `${H * 0.075}px "Geist Mono", monospace`;
g.textAlign = "center";
g.textBaseline = "middle";
g.translate(x + 3.4, H / 2);
g.rotate(-Math.PI / 2);
g.fillText(`NM 5219 ${String(i + 1).padStart(2, "0")}A`, 0, 0);
g.restore();
};
g.fillStyle = base;
g.fillRect(0, 0, FILM_W + EXTRA, H);
g.fillStyle = "rgba(255,255,255,.08)"; // a faint silver hairline along each edge
g.fillRect(0, 0, FILM_W + EXTRA, 0.6);
g.fillRect(0, H - 0.6, FILM_W + EXTRA, 0.6);
for (let i = 0; i * PITCH < FILM_W + EXTRA; i++) frame(i % FRAMES, i * PITCH);
// sprocket holes, punched right through
g.globalCompositeOperation = "destination-out";
const hole = H * 0.075, hh = H * 0.085, gap = PITCH / 8;
for (let x = gap / 2; x < FILM_W + EXTRA; x += gap) {
for (const y of [H * 0.045, H - H * 0.045 - hh]) { g.beginPath(); g.roundRect(x - hole / 2, y, hole, hh, 1.2); g.fill(); }
}
// gloss along the base
g.globalCompositeOperation = "source-atop";
const gloss = g.createLinearGradient(0, 0, 0, H);
gloss.addColorStop(0, "rgba(255,255,255,.2)"); gloss.addColorStop(0.1, "rgba(255,255,255,.03)");
gloss.addColorStop(0.5, "rgba(255,255,255,0)"); gloss.addColorStop(0.9, "rgba(255,255,255,.03)"); gloss.addColorStop(1, "rgba(255,255,255,.14)");
g.fillStyle = gloss;
g.fillRect(0, 0, FILM_W + EXTRA, H);
}
const canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
let w = 0, h = 0, dpr = 1, scale = 1;
function resize() {
dpr = Math.min(devicePixelRatio || 1, 2);
w = innerWidth; h = innerHeight;
canvas.width = w * dpr; canvas.height = h * dpr;
scale = Math.min(1, Math.max(0.55, w / 900)); // a narrower strip on a phone
}
addEventListener("resize", resize);
resize();
// the strip's line: a slow wave across the frame that breathes over time
const STEP = 3;
function pointAt(x, t) {
const k = (x / w) * Math.PI * 2 * 0.9;
return h * 0.5 + Math.sin(k + t * 0.35) * h * 0.2 + Math.sin(k * 0.5 - t * 0.2) * h * 0.06;
}
// drag sideways to pull the film; let go and it settles back to its own pace
const PACE = 42; // px per second (moving() decides whether it runs)
let offset = 0, speed = PACE, held = false, lastX = 0, lastT = 0;
canvas.addEventListener("pointerdown", (e) => { held = true; lastX = e.clientX; lastT = performance.now(); canvas.setPointerCapture(e.pointerId); });
canvas.addEventListener("pointermove", (e) => {
if (!held) return;
const now = performance.now(), dx = e.clientX - lastX;
offset -= dx / scale;
speed = (-dx / scale) / Math.max(0.008, (now - lastT) / 1000);
lastX = e.clientX; lastT = now;
});
const letGo = () => { held = false; };
canvas.addEventListener("pointerup", letGo);
canvas.addEventListener("pointercancel", letGo);
let last = performance.now(), t = 0;
function draw(now) {
const dt = Math.min(0.05, (now - last) / 1000);
last = now;
if (onScreen() && film.width) {
if (!held) {
// paused, it settles to a stop; it still follows your drag
speed += ((moving() ? PACE : 0) - speed) * Math.min(1, dt * 1.6);
offset += speed * dt;
}
if (moving()) t += dt;
const sh = H * scale;
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
ctx.clearRect(0, 0, w, h);
// a soft shadow under the strip
ctx.save();
ctx.filter = `blur(${Math.round(sh * 0.16)}px)`;
ctx.strokeStyle = "rgba(18, 18, 17, .22)";
ctx.lineWidth = sh * 0.82;
ctx.beginPath();
for (let x = -40; x <= w + 40; x += 12) ctx.lineTo(x, pointAt(x, t) + sh * 0.24);
ctx.stroke();
ctx.restore();
// the strip, drawn as thin slices that follow the line
let s = 0, px = -40, py = pointAt(px, t);
for (let x = -40 + STEP; x <= w + 40 + STEP; x += STEP) {
const y = pointAt(x, t), len = Math.hypot(x - px, y - py);
let u = (offset + s) % FILM_W;
if (u < 0) u += FILM_W;
ctx.save();
ctx.translate(px, py);
ctx.rotate(Math.atan2(y - py, x - px));
// each slice reads a stretch of film as long as the slice is on screen
ctx.drawImage(film, u * S, 0, (len / scale + 1) * S, H * S, 0, -sh / 2, len + 0.6, sh);
ctx.restore();
s += len / scale;
px = x; py = y;
}
}
if (film.width) ready();
requestAnimationFrame(draw);
}
sheet.addEventListener("load", paintFilm);
sheet.addEventListener("error", paintFilm);
requestAnimationFrame(draw);
</script>
</body>
</html>
How I made it
On my homepage this strip feeds out of the cassette and runs down the page behind the stories. It's a 2D canvas: the film is painted once, then drawn as thin slices along a curve.
Reel No. 003
Code
New pieces, now and then
One email when something new lands in Arteffects. No spam, unsubscribe any time.