Skip to content

alexgreensh/anidoodle / skills/anidoodle

anidoodle

Flagged

Code-drawn stills, films, 3D motion graphics, explainers and web animations in 32 styles, with scores, narration and subtitles. Use when asked for an illustration, animation, video or drawing lesson.

FileKindSize
SKILL.mdskill md13.7 KB
assets/styles.jpgbinary1.6 MB
engine/SFX_VERSIONING.mdmarkdown862 B
engine/assets/brand/lantern/brand.jsonconfig1.8 KB
engine/assets/brand/lantern/brand.tsscript1.7 KB
engine/assets/brand/lantern/lanternMark.svgother687 B
engine/assets/fonts/InstrumentSans-Bold.ttfbinary66.5 KB
engine/assets/fonts/InstrumentSans-OFL.txtmarkdown4.3 KB
engine/assets/fonts/InstrumentSans-Regular.ttfbinary66.4 KB
engine/assets/fonts/Lora-Bold.ttfbinary130.7 KB
engine/assets/fonts/Lora-OFL.txtmarkdown4.3 KB
engine/assets/fonts/PROVENANCE.mdmarkdown3.2 KB
engine/assets/fonts/Poppins-Bold.ttfbinary152.3 KB
engine/assets/fonts/Poppins-OFL.txtmarkdown4.3 KB
engine/assets/fonts/poppinsBold.tsscript203.7 KB
engine/assets/narration/narrationDemo.jsonconfig700 B
engine/assets/refs/PROVENANCE.jsonconfig836 B
engine/assets/refs/vangogh-almond-blossom.jpgbinary1021.9 KB
engine/facts/launchClip.jsonconfig789 B
engine/facts/launchExample.jsonconfig708 B
engine/facts/launchExampleBrand.jsonconfig1.2 KB
engine/facts/launchExampleClean.jsonconfig1.4 KB
engine/facts/launchExampleCleanChat.jsonconfig1.1 KB
engine/package-lock.jsonmanifest122.6 KB
engine/package.jsonmanifest934 B
engine/reviews/launchClip.jsonconfig4.8 KB
engine/reviews/launchExample.jsonconfig4.4 KB
engine/reviews/launchExampleBrand.jsonconfig9.2 KB
engine/reviews/launchExampleClean.jsonconfig4.4 KB
engine/reviews/launchExampleCleanChat.jsonconfig13.3 KB
engine/src/canvas-core/adaptAlmond.tsscript15.2 KB
engine/src/canvas-core/adaptAquarelle.tsscript14.1 KB
engine/src/canvas-core/adaptScrapbook.tsscript11.5 KB
engine/src/canvas-core/assetKit.tsscript8.4 KB
engine/src/canvas-core/bake.tsscript8.0 KB
engine/src/canvas-core/bakerSheet.tsscript4.7 KB
engine/src/canvas-core/balloon.tsscript20.0 KB
engine/src/canvas-core/balloonDraw.tsscript4.7 KB
engine/src/canvas-core/banner.tsscript42.3 KB
engine/src/canvas-core/bitRig.tsscript23.9 KB
engine/src/canvas-core/blueprint.tsscript42.5 KB
engine/src/canvas-core/blueprintKit.tsscript15.1 KB
engine/src/canvas-core/brandKit.tsscript10.4 KB
engine/src/canvas-core/brickBalloon.tsscript31.1 KB
engine/src/canvas-core/brokenColour.tsscript31.2 KB
engine/src/canvas-core/brokenColourKit.tsscript9.7 KB
engine/src/canvas-core/callout.tsscript9.6 KB
engine/src/canvas-core/calloutDemo.tsscript3.6 KB
engine/src/canvas-core/camera.tsscript13.2 KB
engine/src/canvas-core/character/build.tsscript2.9 KB
engine/src/canvas-core/character/check.tsscript9.5 KB
engine/src/canvas-core/character/design.tsscript7.3 KB
engine/src/canvas-core/character/human/balance.tsscript8.2 KB
engine/src/canvas-core/character/human/canon.tsscript3.8 KB
engine/src/canvas-core/character/human/clothing.tsscript4.5 KB
engine/src/canvas-core/character/human/figure.tsscript4.0 KB
engine/src/canvas-core/character/human/hands.tsscript10.9 KB
engine/src/canvas-core/character/human/head.tsscript23.2 KB
engine/src/canvas-core/character/human/mannequin.tsscript15.7 KB
engine/src/canvas-core/character/human/skeleton.tsscript10.3 KB
engine/src/canvas-core/character/human/walk.tsscript7.9 KB
engine/src/canvas-core/character/identity.tsscript2.3 KB
engine/src/canvas-core/character/math3.tsscript5.6 KB
engine/src/canvas-core/character/render/brick.tsscript4.0 KB
engine/src/canvas-core/character/render/grid.tsscript5.2 KB
engine/src/canvas-core/character/render/marker.tsscript3.5 KB
engine/src/canvas-core/character/render/pencil.tsscript6.6 KB
engine/src/canvas-core/character/render/pixel.tsscript3.1 KB
engine/src/canvas-core/character/render/riso.tsscript7.1 KB
engine/src/canvas-core/character/render/scratch.tsscript6.2 KB
engine/src/canvas-core/character/render/storybook.tsscript5.6 KB
engine/src/canvas-core/character/render/sumi.tsscript5.3 KB
engine/src/canvas-core/character/render/woodcut.tsscript4.3 KB
engine/src/canvas-core/character/shape2d.tsscript4.7 KB
engine/src/canvas-core/character/types.tsscript3.3 KB
engine/src/canvas-core/character/view25d.tsscript2.9 KB
engine/src/canvas-core/characters/mira/drawn.tsscript5.1 KB
engine/src/canvas-core/characters/mira/index.tsscript19.1 KB
engine/src/canvas-core/characters/mira/palettes.tsscript7.0 KB
engine/src/canvas-core/characters/mira/poses.tsscript10.2 KB
engine/src/canvas-core/characters/theo/baker.tsscript15.0 KB
engine/src/canvas-core/characters/theo/index.tsscript6.1 KB
engine/src/canvas-core/characters/theo/poses.tsscript10.6 KB
engine/src/canvas-core/characters/theo/wardrobe.tsscript12.4 KB
engine/src/canvas-core/charcoalErasure.tsscript30.7 KB
engine/src/canvas-core/charcoalErasureKit.tsscript9.4 KB
engine/src/canvas-core/cheetahBody.tsscript16.5 KB
engine/src/canvas-core/cheetahDusk.tsscript20.9 KB
engine/src/canvas-core/cheetahRig.tsscript8.9 KB
engine/src/canvas-core/cheetahRun.tsscript19.0 KB
engine/src/canvas-core/cheetahRunSigned.tsscript173 B
engine/src/canvas-core/cheetahScenery.tsscript11.8 KB
engine/src/canvas-core/cheetahTurn.tsscript5.5 KB
engine/src/canvas-core/colouredPencil.tsscript45.0 KB
engine/src/canvas-core/colouredPencilCrow.tsscript13.4 KB
engine/src/canvas-core/colouredPencilKit.tsscript17.8 KB
engine/src/canvas-core/core.tsscript30.0 KB
engine/src/canvas-core/cues.tsscript7.7 KB
engine/src/canvas-core/drafting.tsscript7.4 KB
engine/src/canvas-core/drawingMarks.tsscript13.3 KB
engine/src/canvas-core/drawingScore.tsscript17.5 KB
engine/src/canvas-core/dreamGlaze.tsscript30.9 KB
engine/src/canvas-core/dreamGlazeDraw.tsscript10.4 KB
engine/src/canvas-core/dreamGlazeKit.tsscript19.1 KB
engine/src/canvas-core/embroidery.tsscript32.2 KB
engine/src/canvas-core/embroideryAlive.tsscript19.6 KB
engine/src/canvas-core/embroideryKit.tsscript14.6 KB
engine/src/canvas-core/endCard.tsscript8.8 KB
engine/src/canvas-core/figureSheet.tsscript8.2 KB
engine/src/canvas-core/film.tsscript6.4 KB
engine/src/canvas-core/fixtureDeck.tsscript165 B
engine/src/canvas-core/fixtureMotion.tsscript5.4 KB
engine/src/canvas-core/fixtureRigBrokenGrip.tsscript250 B
engine/src/canvas-core/fixtureShip.tsscript7.4 KB
engine/src/canvas-core/fixtureShipBlind.tsscript159 B
engine/src/canvas-core/fixtureShipGreen.tsscript159 B
engine/src/canvas-core/fixtureShipLocked.tsscript126 B
engine/src/canvas-core/fixtureShipRed.tsscript157 B
engine/src/canvas-core/fixtureShipTrack.tsscript125 B
engine/src/canvas-core/fixtureWorld.tsscript166 B
engine/src/canvas-core/flatVector.tsscript22.8 KB
engine/src/canvas-core/folkTale.tsscript56.9 KB
engine/src/canvas-core/folkTaleKit.tsscript42.7 KB
engine/src/canvas-core/formMascot.tsscript4.9 KB
engine/src/canvas-core/fox.tsscript15.7 KB
engine/src/canvas-core/foxDraw.tsscript5.6 KB
engine/src/canvas-core/fromPhoto.tsscript8.7 KB
engine/src/canvas-core/gallery.tsscript9.5 KB
engine/src/canvas-core/halftone.tsscript10.3 KB
engine/src/canvas-core/halftoneKit.tsscript9.7 KB
engine/src/canvas-core/halftoneScene.tsscript26.5 KB
engine/src/canvas-core/input.tsscript16.8 KB
engine/src/canvas-core/isometric.tsscript36.2 KB
engine/src/canvas-core/isometricKit.tsscript3.9 KB
engine/src/canvas-core/kinetic.tsscript42.6 KB
engine/src/canvas-core/kineticDemo.tsscript3.6 KB
engine/src/canvas-core/koi.tsscript28.9 KB
engine/src/canvas-core/koiAlive.tsscript34 B
engine/src/canvas-core/koiDraw.tsscript3.5 KB
engine/src/canvas-core/koiDrawKit.tsscript6.9 KB
engine/src/canvas-core/koiWorld.tsscript9.3 KB
engine/src/canvas-core/launch.tsscript39.5 KB
engine/src/canvas-core/launch2.tsscript27.6 KB
engine/src/canvas-core/launch3.tsscript9.2 KB
engine/src/canvas-core/launchClip.tsscript39 B
engine/src/canvas-core/launchCode.tsscript3.8 KB
engine/src/canvas-core/launchCut.tsscript6.9 KB
engine/src/canvas-core/launchExample.tsscript3.4 KB
engine/src/canvas-core/launchExampleBrand.tsscript7.7 KB
engine/src/canvas-core/launchExampleClean.tsscript6.7 KB
engine/src/canvas-core/launchExampleCleanChat.tsscript5.0 KB
engine/src/canvas-core/launchExampleCleanScore.tsscript3.4 KB
engine/src/canvas-core/launchExampleScore.tsscript3.7 KB
engine/src/canvas-core/launchGallery.tsscript9.2 KB
engine/src/canvas-core/launchKit.tsscript28.1 KB
engine/src/canvas-core/launchLayout.tsscript19.9 KB
engine/src/canvas-core/launchLook.tsscript17.7 KB
engine/src/canvas-core/launchSound.tsscript5.8 KB
engine/src/canvas-core/launchTemplate.tsscript117.8 KB
engine/src/canvas-core/lesson.tsscript9.4 KB
engine/src/canvas-core/lessonCat.tsscript22.4 KB
engine/src/canvas-core/lessonCatFinal.tsscript204 B
engine/src/canvas-core/lessonCatSheet.tsscript263 B
engine/src/canvas-core/lessonOwl.tsscript49.3 KB
engine/src/canvas-core/lessonOwlFinal.tsscript204 B
engine/src/canvas-core/lessonOwlLayout.tsscript11.0 KB
engine/src/canvas-core/lessonOwlScore.tsscript8.7 KB
engine/src/canvas-core/lessonOwlSheet.tsscript446 B
engine/src/canvas-core/lessonOwlSocial.tsscript6.2 KB
engine/src/canvas-core/lettering.tsscript5.9 KB
engine/src/canvas-core/lighthouse.tsscript12.3 KB
engine/src/canvas-core/lighthouseDraw.tsscript5.5 KB
engine/src/canvas-core/lowPoly.tsscript24.5 KB
engine/src/canvas-core/mascotHero.tsscript4.6 KB
engine/src/canvas-core/mechanism.tsscript27.9 KB
engine/src/canvas-core/mechanismBlueprint.tsscript260 B
engine/src/canvas-core/mechanismDraw.tsscript297 B
engine/src/canvas-core/mechanismExplorer.tsscript4.8 KB
engine/src/canvas-core/mechanismHands.tsscript17.1 KB
engine/src/canvas-core/mechanismKit.tsscript38.9 KB
engine/src/canvas-core/mechanismPencil.tsscript277 B
engine/src/canvas-core/mechanismStipple.tsscript250 B
engine/src/canvas-core/mellan.tsscript9.7 KB
engine/src/canvas-core/mellanUnspool.tsscript3.2 KB
engine/src/canvas-core/midCentury.tsscript24.6 KB
engine/src/canvas-core/miraComic.tsscript4.3 KB
engine/src/canvas-core/miraEveryHand.tsscript5.2 KB
engine/src/canvas-core/miraRiso.tsscript3.6 KB
engine/src/canvas-core/miraSheet.tsscript8.0 KB
engine/src/canvas-core/miraTile.tsscript5.1 KB
engine/src/canvas-core/miraTriptych.tsscript2.7 KB
engine/src/canvas-core/miraWalk.tsscript7.7 KB
engine/src/canvas-core/moonPhases.tsscript16.7 KB
engine/src/canvas-core/moonPhasesDraw.tsscript4.3 KB
engine/src/canvas-core/morph.tsscript8.8 KB
engine/src/canvas-core/morphDemo.tsscript2.4 KB
engine/src/canvas-core/motif.tsscript2.5 KB
engine/src/canvas-core/motionKit.tsscript9.3 KB
engine/src/canvas-core/motionMeta.tsscript1.1 KB
engine/src/canvas-core/music/arc.tsscript6.2 KB

engine/src/canvas-core/lighthouse.ts

View on GitHub
import { Gfx, fractal, rng, type Ctx, type Env, type P } from "./core";
import type { Film } from "./film";
import { INK, LITHO, PAPER, REG, across, drum, nearField, plateMarks, screen } from "./riso";
import { blob, clamp, fillShape, inside, smooth } from "./gallery";

// LIGHTHOUSE AT SUNSET · risograph. Printed the way a riso prints: one drum per ink, three
// passes. The YELLOW plate, the PINK plate and the BLUE plate are drawn separately below, each
// as its own layer that multiplies onto the paper through its own slightly-off registration.
// Every colour in the picture that is not one of those three is an OVERPRINT: blue over pink is
// the dusk violet, pink over yellow the sunset orange, yellow over blue the green of the turf.
// Tone is a halftone screen whose dots grow with a tone function, each ink on its own screen
// angle so they rosette instead of moiré. The paper is left bare wherever white is wanted: the
// tower's white bands, the foam where the swell hits the rocks, the light itself.
//
// The scene: a banded lighthouse on a grassy headland, a keeper's cottage beside it, the sun
// going down into the sea on the right and lighting everything from that side, the lamp just
// lit and throwing its beam out over the water, gulls, foam, sun-glitter on the swell.

const W = 1080, HY = 604, SUN: P = [790, 590], SR = 112, PITCH = 7.4;
const ANG = { yellow: 0, pink: 75, blue: 15 };

// ---------------------------------------------------------------- the geometry
const LAND: P[] = smooth([[-20, 498], [80, 486], [176, 552], [250, 572], [420, 578], [468, 598], [506, 636], [532, 684], [548, 728], [512, 752], [420, 762], [300, 754], [170, 746], [50, 742], [-20, 740]], true, 10);
const ROCKS: P[][] = [blob(872, 910, 74, 36, 81, 0.25, 16, -0.1), blob(150, 972, 92, 44, 82, 0.22, 16, 0.08), blob(600, 800, 34, 18, 83, 0.25, 12)];
const TOWER: P[] = [[278, 580], [382, 580], [364, 252], [296, 252]];
const GALLERY: P[] = [[280, 238], [380, 238], [380, 254], [280, 254]];
const LANTERN: P[] = [[302, 176], [358, 176], [358, 214], [302, 214]];
const DOME: P[] = Array.from({ length: 25 }, (_, i) => { const a = Math.PI + (i / 24) * Math.PI; return [330 + Math.cos(a) * 32, 178 + Math.sin(a) * 28] as P; });
const COTTAGE: P[] = [[132, 516], [252, 516], [252, 578], [132, 578]];
const ROOF: P[] = [[120, 520], [192, 470], [264, 520]];
const LAMP: P = [330, 195];
const occluders = [LAND, TOWER, GALLERY, LANTERN, DOME, COTTAGE, ROOF];
const rock = (x: number, y: number) => ROCKS.some((r) => inside(r, x, y));
const occluded = (x: number, y: number) => occluders.some((o) => inside(o, x, y));
const topOf = (() => { const t: number[] = []; for (let x = 0; x <= W; x++) { let m = 1e9; for (let i = 0, j = LAND.length - 1; i < LAND.length; j = i++) { const a = LAND[i], b = LAND[j]; if ((a[0] > x) !== (b[0] > x)) m = Math.min(m, a[1] + ((x - a[0]) * (b[1] - a[1])) / (b[0] - a[0])); } t.push(m); } return (x: number) => t[Math.max(0, Math.min(W, Math.round(x)))]; })();
const shore = nearField([LAND.filter(([, y]) => y > HY - 10), ...ROCKS.map((r) => [...r, r[0]])], 24);
// turf only where the top of the land is nearly flat; where it drops away it is the cliff face
const turf = (x: number, y: number) => inside(LAND, x, y) && y - topOf(x) < 46 && Math.abs(topOf(x + 6) - topOf(x - 6)) < 9;
const cliff = (x: number, y: number) => inside(LAND, x, y) && !turf(x, y);
const towerX = across(TOWER, "x");
// the beam: a narrow wedge from the lamp out over the water to the left, fading with distance
const beam = (x: number, y: number) => { const dx = x - LAMP[0], dy = y - LAMP[1], d = Math.hypot(dx, dy); if (d < 30 || dx > 0) return 0; const a = Math.atan2(dy, dx), c = -2.94, spread = 0.07 + d * 0.0001; return Math.pow(clamp(1 - Math.abs(a - c) / spread), 0.7) * clamp(1.25 - d / 820); };
const sunD = (x: number, y: number) => Math.hypot(x - SUN[0], y - SUN[1]);
const inSun = (x: number, y: number) => sunD(x, y) < SR && y < HY;
const sea = (x: number, y: number) => y > HY && !inside(LAND, x, y) && !rock(x, y);
const glitter = (x: number, y: number) => { const col = clamp(1 - Math.abs(x - SUN[0]) / (70 + (y - HY) * 0.35)); return col * clamp((fractal(51, x * 0.5, y * 3, 0.06, 0.06, 2) - 0.46) * 5); };
const foam = (x: number, y: number) => sea(x, y) && shore(x, y) < Math.max(0, fractal(61, x, y, 0.035, 0.05, 3) - 0.38) * 70 + (fractal(62, x, y, 0.2, 0.2, 2) > 0.62 ? 5 : 0);   // broken, bunched where the swell breaks

// ---------------------------------------------------------------- the three plates
export const yellowPlate = (g: Gfx) => drum(g, REG.yellow, () => {
  const all = { x0: 0, y0: 0, x1: W, y1: W };
  // sky: warmer toward the horizon and the sun, the beam laid in as light
  screen(g, all, PITCH, ANG.yellow, (x, y) => { if (y >= HY || occluded(x, y) || inSun(x, y)) return 0; return 0.12 + 0.62 * Math.pow(y / HY, 1.6) + 0.5 * Math.exp(-Math.pow(sunD(x, y) / 260, 2)) + 0.45 * beam(x, y); }, INK.yellow);
  fillShape(g, Array.from({ length: 48 }, (_, i) => [SUN[0] + Math.cos((i / 48) * Math.PI * 2) * SR, Math.min(HY, SUN[1] + Math.sin((i / 48) * Math.PI * 2) * SR)] as P), INK.yellow);
  // sea: the sun's path, and a warm cast on the near swell
  screen(g, all, PITCH, ANG.yellow, (x, y) => (sea(x, y) && !foam(x, y) ? 0.7 * glitter(x, y) + 0.1 : 0), INK.yellow);
  // turf: yellow under the blue makes the green, heavier where the sun rakes across it
  screen(g, all, PITCH, ANG.yellow, (x, y) => (turf(x, y) ? 0.74 + 0.25 * (x / 540) : cliff(x, y) || rock(x, y) ? 0.2 : 0), INK.yellow);
  // the warm side of the tower and cottage, the lit lantern, the cottage windows
  screen(g, all, PITCH, ANG.yellow, (x, y) => (inside(TOWER, x, y) ? 0.26 * Math.pow(towerX(x, y), 1.8) : 0), INK.yellow, TOWER);
  fillShape(g, LANTERN, INK.yellow); fillShape(g, blob(LAMP[0], LAMP[1], 40, 34, 7, 0.1, 16), INK.yellow, 0.5);
  [[150, 532, 26, 22], [212, 532, 26, 22]].forEach(([x, y, w, h]) => fillShape(g, [[x, y], [x + w, y], [x + w, y + h], [x, y + h]], INK.yellow));
});

export const pinkPlate = (g: Gfx) => drum(g, REG.pink, () => {
  const all = { x0: 0, y0: 0, x1: W, y1: W };
  // sky: a band of pink across the middle of the dusk, deeper round the sun
  screen(g, all, PITCH, ANG.pink, (x, y) => { if (y >= HY || occluded(x, y)) return 0; if (inSun(x, y)) return 0.18 + 0.7 * clamp((y - (SUN[1] - SR * 0.3)) / (SR * 0.9)); return 0.3 * (1 - y / HY) + 0.6 * Math.exp(-Math.pow((y - 430) / 170, 2)) + 0.35 * Math.exp(-Math.pow(sunD(x, y) / 220, 2)) + 0.08; }, INK.pink);
  // sea: the sky's pink caught near the horizon, and the glitter
  screen(g, all, PITCH, ANG.pink, (x, y) => (sea(x, y) && !foam(x, y) ? 0.42 * clamp(1 - (y - HY) / 230) + 0.55 * glitter(x, y) : 0), INK.pink);
  // the tower's four red bands, the dome, the cottage roof
  const band = (y0: number, y1: number): P[] => { const hw = (y: number) => 52 - ((580 - y) / 328) * 18; return [[330 - hw(y1), y1], [330 + hw(y1), y1], [330 + hw(y0), y0], [330 - hw(y0), y0]]; };
  [[292, 334], [376, 418], [460, 502], [540, 580]].forEach(([a, b]) => fillShape(g, band(b, a), INK.pink));
  fillShape(g, DOME, INK.pink); fillShape(g, GALLERY, INK.pink, 0.6);
  fillShape(g, ROOF, INK.pink);
  // rock faces on the seaward cliff catching the last of the sun
  const r = rng(80);
  screen(g, all, PITCH, ANG.pink, (x, y) => (cliff(x, y) ? 0.2 + 0.55 * clamp((x - 220) / 320) * (0.6 + 0.6 * fractal(84, x, y, 0.04, 0.02, 2)) : 0), INK.pink);   // the cliff face warms toward the sun
  ROCKS.forEach((rk) => screen(g, all, PITCH, ANG.pink, (x) => { const b = rk.reduce((m, p) => Math.max(m, p[0]), -1e9), a = rk.reduce((m, p) => Math.min(m, p[0]), 1e9); return 0.15 + 0.6 * clamp((x - a) / (b - a)); }, INK.pink, rk));
});

export const bluePlate = (g: Gfx) => drum(g, REG.blue, () => {
  const all = { x0: 0, y0: 0, x1: W, y1: W };
  // sky: night coming down from the top, pulled back where the beam cuts through
  screen(g, all, PITCH, ANG.blue, (x, y) => { if (y >= HY || occluded(x, y) || inSun(x, y)) return 0; return (0.05 + 0.66 * Math.pow(1 - y / HY, 1.4)) * (1 - 0.8 * beam(x, y)); }, INK.blue);
  // sea: deepening toward us, rolled into swells, left bare as foam against the rocks
  screen(g, all, PITCH, ANG.blue, (x, y) => { if (!sea(x, y) || foam(x, y)) return 0; const k = (y - HY) / (W - HY), swell = 0.5 + 0.5 * Math.sin(y * 0.09 + fractal(71, x, y, 0.004, 0.02, 2) * 6); return (0.34 + 0.34 * k) * (0.75 + 0.35 * swell) * (1 - 0.6 * glitter(x, y)); }, INK.blue);
  // land: the turf takes a light blue (for the green), the cliff below goes deep into shadow
  screen(g, all, PITCH, ANG.blue, (x, y) => (turf(x, y) ? 0.44 - 0.2 * (x / 540) : cliff(x, y) ? 0.5 + 0.25 * clamp((y - topOf(x)) / 160) - 0.25 * clamp((x - 300) / 260) : rock(x, y) ? 0.62 : 0), INK.blue);
  // the tower and cottage turned away from the sun: shadow on the left of every form
  screen(g, all, PITCH, ANG.blue, (x, y) => (inside(TOWER, x, y) ? 0.08 + 0.62 * Math.pow(1 - towerX(x, y), 1.8) : 0), INK.blue, TOWER);
  screen(g, all, PITCH, ANG.blue, (x) => 0.55 - 0.004 * (x - 132), INK.blue, COTTAGE);
  screen(g, all, PITCH, ANG.blue, (x) => (x < 192 ? 0.55 : 0.1), INK.blue, ROOF);
  screen(g, all, PITCH, ANG.blue, (x) => 0.1 + 0.6 * clamp((330 - x) / 32), INK.blue, DOME);
  // the key plate's solids: door, windows, gallery rail, mullions, chimney, finial
  const solid = (pts: P[]) => fillShape(g, pts, INK.blue);
  solid(smooth([[314, 580], [314, 548], [322, 538], [338, 538], [346, 548], [346, 580]], false, 4).concat([[314, 580]]));
  [[322, 460], [330, 380], [336, 300]].forEach(([x, y]) => solid([[x - 4, y - 12], [x + 4, y - 12], [x + 4, y + 10], [x - 4, y + 10]]));
  solid([[278, 250], [382, 250], [382, 256], [278, 256]]); solid([[282, 212], [378, 212], [378, 216], [282, 216]]);
  for (let x = 284; x <= 376; x += 9) solid([[x - 1, 214], [x + 1, 214], [x + 1, 240], [x - 1, 240]]);
  [308, 322, 338, 352].forEach((x) => solid([[x - 1.2, 176], [x + 1.2, 176], [x + 1.2, 214], [x - 1.2, 214]]));
  solid([[300, 174], [360, 174], [360, 178], [300, 178]]);
  solid(Array.from({ length: 12 }, (_, i) => [330 + Math.cos((i / 12) * Math.PI * 2) * 6, 146 + Math.sin((i / 12) * Math.PI * 2) * 6] as P)); solid([[329, 126], [331, 126], [331, 146], [329, 146]]);
  solid([[222, 474], [236, 474], [236, 500], [222, 500]]);                                                        // chimney
  solid([[178, 546], [198, 546], [198, 578], [178, 578]]);                                                        // cottage door
  [[150, 532], [212, 532]].forEach(([x, y]) => { solid([[x, y], [x + 26, y], [x + 26, y + 2.4], [x, y + 2.4]]); solid([[x + 12, y], [x + 14, y], [x + 14, y + 22], [x + 12, y + 22]]); solid([[x, y + 20], [x + 26, y + 20], [x + 26, y + 23], [x, y + 23]]); });
  // key lines in litho crayon: the tower's edges, the cliff's cracks, the swell, the gulls
  const pen = (pts: P[], w: number, seed: number, op = 0.9) => { g.pen(pts, { w, color: INK.blue, seed, wobble: 0.6, boil: 0, opacity: op, retrace: false }); };
  pen([[278, 580], [288, 420], [296, 252]], 1.6, 900); pen([[382, 580], [372, 420], [364, 252]], 1.2, 901, 0.7);
  const r = rng(910);
  for (let i = 0; i < 18; i++) { const x = 200 + r() * 340, y = 640 + r() * 110; if (!cliff(x, y)) continue; pen([[x, y], [x - 10 - r() * 20, y + 16 + r() * 20], [x - 4 - r() * 26, y + 40 + r() * 30]], 1.2, 920 + i, 0.75); }
  ROCKS.forEach((rk, i) => pen([...rk.slice(0, Math.round(rk.length * 0.6))], 1.6, 940 + i, 0.85));
  for (let i = 0; i < 38; i++) { const y = HY + 14 + Math.pow(r(), 1.3) * 460, x = 560 + r() * 520, l = 18 + (y - HY) * 0.12 + r() * 20; if (!sea(x, y) || foam(x, y) || Math.abs(x - SUN[0]) < 60) continue; pen([[x, y], [x + l * 0.5, y - 3], [x + l, y]], 1.1 + (y - HY) / 300, 960 + i, 0.8); }
  [[560, 300, 1], [612, 272, 0.8], [640, 330, 0.7], [180, 200, 0.9]].forEach(([x, y, s], i) => pen([[x - 16 * s, y - 2 * s], [x - 7 * s, y - 8 * s], [x, y], [x + 7 * s, y - 8 * s], [x + 16 * s, y - 2 * s]], 1.6, 1000 + i));
});

export const drawLighthouse = (ctx: Ctx, _frame: number, env: Env) => {
  const g = new Gfx(ctx, env, 0, LITHO);
  ctx.setTransform(env.scale, 0, 0, env.scale, 0, 0);
  ctx.fillStyle = PAPER; ctx.fillRect(0, 0, W, W);
  yellowPlate(g); pinkPlate(g); bluePlate(g);
  plateMarks(g, W, W, [INK.yellow, INK.pink, INK.blue]);
};

export const lighthouse: Film = {
  meta: { title: "Lighthouse at sunset · risograph", W: 1080, H: 1080, fps: 30, bpm: 120, durationFrames: 1 },
  assets: { images: {} },
  shots: [{ id: "lighthouse", start: 0, end: 1, draw: drawLighthouse }],
};
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall