Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Creator formats — responsive social video

Creator Kit v2 turns a question, answers, media and a reusable creator profile into a polished timed social clip. The same source adapts to 9:16, 4:5, 1:1 and 16:9 with platform-safe regions. studio plus a balanced ring is the restrained default; timing controls the beat independently from timerstyle, whose native ring, bar, number, segments, ticks and pulse looks remain crisp at every size. Explicit layout, density, labels, motion, safe and accent controls customise the rest. Responsive native social icons, optional explanations and final end cards share the same brand profile.

Each block is the whole file — copy it into x.manic and run manic x.manic (live) or --record out (video).

perfect-reel

The gold-path production starter: phone-safe composition, real LaTeX, exact pacing, professional mono styling, creator identity, timeline markers and a focused end card.

// A production-ready Creator v2 Reel: safe layout, exact pacing, one focal
// equation, restrained motion, reusable branding, markers, and an end card.
title("Perfect Reel — Angle Ratio");
canvas("9:16");
template("mono");
watermark(manicMark, (w*0.895-100, h*0.075+24), "Made With Manic");

creator(me, "@anish2good name=Proof_Daily tagline=Think_then_prove yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Save_and_share safe=reels");

quiz(q, "Triangle angles: 2:3:4. What is the largest?",
     "studio layout=media-first reveal=fade density=comfortable motion=calm safe=reels accent=cyan");
option(q, `$60^\circ$`);
option(q, `$80^\circ$`, correct);
option(q, `$90^\circ$`);
option(q, `$100^\circ$`);
explain(q, `The parts total $9$, so $x=20^\circ$ and $4x=80^\circ$.`, "Angle sum");

equation(prompt, (cx, 650), `2x+3x+4x=180^\circ`, 70);
color(prompt, cyan);
figure(prompt);
hidden(prompt);

// Exact 10.5-second quiz beat. The timer look can change independently.
timing(q, "calm ask=1.1 options=1 think=5.5 reveal=0.75 hold=2.15 stagger=0.06");
timerstyle(q, "look=ring position=below number=inside direction=drain size=medium thickness=1.1 color=cyan track=dim label=THINK font=mono finish=pulse");

socials(me);
endcard(me, "cta=Save_and_share");

mark("hook");
par {
  run(q);
  show(prompt, 0.5);
}

mark("endcard");
par {
  fade(q.parts, 0.45);
  fade(prompt, 0.45);
  fade(me.footer, 0.45);
}
show(me.endcard, 0.6);
wait(1.4);

reactive-multiformat

One named reactive story rendered as portrait, 4:5 feed, square, or landscape with the --canvas override. Responsive variables and layout branches reflow before construction, while the same steps, timing, equation continuity and creator identity remain intact.

// ============================================================================
// reactive-multiformat.manic — one semantic story, four output formats
// ----------------------------------------------------------------------------
// Keep this source unchanged and render it with:
//   manic examples/reactive-multiformat.manic --canvas portrait
//   manic examples/reactive-multiformat.manic --canvas 4:5
//   manic examples/reactive-multiformat.manic --canvas square
//   manic examples/reactive-multiformat.manic --canvas 16:9
// The override is applied before w/h/cx/cy and the build-time layout branch.
// Every format keeps the same named steps, continuity, duration and identity.
// ============================================================================

title("One Story, Every Screen");
canvas("9:16");
template("shorts");

creator(me, "@anish2good name=Visual_Proofs tagline=One_idea_every_screen yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Keep_the_story safe=clean");

let u = (w+h-abs(w-h)) / 2160; // min(w,h) / 1080 without a layout-specific constant
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

// Portrait Reel / Short: story reads from top to bottom.
if h > 1.45*w {
  text(kicker, (cx, 125*u), "ONE SOURCE · PORTRAIT");
  text(headline, (cx, 215*u), "A derivative is a world of slopes");
  equation(work, (cx, 355*u), `f(x)=0.35x^2`, 54*u);

  rect(stage, (cx, 900*u), 930*u, 940*u);
  axes(ax, (cx, 1030*u), 410*u, 350*u, 1);
  plot(curve, (cx, 1030*u), 115*u, 62*u, "0.35*x*x", (-3.5,3.5));
  deriv(derivative, curve);
  tangent(tan, curve, -2.7, 235*u);
  slope(rate, curve, -2.7, (24*u,-30*u));
  equation(curveLabel, (cx+310*u, 690*u), `f(x)`, 31*u);
  equation(derivativeLabel, (cx+300*u, 1290*u), `f'(x)`, 31*u);
  text(caption, (cx, 1450*u), "Move along the curve and every local slope tells part of a second story.");
  wrap(caption, w*0.72);
}

// Landscape lesson: explanation on the left, visual stage on the right.
else if w > 1.25*h {
  text(kicker, (w*0.25, h*0.13), "ONE SOURCE · LANDSCAPE");
  text(headline, (w*0.25, h*0.24), "A derivative is a world of slopes");
  equation(work, (w*0.25, h*0.38), `f(x)=0.35x^2`, 54*u);

  rect(stage, (w*0.72, h*0.48), w*0.49, h*0.70);
  axes(ax, (w*0.72, h*0.55), 350*u, 285*u, 1);
  plot(curve, (w*0.72, h*0.55), 90*u, 48*u, "0.35*x*x", (-3.5,3.5));
  deriv(derivative, curve);
  tangent(tan, curve, -2.7, 190*u);
  slope(rate, curve, -2.7, (20*u,-25*u));
  equation(curveLabel, (w*0.88, h*0.27), `f(x)`, 29*u);
  equation(derivativeLabel, (w*0.88, h*0.76), `f'(x)`, 29*u);
  text(caption, (w*0.25, h*0.60), "Move along the curve and every local slope tells part of a second story.");
  wrap(caption, w*0.38);
}

// Square post / 4:5 feed: compact stacked composition.
else {
  text(kicker, (cx, h*0.09), "ONE SOURCE · FEED");
  text(headline, (cx, h*0.17), "A derivative is a world of slopes");
  equation(work, (cx, h*0.27), `f(x)=0.35x^2`, 52*u);

  rect(stage, (cx, h*0.55), w*0.86, h*0.48);
  axes(ax, (cx, h*0.59), 360*u, 270*u, 1);
  plot(curve, (cx, h*0.59), 92*u, 48*u, "0.35*x*x", (-3.5,3.5));
  deriv(derivative, curve);
  tangent(tan, curve, -2.7, 195*u);
  slope(rate, curve, -2.7, (20*u,-25*u));
  equation(curveLabel, (cx+270*u, h*0.42), `f(x)`, 29*u);
  equation(derivativeLabel, (cx+270*u, h*0.73), `f'(x)`, 29*u);
  text(caption, (cx, h*0.84), "Move along the curve and every local slope tells part of a second story.");
  wrap(caption, w*0.72);
}

size(kicker, 22*u); color(kicker, dim); bold(kicker); hidden(kicker);
size(headline, 39*u); color(headline, fg); bold(headline); hidden(headline);
size(caption, 25*u); color(caption, dim); hidden(caption);

color(stage, panel); outline(stage, dim); opacity(stage, 0.72); hidden(stage);
color(ax, dim); opacity(ax, 0.52); untraced(ax);
color(curve, cyan); stroke(curve, 6*u); glow(curve, 0.75); untraced(curve);
color(derivative, magenta); stroke(derivative, 5*u); dashed(derivative, 18*u, 11*u); untraced(derivative);
color(tan, gold); stroke(tan, 4*u); hidden(tan);
color(rate, gold); hidden(rate);
color(work, cyan); hidden(work);
color(curveLabel, cyan); hidden(curveLabel);
color(derivativeLabel, magenta); hidden(derivativeLabel);

socials(me);

step("question") {
  show(stage, 0.35);
  show(kicker, 0.35);
  show(headline, 0.45);
  show(work, 0.50);
  draw(ax, 0.80);
  draw(curve, 1.30);
  show(curveLabel, 0.40);
  show(caption, 0.45);
}
wait(0.65);

step("measure") {
  rewrite(work, `f'(x)=0.70x`, 0.90, smooth);
  show(tan, 0.40);
  show(rate, 0.40);
  to(tan, x, 2.7, 2.80, smooth);
  to(rate, x, 2.7, 2.80, smooth);
  say(caption, "The tangent and its live slope move as one explanation.", 0.40);
}
wait(0.55);

step("collect-the-slopes") {
  rewrite(work, `\textcolor{magenta}{f'(x)}=0.70x`, 0.90, smooth);
  fade(tan, 0.35);
  fade(rate, 0.35);
  draw(derivative, 1.55);
  show(derivativeLabel, 0.40);
  say(caption, "Collect those local slopes and the derivative curve appears.", 0.40);
}
wait(0.65);

step("takeaway") {
  rewrite(work, `\text{slope of }f=\textcolor{magenta}{f'}`, 0.95, smooth);
  pulse(curve, 0.70);
  pulse(derivative, 0.70);
  say(caption, "The layout can change. The idea, timing and identity stay together.", 0.40);
}
wait(1.60);

parameter-journeys

One visible parameter drives a quadratic plot, its live tangent and slope, a geometric position, scale and a derived numeric readout. Named steps animate only the value; bind keeps every representation continuous and the source reflows across all four formats.

// ============================================================================
// parameter-journeys.manic — one value, several continuous representations
// ----------------------------------------------------------------------------
// `parameter` creates the visible control. `bind` connects it once to the
// changing plot, tangent/slope, a geometric position, scale, and p² readout.
// The named steps only animate the parameter; the visual world reacts smoothly.
// Try every format with: manic check examples/parameter-journeys.manic --canvas all
// ============================================================================

title("Parameter Journeys");
canvas("9:16");
template("mono");

creator(me, "@anish2good name=Manic_Creator_Lab tagline=One_value_many_worlds yt=zarigatongy x=@anish2good web=8gwifi.org/manic footer=none accent=cyan safe=clean");

let u = (w+h-abs(w-h)) / 2160;
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

if h > 1.45*w {
  text(kicker, (cx, 120*u), "PARAMETER JOURNEY");
  text(headline, (cx, 200*u), "Change one idea. Keep the world.");
  equation(rule, (cx, 315*u), `y=\textcolor{cyan}{a}x^2`, 58*u);

  rect(stage, (cx, 770*u), 920*u, 720*u);
  axes(ax, (cx, 790*u), 400*u, 270*u, 1);
  plot(curve, (cx, 790*u), 112*u, 61*u, "0.22*x*x", (-3.3,3.3));
  tangent(tan, curve, 1.15, 230*u);
  slope(rate, curve, 1.15, (24*u,-34*u));

  parameter(a, (cx, 1215*u), -1.2, -1.5, 1.5, "a", 2);
  text(positionLabel, (cx, 1365*u), "THE SAME VALUE ALSO MOVES A POINT");
  line(path, (w*0.18, 1450*u), (w*0.82, 1450*u));
  dot(leftEnd, (w*0.18, 1450*u), 5*u);
  dot(rightEnd, (w*0.82, 1450*u), 5*u);
  circle(mover, (cx, 1450*u), 22*u);
  bind(a, mover, x, w*0.18, w*0.82);
  counter(magnitude, (cx, 1570*u), 0, 2, "a² = ", "");
  text(caption, (cx, 1690*u), "Negative, zero, positive — every connected view stays in sync.");
  wrap(caption, w*0.76);
}
else if w > 1.25*h {
  text(kicker, (w*0.24, h*0.12), "PARAMETER JOURNEY");
  text(headline, (w*0.25, h*0.22), "Change one idea. Keep the world.");
  equation(rule, (w*0.25, h*0.34), `y=\textcolor{cyan}{a}x^2`, 55*u);

  parameter(a, (w*0.25, h*0.49), -1.2, -1.5, 1.5, "a", 2);
  text(positionLabel, (w*0.25, h*0.64), "THE SAME VALUE MOVES A POINT");
  line(path, (w*0.09, h*0.72), (w*0.41, h*0.72));
  dot(leftEnd, (w*0.09, h*0.72), 5*u);
  dot(rightEnd, (w*0.41, h*0.72), 5*u);
  circle(mover, (w*0.25, h*0.72), 22*u);
  bind(a, mover, x, w*0.09, w*0.41);
  counter(magnitude, (w*0.25, h*0.82), 0, 2, "a² = ", "");

  rect(stage, (w*0.72, h*0.48), w*0.49, h*0.72);
  axes(ax, (w*0.72, h*0.53), 345*u, 250*u, 1);
  plot(curve, (w*0.72, h*0.53), 92*u, 51*u, "0.22*x*x", (-3.3,3.3));
  tangent(tan, curve, 1.15, 195*u);
  slope(rate, curve, 1.15, (20*u,-28*u));
  text(caption, (w*0.72, h*0.88), "Every connected view stays in sync.");
  wrap(caption, w*0.42);
}
else {
  text(kicker, (cx, h*0.08), "PARAMETER JOURNEY");
  text(headline, (cx, h*0.15), "Change one idea. Keep the world.");
  equation(rule, (cx, h*0.24), `y=\textcolor{cyan}{a}x^2`, 53*u);

  rect(stage, (cx, h*0.50), w*0.86, h*0.40);
  axes(ax, (cx, h*0.52), 350*u, 225*u, 1);
  plot(curve, (cx, h*0.52), 94*u, 46*u, "0.22*x*x", (-3.3,3.3));
  tangent(tan, curve, 1.15, 190*u);
  slope(rate, curve, 1.15, (20*u,-26*u));

  parameter(a, (cx, h*0.75), -1.2, -1.5, 1.5, "a", 2);
  text(positionLabel, (cx, h*0.80), "ONE VALUE · PLOT · POSITION · MAGNITUDE");
  line(path, (w*0.20, h*0.85), (w*0.80, h*0.85));
  dot(leftEnd, (w*0.20, h*0.85), 5*u);
  dot(rightEnd, (w*0.80, h*0.85), 5*u);
  circle(mover, (cx, h*0.85), 20*u);
  bind(a, mover, x, w*0.20, w*0.80);
  counter(magnitude, (cx, h*0.875), 0, 2, "a² = ", "");
  text(caption, (cx, h*0.925), "Every view stays in sync.");
  wrap(caption, w*0.78);
}

// One declaration per relationship. `p` is the live parameter and `x` is the
// plot coordinate only inside a plot-formula binding.
bind(a, curve, formula, "0.22*p*x*x");
bind(a, mover, scale, "0.78+0.22*abs(p)");
bind(a, magnitude, value, "p*p");

size(kicker, 21*u); color(kicker, dim); bold(kicker); hidden(kicker);
size(headline, 37*u); bold(headline); hidden(headline);
size(positionLabel, 22*u); color(positionLabel, dim); bold(positionLabel); hidden(positionLabel);
size(caption, 23*u); color(caption, dim); hidden(caption);
color(rule, cyan); hidden(rule);
color(stage, panel); outline(stage, dim); opacity(stage, 0.68); hidden(stage);
color(ax, dim); opacity(ax, 0.48); untraced(ax);
color(curve, cyan); stroke(curve, 6*u); glow(curve, 0.75); untraced(curve);
color(tan, gold); stroke(tan, 4*u); hidden(tan);
color(rate, gold); hidden(rate);
color(path, dim); stroke(path, 3*u); untraced(path);
color(leftEnd, dim); color(rightEnd, dim); hidden(leftEnd); hidden(rightEnd);
color(mover, cyan); outline(mover, fg); hidden(mover);
color(magnitude, fg); bold(magnitude); hidden(magnitude);
hidden(a.widget);

socials(me);

step("opens-down") {
  show(kicker, 0.30);
  show(headline, 0.40);
  show(rule, 0.45);
  show(stage, 0.35);
  draw(ax, 0.70);
  draw(curve, 1.10);
  show(tan, 0.35);
  show(rate, 0.35);
  show(a.widget, 0.45);
  show(positionLabel, 0.35);
  draw(path, 0.55);
  show(leftEnd, 0.25);
  show(rightEnd, 0.25);
  show(mover, 0.35);
  show(magnitude, 0.35);
  show(caption, 0.40);
}
wait(0.65);

step("flatten") {
  to(a, value, 0, 2.20, smooth);
  say(caption, "At zero the quadratic, tangent slope, position and magnitude settle together.", 0.40);
}
wait(0.55);

step("opens-up") {
  to(a, value, 1.25, 2.40, smooth);
  say(caption, "One authored parameter now carries the whole visual family upward.", 0.40);
}
wait(0.60);

step("compare") {
  to(a, value, -0.65, 2.10, smooth);
  say(caption, "Try another case without rebuilding the plot, diagram or readouts.", 0.40);
}
wait(0.55);

step("takeaway") {
  to(a, value, 1.5, 2.30, smooth);
  pulse(rule, 0.70);
  pulse(mover, 0.70);
  say(caption, "Declare the relationship once. Animate only what the idea means.", 0.40);
}
wait(1.60);

pascal-triangle

A non-quiz Creator v2 Short built entirely from the computation layer: each cell’s binomial coefficient is a prod reduction, the triangle reveals row by row, the sum-of-two-parents rule is highlighted, and colouring the odd cells uncovers Sierpinski’s triangle — all inside a branded 9:16 shorts frame with creator identity, socials and an end card (no grid kit needed: the triangle is triangular).

// Pascal's Triangle — a real Creator v2 Short that shows off Manic's range: the
// numbers are COMPUTED live (a `prod` reduction per cell), a hidden fractal is
// revealed, and the close reframes it as "one script — Manic does math, physics,
// algorithms & more." 9:16 shorts template, branded identity + socials + end card.
title("Pascal's Triangle");
canvas("9:16");
template("shorts");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Try_it_free safe=reels");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

let N = 8;
let cw = w*0.112;
let rh = w*0.112;
let top = h*0.21;
let rad = w*0.048;

// Build the triangle from the computation layer: each cell's binomial coefficient
// C(n,k) is a `prod` reduction on a filled disc. Tag by row (for the reveal) and
// by parity (for the fractal finale).
for n in 0..N {
  for k in 0..n+1 {
    let px = w*0.5 + (k - n*0.5)*cw;
    let py = top + n*rh;
    let val = prod(i in 1..k+1 : (n-k+i)/i);
    dot(d{n}_{k}, (px, py), rad); color(d{n}_{k}, panel); tag(d{n}_{k}, discs); tag(d{n}_{k}, prow{n});
    counter(v{n}_{k}, (px, py), val, 0); tag(v{n}_{k}, nums); tag(v{n}_{k}, prow{n});
    let odd = round(val - 2*floor(val/2));
    if odd > 0.5 { tag(d{n}_{k}, oddcells); } else { tag(d{n}_{k}, evencells); }
  }
}

text(kicker, (cx, h*0.135), "This triangle of numbers hides a fractal");
size(kicker, 32); color(kicker, dim); bold(kicker); wrap(kicker, w*0.82);
text(cap, (cx, h*0.775), "every number here is computed, not typed");
size(cap, 33); color(cap, dim); wrap(cap, w*0.82);

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

hidden(discs); hidden(nums); hidden(cap);
untraced(kicker); cursor(kicker);   // opening hook types on, letter by letter

// 1 — HOOK: type the question, then build the triangle. The caption's promise —
// "computed, not typed" — is Manic's real pitch: the numbers come from a formula.
mark("hook");
type(kicker, 1.4);
show(cap, 0.4);
for n in 0..N { show(prow{n}, 0.26); wait(0.09); }
wait(0.4);

// 2 — THE RULE: 3 + 3 = 6, every cell is the sum of its two parents.
step("rule") {
  seq {
    say(cap, "each cell = the two above it   (3 + 3 = 6)");
    par { flash(d3_1, gold); flash(d3_2, gold); }
    flash(d4_2, cyan);
  }
}
wait(0.5);

// 3 — THE TWIST: colour the odd numbers and Sierpinski's triangle appears.
step("fractal") {
  par {
    say(cap, "colour the ODD numbers — and a fractal appears");
    recolor(oddcells, magenta);
  }
}
wait(0.9);

// 4 — THE POINT: this whole thing was one short script — and Manic's range is
// the real story. Reframe the demo as evidence of what Manic can do.
step("power") {
  seq {
    say(cap, "one short script did all of this");
    par { pulse(discs, 0.7); recolor(cap, cyan); }
    say(cap, "Manic animates math, physics, algorithms & more — from plain text");
  }
}
wait(1.3);

// 5 — END CARD: the brand CTA.
mark("endcard");
par {
  fade(kicker, 0.4);
  fade(cap, 0.4);
  fade(me.footer, 0.4);
  fade(discs, 0.4);
  fade(nums, 0.4);
}
show(me.endcard, 0.6);
wait(1.6);

creator-lattice-paths

The rectangular cousin of Pascal, on a real grid-kit lattice: ‘how many ways from corner to corner moving only right and down?’ Every cell’s path-count is a prod reduction (C(i+j,i)), the same above-plus-left rule is highlighted, the far corner holds the total, and one actual monotone path is traced with a spline. Blueprint template, and a different typewriter beat — the question erases and retypes itself into the answer.

// Lattice-path counting — "how many ways from corner to corner moving only right
// and down?" The SAME recurrence as Pascal (cell = the one above + the one to the
// left) but on a RECTANGLE — so it uses the grid kit. Each cell's count is a `prod`
// reduction (C(i+j,i)); afterwards one actual path is traced with `spline`.
// Different template (blueprint) + different typewriter (a question that erases and
// retypes into its answer).
title("Lattice Paths");
canvas("9:16");
template("blueprint");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=gold footer=signature cta=Try_it_free safe=reels");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

let C = 5;          // columns of cells
let R = 4;          // rows of cells
let s = w*0.162;    // cell size
let gy = h*0.455;   // grid centre y
let ox = cx - C*s*0.5;
let oy = gy - R*s*0.5;

// The rectangular lattice IS a grid-kit grid. Overlay a path-count on every cell:
// value(i,j) = C(i+j, i), the number of monotone right/down paths reaching it.
grid(lat, (cx, gy), C, R, s);
opacity(lat.cells, 0);   // a lattice is its lines — clear the cell fills so the counts read
for i in 0..R {
  for j in 0..C {
    let val = prod(t in 1..i+1 : (j+t)/t);   // C(i+j, i)
    counter(pc{i}_{j}, (ox+(j+0.5)*s, oy+(i+0.5)*s), val, 0);
    tag(pc{i}_{j}, pathnums); tag(pc{i}_{j}, prow{i});
  }
}

// One monotone path (right/right/down/right/down/right/down) traced afterward.
spline(route,
  (ox+0.5*s, oy+0.5*s), (ox+1.5*s, oy+0.5*s), (ox+2.5*s, oy+0.5*s),
  (ox+2.5*s, oy+1.5*s), (ox+3.5*s, oy+1.5*s), (ox+3.5*s, oy+2.5*s),
  (ox+4.5*s, oy+2.5*s), (ox+4.5*s, oy+3.5*s));
color(route, gold); stroke(route, 7); glow(route, 0.8); untraced(route); hidden(route);

// --- text: a question that later erases and retypes into the answer ---
text(kicker, (cx, h*0.115), "How many paths, corner to corner?");
size(kicker, 33); color(kicker, cyan); bold(kicker); wrap(kicker, w*0.86);
text(sub, (cx, h*0.165), "moving only RIGHT and DOWN");
size(sub, 27); color(sub, dim);
text(answer, (cx, h*0.13), "35 paths — every one of them counted.");
size(answer, 34); color(answer, gold); bold(answer); wrap(answer, w*0.86);
text(cap, (cx, h*0.80), "each cell counts the ways to reach it");
size(cap, 31); color(cap, dim); wrap(cap, w*0.84);

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

hidden(pathnums); hidden(cap);
untraced(kicker); cursor(kicker);
untraced(sub);
untraced(answer); hidden(answer);

// 1 — HOOK: the question types on (two lines), then the lattice fills in.
mark("hook");
type(kicker, 1.2);
type(sub, 0.9);
show(cap, 0.4);
for i in 0..R { show(prow{i}, 0.3); wait(0.12); }
wait(0.4);

// 2 — THE RULE: 4 + 6 = 10 — every cell is (the one above) + (the one to the left).
step("rule") {
  seq {
    say(cap, "= the cell above  +  the cell to its left   (4 + 6 = 10)");
    par { flash(pc1_3, cyan); flash(pc2_2, cyan); }
    flash(pc2_3, gold);
  }
}
wait(0.5);

// 3 — THE ANSWER: the far corner holds the total. The question erases & retypes.
step("answer") {
  seq {
    par { erase(kicker, 0.5); erase(sub, 0.4); }
    fade(kicker, 0.15);   // clear the residual typewriter cursor left after erase
    par {
      pulse(pc3_4, 0.8);
      flash(pc3_4, gold);
      show(answer, 0.1);
      type(answer, 1.1);
    }
    say(cap, "and every path is a right/down staircase");
  }
}
wait(0.5);

// 4 — TRACE ONE: draw an actual corner-to-corner path with a spline.
step("trace") {
  par {
    show(route, 0.2);
    draw(route, 1.6);
  }
}
wait(0.7);

// 5 — THE POINT: one script did the grid, the counting AND the path.
step("power") {
  seq {
    say(cap, "one short script: the grid, the counting, and the path");
    par { pulse(pathnums, 0.7); recolor(cap, cyan); }
    say(cap, "Manic animates math, physics, algorithms & more — from plain text");
  }
}
wait(1.3);

// 6 — END CARD.
mark("endcard");
par {
  fade(answer, 0.4); fade(cap, 0.4); fade(me.footer, 0.4);
  fade(pathnums, 0.4); fade(lat.cells, 0.4); fade(lat.lines, 0.4); fade(route, 0.4);
}
show(me.endcard, 0.6);
wait(1.6);

creator-rule90-sierpinski

A QUIZ-style Short: Rule 90 (each new cell = its two upper neighbours XOR’d) draws Sierpinski’s triangle from a single dot — because XOR of two parents is exactly Pascal’s triangle mod 2 (a cell is lit iff C(n,k) is odd). The gasket is the quiz’s media (fit with figure), building as you’re asked to predict it, then the correct card and the reason reveal. Full Creator v2 quiz: question, options, think timer, explanation and end card.

// Rule 90 → Sierpinski — a QUIZ-style Creator v2 Short. Rule 90 is the elementary
// cellular automaton where each new cell = its two upper neighbours, XOR'd. From a
// single seed it draws Sierpinski's triangle — because XOR of two parents is exactly
// Pascal's triangle mod 2 (a cell is lit iff C(n,k) is ODD). Two birds, one stone:
// the CA, the binomial parity, and the fractal are the same picture. The gasket is
// the quiz's media (fit with `figure`), building as you're asked to predict it.
title("Rule 90 → Sierpinski");
canvas("9:16");
template("shorts");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Try_it_free safe=reels");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

// The gasket: only the LIT cells (odd binomials) are drawn, so it reads as the
// clean Sierpinski triangle. `figure` fits the whole group into the media region.
let N = 16;
let cw = 30;
let rh = 30;
for n in 0..N {
  for k in 0..n+1 {
    let val = prod(i in 1..k+1 : (n-k+i)/i);
    let odd = round(val - 2*floor(val/2));
    if odd > 0.5 {
      dot(sc{n}_{k}, (cx + (k - n*0.5)*cw, cy - N*rh*0.5 + n*rh), 11);
      color(sc{n}_{k}, magenta); tag(sc{n}_{k}, sier); tag(sc{n}_{k}, srow{n});
    }
  }
}
figure(sier);
hidden(sier);   // hidden at first, then builds row by row while you predict

quiz(q, "Rule 90: start with one dot. Each new cell = its two upper neighbours, XOR'd. What shape appears?",
     "studio layout=media-first reveal=fade density=comfortable motion=calm safe=reels accent=cyan");
option(q, "A checkerboard");
option(q, "Sierpinski's triangle", correct);
option(q, "Random static");
option(q, "A solid pyramid");
explain(q, "XOR of two parents = Pascal's triangle mod 2 — the ODD cells are Sierpinski.", "Why");

timing(q, "calm ask=1.2 options=1.1 think=5.2 reveal=0.8 hold=2.4 stagger=0.06");
timerstyle(q, "look=ring position=below number=inside direction=drain size=medium thickness=1.1 color=cyan track=dim label=PREDICT font=mono finish=pulse");

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

// Play the quiz; in parallel, Rule 90 builds the gasket row by row so it finishes
// right as the answer is revealed.
mark("hook");
par {
  run(q);
  seq {
    wait(1.1);
    for n in 0..N { show(srow{n}, 0.16); wait(0.26); }
  }
}

mark("endcard");
par {
  fade(q.parts, 0.45);
  fade(sier, 0.45);
  fade(me.footer, 0.45);
}
show(me.endcard, 0.6);
wait(1.6);

creator-heightmap-world

The Grid→3D bridge as a narrated Short: a grid-kit WFC map settles in 2D, then the SAME grid rises into 3D terrain via heightmap3 — camera pull-back, orbit, and a low ridge flyover. speak carries the story VO; say keeps short on-screen captions; Manic promo + end card close the piece. One grid, two dimensions, inside a 9:16 creator frame.

// Your Map Is a 3D World — Manic promo Short.
// A grid settles cell by cell (Wave Function Collapse), then the SAME grid lifts
// into 3D terrain. The camera pulls back, orbits, and flies low. Story narration
// (`speak`) is separate from short on-screen captions (`say`). Outro names Manic.
title("Your Map Is a 3D World");
canvas("9:16");
template("shorts");
voice("elevenlabs");                       // story narration
// voice("elevenlabs", "alice");
// voice("elevenlabs", "jessica");
// voice("cartesia");
// voice("gtts");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Try_it_free safe=reels");
watermark(mk, (w*0.955-100, h*0.045+24), "Made With Manic");

// The 2D map (grid kit) and the 3D terrain from the SAME grid.
grid(world, (cx, h*0.44), 16, 16, 52);
collapse(world, "islands", 8);
camera3((0, -1.6, 22), (0, 0, 0), 26);
heightmap3(land, world, "h*1.7 + fbm(x*1.2, y*1.2)*0.85 + 0.1", 8);
color(land, cyan);
hidden(land);

text(kicker, (cx, h*0.135), "your flat map is hiding a 3D world");
size(kicker, 33); color(kicker, cyan); bold(kicker); wrap(kicker, w*0.82);
text(cap, (cx, h*0.785), "");
size(cap, 31); color(cap, dim); wrap(cap, w*0.84);
text(promo, (cx, h*0.42), "Manic"); size(promo, 72); color(promo, cyan); bold(promo); hidden(promo);
text(promoSub, (cx, h*0.52), "plain text → animated explainers"); size(promoSub, 28); color(promoSub, magenta); wrap(promoSub, w*0.82); hidden(promoSub);
text(promoUrl, (cx, h*0.62), "8gwifi.org/manic"); size(promoUrl, 30); color(promoUrl, fg); bold(promoUrl); hidden(promoUrl);

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

untraced(kicker); cursor(kicker);

// Narration tells the story. Captions stay short punch-lines on screen.
// speak("…") = voice only; say(cap, "…") = text only; par both when needed.

// 1 — HOOK: open the idea, then the 2D map settles (Wave Function Collapse).
mark("hook");
par {
  type(kicker, 1.4);
  speak("Every world starts flat. Watch a map generate itself — cell by cell — until the islands lock.");
}
step("map") {
  par {
    say(cap, "cell by cell…");
    speak("This is Wave Function Collapse. Constraints push the grid toward a coherent coast.");
    run(world, 16, 3.0);
  }
}
wait(0.25);

// 2 — the same grid lifts into 3D (still near top-down, so it reads flat at first).
mark("lift");
step("height") {
  par {
    say(cap, "same grid → 3D");
    speak("Now lift the same grid into height. Nothing was redrawn — the cells became terrain.");
    fade(world.cells, 0.5); fade(world.lines, 0.5);
    show(land, 0.6);
  }
}

// 3 — pull back to see the WHOLE world.
mark("reveal");
step("pullback") {
  par {
    say(cap, "pull back");
    speak("Pull the camera back. The flat map was hiding a whole landscape.");
    orbit3(25, 36, 30, 3.4, smooth);
  }
}
wait(0.2);

// 4 — rotate around it.
mark("rotate");
step("orbit") {
  par {
    say(cap, "one grid, two worlds");
    speak("One grid. Two readings — a 2D map for paths, a 3D world for place. Manic bridges them.");
    recolor(cap, cyan);
    orbit3(185, 32, 30, 4.4, smooth);
  }
}

// 5 — fly in low over the peaks.
mark("zoom");
step("fly") {
  par {
    say(cap, "fly the ridges");
    speak("Fly in low over the ridges. Every peak is computed from the map you just watched settle.");
    orbit3(255, 15, 12, 3.8, smooth);
  }
}
wait(0.4);

// 6 — MANIC PROMO: this video is the product.
mark("manic");
par {
  fade(kicker, 0.35); fade(cap, 0.35); fade(me.footer, 0.35); fade(land, 0.45);
}
par {
  say(cap, "made with Manic");
  speak("And this whole Short was generated with Manic — a language for animated explainers.");
  show(promo, 0.6);
}
wait(0.2);
par {
  say(cap, "plain text → motion");
  speak("You write plain text. Manic turns it into grids, 3D, camera moves, and voice — no timeline editor.");
  show(promoSub, 0.5);
}
wait(0.2);
par {
  say(cap, "8gwifi.org/manic");
  speak("Learn more, try it free, and build your own explainers at eight g wifi dot org slash manic.");
  show(promoUrl, 0.5); pulse(promoUrl, 0.8);
}
wait(0.5);

// 7 — END CARD.
mark("endcard");
par {
  fade(cap, 0.4); fade(promo, 0.4); fade(promoSub, 0.4); fade(promoUrl, 0.4);
}
show(me.endcard, 0.6);
wait(1.8);

creator-noise-story

How Noise Builds Worlds — a Short walking procedural noise from 1D to fractal: raw rand(x) (jagged) vs smooth noise(x) (Perlin), then noise(x,y) tilting from a flat field into a 3D surface, then fbm stacking octaves into fractal terrain. Every visual is one formula in the shared expression engine — the arc that motivated adding rand/noise/fbm.

// How Noise Builds Worlds — a Creator v2 Short on procedural noise, 1D → 2D → 3D →
// fractal. Raw RANDOM values (jagged) vs smooth PERLIN noise(x); then noise(x,y) as
// a surface; then stacking octaves (fbm) for fractal detail. Every visual is one
// formula — `rand`, `noise`, `fbm`. Captions use the word-pop (karaoke) variant;
// the final scene pulls the camera back for a full view of the fractal world.
title("How Noise Builds Worlds");
canvas("9:16");
template("shorts");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Try_it_free safe=reels");
watermark(mk, (w*0.955-100, h*0.045+24), "Made With Manic");

// --- 1D: a coordinate frame with two curves, raw random vs smooth noise ---
axes(ax, (cx, h*0.33), w*0.4, 150);
color(ax, dim); untraced(ax);
plot(rnd, (cx, h*0.33), 62, 130, "rand(x)", (-6.5, 6.5));
color(rnd, magenta); untraced(rnd);
plot(perlin, (cx, h*0.33), 62, 130, "noise(x, 0)", (-6.5, 6.5));
color(perlin, cyan); glow(perlin, 0.7); untraced(perlin);

// --- 2D/3D: the same idea one dimension up. Near top-down so it reads flat first. ---
camera3((0, -1.5, 20), (0, 0, 0), 24);
surface3(hills, "noise(x*0.9, y*0.9)*2.0", (-4, 4), (-4, 4), 50);
color(hills, cyan); hidden(hills);
surface3(frac, "fbm(x*0.95, y*0.95)*2.4", (-4, 4), (-4, 4), 72);
color(frac, cyan); hidden(frac);

text(kicker, (cx, h*0.135), "random is not the same as noise");
size(kicker, 32); color(kicker, cyan); bold(kicker); wrap(kicker, w*0.82);
untraced(kicker); cursor(kicker);

// Word-pop captions — one per beat, popped in a word at a time, faded before the next.
caption(cR, "raw random values", (cx, h*0.75), 33, magenta); hidden(cR.words);
caption(cP, "smooth it into noise", (cx, h*0.75), 33, cyan); hidden(cP.words);
caption(cD, "add a dimension", (cx, h*0.75), 33, dim); hidden(cD.words);
caption(cL, "values become heights", (cx, h*0.75), 33, dim); hidden(cL.words);
caption(cF, "octaves build fractals", (cx, h*0.75), 33, cyan); hidden(cF.words);
caption(cE, "1D  2D  3D  fractal", (cx, h*0.75), 34, cyan); hidden(cE.words);
caption(cM, "one formula. That's Manic.", (cx, h*0.75), 32, cyan); hidden(cM.words);

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

// 1 — HOOK + raw random values (jagged).
mark("hook");
type(kicker, 1.3);
step("random") {
  par {
    draw(ax, 0.6);
    draw(rnd, 1.3);
    seq { wait(0.5); wordpop(cR, 0.14); }
  }
}
wait(0.5);

// 2 — smooth it into Perlin noise(x).
step("perlin") {
  par {
    fade(cR.words, 0.3);
    fade(rnd, 0.5);
    draw(perlin, 1.4);
    seq { wait(0.4); wordpop(cP, 0.13); }
  }
}
wait(0.6);

// 3 — one dimension up: noise(x,y) as a field (top-down reads flat).
step("to2d") {
  par {
    fade(cP.words, 0.3);
    fade(ax, 0.5); fade(perlin, 0.5);
    show(hills, 0.7);
    seq { wait(0.4); wordpop(cD, 0.14); }
  }
}

// 4 — tilt: the field IS a 3D surface (a heightmap).
step("lift") {
  par {
    fade(cD.words, 0.3);
    orbit3(25, 34, 16, 3.6, smooth);
    seq { wait(0.5); wordpop(cL, 0.13); }
  }
}
wait(0.5);

// 5 — stack octaves into fbm; pull the camera WAY back for the full world.
step("fbm") {
  par {
    fade(cL.words, 0.3);
    fade(hills, 0.6);
    show(frac, 0.7);
    orbit3(120, 40, 30, 3.4, smooth);
    seq { wait(0.5); wordpop(cF, 0.13); }
  }
}

// 6 — a slow tour of the whole fractal world at full distance.
step("tour") {
  par {
    fade(cF.words, 0.3);
    orbit3(240, 36, 30, 4.6, smooth);
    seq { wait(0.4); wordpop(cE, 0.16); }
  }
}
wait(0.4);

// 7 — THE POINT.
step("point") {
  seq {
    fade(cE.words, 0.3);
    wordpop(cM, 0.16);
  }
}
wait(1.1);

// 8 — END CARD.
mark("endcard");
par {
  fade(kicker, 0.4); fade(cM.words, 0.4); fade(me.footer, 0.4); fade(frac, 0.5);
}
show(me.endcard, 0.6);
wait(1.6);

creator-free-kicks

Roberto Carlos’ impossible free kick as a narrated Short: walk-in, Magnus with values, the RK4 freekick curls in for a GOAL while the zero-spin twin sails wide, then a cylinder flow explains the pressure difference. speak / say carry story VO vs captions; Manic promo outro. Physics proven, then explained, in one branded 9:16 story.

// Roberto Carlos' Banana Kick — Manic promo cut. The physics story sells the
// product: every path and streamline is computed from a plain `.manic` script,
// then the outro names Manic and points to 8gwifi.org/manic.
title("Roberto Carlos' Banana Kick");
canvas("9:16");
template("shorts");
voice("cartesia");                         // story narration
// voice("elevenlabs");
// voice("gtts");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=gold footer=signature cta=Try_it_free safe=reels");
watermark(mk, (w*0.955-100, h*0.045+24), "Made With Manic");

// --- schematic top-down pitch ---
let kx = cx;
let ky = h*0.66;
rect(gbox, (cx, h*0.20), w*0.66, h*0.24); outline(gbox, dim);
rect(goal, (cx, h*0.085), w*0.34, h*0.035); outline(goal, fg);
line(gline, (cx-w*0.5, h*0.105), (cx+w*0.5, h*0.105)); color(gline, dim);
for j in 0..5 { dot(walld{j}, (cx + (j-2)*w*0.052, h*0.40), 15); color(walld{j}, dim); tag(walld{j}, wall); }

// --- Roberto Carlos: a stick figure (points + reflowing segments), gait by hand ---
let fY   = ky + 48;
let hipY = ky - 4;
let neckY= ky - 96;
let handY= ky - 46;
let headY= ky - 114;
let sx0  = kx - 260;
point(neck, (sx0, neckY)); point(hip, (sx0, hipY));
point(handL,(sx0-24, handY)); point(handR,(sx0+24, handY));
point(footL,(sx0-16, fY)); point(footR,(sx0+16, fY));
hidden(neck); hidden(hip); hidden(handL); hidden(handR); hidden(footL); hidden(footR);
circle(head, (sx0, headY), 14); color(head, fg);
segment(spine, neck, hip); segment(armL, neck, handL); segment(armR, neck, handR);
segment(legL, hip, footL); segment(legR, hip, footR);
color(spine, fg); color(armL, fg); color(armR, fg); color(legL, fg); color(legR, fg);
stroke(spine, 4); stroke(armL, 4); stroke(armR, 4); stroke(legL, 4); stroke(legR, 4);
tag(head, pl); tag(spine, pl); tag(armL, pl); tag(armR, pl); tag(legL, pl); tag(legR, pl);

// --- the kick: RK4 Magnus banana; the ball rides at the feet until placed ---
freekick(rc, (kx, ky), 30, 22, 3.1, 13, 175);
color(rc, gold); glow(rc, 0.8); untraced(rc); color(rc.ball, fg);
to(rc.ball, x, sx0+52, 0.01); to(rc.ball, y, ky, 0.01);
// the counterfactual: same strike, no spin → no Magnus → sails wide (red dashed)
freekick(ns, (kx, ky), 30, 22, 0, 13, 175);
color(ns, red); glow(ns, 0.4); dashed(ns); untraced(ns); hidden(ns.ball);

equation(calc, (cx, h*0.74), `\mathbf{a}_M=\kappa\,(\hat{\boldsymbol\omega}\times\mathbf{v})`, 42);
color(calc, gold); hidden(calc);

// --- Act 2 physics inset: the ball as a spinning cylinder (built now, revealed later) ---
let mpy = h*0.42;
circle(mcyl, (cx, mpy), 60); color(mcyl, gold); filled(mcyl); hidden(mcyl);
for i in 0..15 {
  let y0 = -4.4 + i*0.62;
  trajectory(mfl{i},
    "1 - 1.44*(x*x-y*y)/((x*x+y*y)^2) - 0.7*y/(x*x+y*y)",
    "0 - 2.88*x*y/((x*x+y*y)^2) + 0.7*x/(x*x+y*y)",
    (-4.6, y0), (cx, mpy), 50, 460);
  color(mfl{i}, cyan); glow(mfl{i}, 0.35); untraced(mfl{i}); tag(mfl{i}, flow);
}
arrow(spinT, (cx-30, mpy-72), (cx+30, mpy-72)); color(spinT, gold); hidden(spinT);
arrow(spinB, (cx+30, mpy+72), (cx-30, mpy+72)); color(spinB, gold); hidden(spinB);
arrow(force, (cx+140, mpy+30), (cx+140, mpy-70)); color(force, lime); stroke(force, 6); hidden(force);
text(flab, (cx+200, mpy-34), "Magnus\nforce"); size(flab, 24); color(flab, lime); hidden(flab);
text(fastl, (cx, mpy-115), "faster → low pressure"); size(fastl, 24); color(fastl, cyan); hidden(fastl);
text(slowl, (cx, mpy+115), "slower → high pressure"); size(slowl, 24); color(slowl, magenta); hidden(slowl);

text(kicker, (cx, h*0.13), "Roberto Carlos' impossible free kick");
size(kicker, 32); color(kicker, gold); bold(kicker); wrap(kicker, w*0.82);
text(cap, (cx, h*0.80), ""); size(cap, 30); color(cap, dim); wrap(cap, w*0.84);
text(promo, (cx, h*0.42), "Manic"); size(promo, 72); color(promo, gold); bold(promo); hidden(promo);
text(promoSub, (cx, h*0.52), "plain text → animated explainers"); size(promoSub, 28); color(promoSub, cyan); wrap(promoSub, w*0.82); hidden(promoSub);
text(promoUrl, (cx, h*0.62), "8gwifi.org/manic"); size(promoUrl, 30); color(promoUrl, fg); bold(promoUrl); hidden(promoUrl);

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

untraced(kicker); cursor(kicker);

// Narration tells the story. Captions stay short punch-lines on screen.
// Configure once: voice("gtts"|"cartesia"). speak("…") = voice only;
// say(cap, "…") = text only; par both when needed.

// 1 — HOOK: open the legend.
mark("hook");
par {
  type(kicker, 1.3);
  speak("France, nineteen ninety-seven. Roberto Carlos stands thirty-five metres out — and takes a free kick the world still cannot believe.");
}

// 2 — WALK the ball in and place it (sin-phased gait).
show(cap, 0.3);
par {
  say(cap, "walk it in");
  speak("He walks the ball in himself and sets it down. No rush. The wall is waiting.");
}
for i in 1..11 {
  let bx = sx0 + i*20; let ph = i*90; let sw = 22*sin(ph*pi/180); let lift = 8*abs(sin(ph*pi/180));
  par {
    move(neck,(bx, neckY-lift*0.4),0.11,smooth); move(hip,(bx, hipY),0.11,smooth);
    move(handL,(bx-sw, handY),0.11,smooth); move(handR,(bx+sw, handY),0.11,smooth);
    move(footL,(bx+sw, fY-lift),0.11,smooth); move(footR,(bx-sw, fY-lift),0.11,smooth);
    move(head,(bx, headY-lift*0.4),0.11,smooth); move(rc.ball,(bx+52, ky),0.11,smooth);
  }
}
wait(0.3);

// 3 — PACE BACK; the calculation begins.
fade(kicker, 0.4); show(calc, 0.4);
par {
  say(cap, "pace back");
  speak("He paces back. Eyes on the posts. Somewhere in that run-up is a curve no keeper expects.");
}
for i in 1..6 {
  let bx = (kx-60) - i*18; let ph = i*90; let sw = 16*sin(ph*pi/180); let lift = 6*abs(sin(ph*pi/180));
  par {
    move(neck,(bx, neckY-lift*0.4),0.12,smooth); move(hip,(bx, hipY),0.12,smooth);
    move(handL,(bx-sw, handY),0.12,smooth); move(handR,(bx+sw, handY),0.12,smooth);
    move(footL,(bx+sw, fY-lift),0.12,smooth); move(footR,(bx-sw, fY-lift),0.12,smooth);
    move(head,(bx, headY-lift*0.4),0.12,smooth);
  }
}

// 4 — COMPUTE the Magnus law WITH VALUES, then lock it.
rewrite(calc, `\mathbf{a}_M=(0.05)(3.1)(30)`, 0.7, smooth);
rewrite(calc, `\mathbf{a}_M\approx 4.6\ \mathrm{m/s^2}`, 0.7, smooth);
par {
  say(cap, "Magnus locks");
  recolor(cap, lime);
  speak("Physics names the cheat code: Magnus acceleration. Spin crossed with velocity. About four point six metres per second squared of sideways push.");
}
rewrite(calc, `\text{curl}\approx 3\ \text{m}`, 0.6, smooth);
wait(0.3);

// 5 — RAN FAST up to the ball.
recolor(cap, dim); say(cap, ""); fade(calc, 0.4);
speak("Then he runs.");
for i in 1..9 {
  let bx = (kx-150) + i*15; let ph = i*120; let sw = 30*sin(ph*pi/180); let lift = 12*abs(sin(ph*pi/180));
  par {
    move(neck,(bx, neckY-lift*0.4),0.05,smooth); move(hip,(bx, hipY),0.05,smooth);
    move(handL,(bx-sw, handY),0.05,smooth); move(handR,(bx+sw, handY),0.05,smooth);
    move(footL,(bx+sw, fY-lift),0.05,smooth); move(footR,(bx-sw, fY-lift),0.05,smooth);
    move(head,(bx, headY-lift*0.4),0.05,smooth);
  }
}

// 6 — STRIKE → the banana swerves in by the post.
seq {
  par { move(footR,(kx-4, ky+34),0.13,smooth); move(hip,(kx-30, hipY),0.13,smooth); }
  par {
    draw(rc, 2.0); run(rc, 2.0);
    seq {
      wait(1.1);
      recolor(cap, gold);
      par {
        say(cap, "curl!");
        speak("The shot starts metres wide of the post — then the air bends it in.");
      }
    }
  }
}
wait(0.4);

// 7 — GOAL.
recolor(cap, gold);
par {
  say(cap, "GOAL");
  speak("Goal. Without that spin, the ball never finds the net.");
  flash(goal, gold); pulse(goal, 0.7);
}
wait(0.5);

// 7.5 — proof: same strike, no spin → sails wide.
recolor(cap, red);
par {
  say(cap, "no spin → wide");
  speak("Same strike. Zero spin. No air pushing sideways. Watch it sail wide — the proof.");
  draw(ns, 1.3);
}
wait(0.5);

// 8 — REWIND.
recolor(cap, dim);
par {
  say(cap, "rewind");
  speak("So why does spin bend a football? Rewind.");
  erase(rc, 0.9); erase(ns, 0.9);
  to(rc.ball, x, kx, 0.9, smooth); to(rc.ball, y, ky, 0.9, smooth);
}
wait(0.3);

// 9 — spinning cylinder + flow field.
par {
  say(cap, "spinning cylinder");
  speak("Zoom into the ball. In flight it is a spinning cylinder in the air stream.");
  fade(pl, 0.5); fade(head, 0.5);
  fade(gbox, 0.5); fade(goal, 0.5); fade(gline, 0.5); fade(wall, 0.5);
  to(rc.ball, x, cx, 0.6, smooth); to(rc.ball, y, mpy, 0.6, smooth);
  show(mcyl, 0.5);
}
stagger(0.04) { for i in 0..15 { draw(mfl{i}, 0.9); } }
wait(0.3);

// 10 — asymmetry → Magnus force.
par {
  say(cap, "faster / slower");
  speak("Spin drags the air: faster on top, slower below. Fast air means low pressure.");
  show(spinT, 0.4); show(spinB, 0.4); show(fastl, 0.5); show(slowl, 0.5);
}
wait(0.3);
par {
  say(cap, "Magnus force");
  speak("The pressure difference pushes the ball sideways. That sideways push is the Magnus force.");
  show(force, 0.6); show(flab, 0.5); pulse(force, 0.8);
}
wait(0.4);

// 11 — the point.
recolor(cap, cyan);
par {
  say(cap, "computed, not drawn");
  speak("That force is what curled Carlos' free kick. Every path you saw was computed — not drawn by hand.");
}
wait(0.5);

// 12 — MANIC PROMO: this video is the product.
mark("manic");
par {
  fade(cap, 0.35); fade(me.footer, 0.35);
  fade(mcyl, 0.4); fade(flow, 0.4); fade(rc.ball, 0.4);
  fade(spinT, 0.4); fade(spinB, 0.4); fade(force, 0.4); fade(flab, 0.4); fade(fastl, 0.4); fade(slowl, 0.4);
  fade(kicker, 0.35);
}
par {
  say(cap, "made with Manic");
  speak("And this whole video was generated with Manic — a language for animated explainers.");
  show(promo, 0.6);
}
wait(0.25);
par {
  say(cap, "plain text → motion");
  speak("You write plain text. Manic turns it into motion, math, physics, and voice — no timeline editor, no keyframes by hand.");
  show(promoSub, 0.5);
}
wait(0.25);
par {
  say(cap, "8gwifi.org/manic");
  speak("Learn more, try it free, and build your own explainers at eight g wifi dot org slash manic.");
  show(promoUrl, 0.5); pulse(promoUrl, 0.8);
}
wait(0.6);

// 13 — END CARD.
mark("endcard");
par {
  fade(cap, 0.4); fade(promo, 0.4); fade(promoSub, 0.4); fade(promoUrl, 0.4);
}
show(me.endcard, 0.6);
wait(1.8);

creator-pathfinding

The Shortest Path — a Short where imported VECTOR art poses the problem and a Manic algorithm solves it: an svg() robot and pin (crisp, faithful colours) mark the start and goal of a maze, a naive straight line cuts through the walls, then A* (gridastar) searches the grid cell-by-cell and traces the true shortest path around them. Vectors imported, path computed — Manic does both, in one branded 9:16 file with ElevenLabs problem→solve→CTA VO.

// The Shortest Path — a Short where VECTOR art poses the problem and a Manic
// ALGORITHM solves it. An imported robot and pin (crisp `svg()` vectors) sit at the
// start and goal of a maze; a naive straight line cuts through the walls; then A*
// (`gridastar`) searches the space cell-by-cell and traces the true shortest route.
// Vectors imported, path computed — Manic does both, in one branded 9:16 file.
title("The Shortest Path");
canvas("9:16");
template("shorts");

voice("elevenlabs");                       // promo narration (ELEVENLABS_API_KEY)
// voice("elevenlabs", "alice");
// voice("cartesia");  // voice("gtts");   // free fallback
// speak("…") = voice only; say(cap, "…") = on-screen caption.

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=gold footer=signature cta=Try_it_free safe=reels");
watermark(mk, (w*0.955-100, h*0.045+24), "Made With Manic");

// --- the maze grid + the cell geometry (so the vector icons land on cells) ---
let cs = w*0.11;
let gx = cx;
let gy = h*0.43;
let sx = gx - 2.5*cs;   let sy = gy - 3.5*cs;   // start cell (0,0) centre
let px = gx + 2.5*cs;   let py = gy + 3.5*cs;   // goal  cell (5,7) centre

grid(g, "@ . . . . . ; # # # # # . ; . . . . . . ; . # # # # # ; . . . . . . ; # # # # # . ; . . . . . . ; . # # # # *", (gx, gy), 6, 8, cs);
neighbors(g, "4");

// --- imported vector characters (faithful colours, crisp at any size) ---
svg(bot, (sx, sy), "asset:svg/robot.svg", cs*0.8);   z(bot, 6);   hidden(bot);
svg(dest, (px, py), "asset:svg/pin.svg", cs*0.8);    z(dest, 6);  hidden(dest);

// the naive "just go straight" line — cuts across the walls
line(naive, (sx, sy), (px, py)); color(naive, red); dashed(naive); z(naive, 4); hidden(naive);

text(hook, (cx, h*0.12), "Can the robot reach the pin?");
size(hook, 34); color(hook, gold); bold(hook); wrap(hook, w*0.82);
text(cap, (cx, h*0.78), ""); size(cap, 30); color(cap, dim); wrap(cap, w*0.84);
socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");
untraced(hook); cursor(hook);

// 1 — HOOK
mark("hook");
type(hook, 1.2);
speak("How does a robot find its way through a maze?");

// 2 — BUILD: the maze is the world; the imported vectors are its characters
show(cap, 0.3); say(cap, "a maze — the robot and pin are imported SVG vectors");
speak("Drop in a robot and its goal — both imported as crisp SVG vectors.");
par { show(bot, 0.5); show(dest, 0.5); }
wait(0.6);

// 3 — PROBLEM: the straight line fails
fade(hook, 0.4); recolor(cap, red); say(cap, "a straight line? it cuts right through the walls");
speak("The obvious answer — a straight line — slams right into the walls.");
show(naive, 0.5); flash(naive, red);
wait(0.9);

// 4 — SOLVE: A* searches, then traces the real route
fade(naive, 0.4); recolor(cap, dim); say(cap, "A* searches the space, cell by cell…");
speak("So Manic runs A-star — searching the grid, cell by cell,");
gridastar(g, (0,0), (5,7), manhattan);
recolor(cap, gold); say(cap, "…and traces the true shortest path");
speak("until it traces the true shortest path around every wall.");
draw(g.path, 1.6);
wait(0.6);

// 5 — POINT
recolor(cap, cyan); say(cap, "vectors imported, path computed — Manic does both");
speak("Vectors imported, path computed — Manic does both. Turn plain text into animated explainers, free, at eight g wifi dot org slash manic.");
wait(1.2);

// 6 — END CARD — clear the maze, path, and characters so the CTA stands alone
mark("endcard");
par {
  fade(cap, 0.4); fade(me.footer, 0.4);
  fade(g.cells, 0.4); fade(g.lines, 0.4); fade(g.path, 0.4);
  fade(g.frontier, 0.4); fade(g.visited, 0.4);
  fade(bot, 0.4); fade(dest, 0.4);
}
show(me.endcard, 0.6);
wait(1.6);

creator-monty-hall

The Monty Hall Problem — the most-argued puzzle in probability, as an ElevenLabs-narrated 9:16 Short where imported SVG carries the whole story: three door emoji, a car, goats, a party popper. You pick a door, the host lifts another to a goat — and the teaching beat is VISUAL: the opened door’s 1/3 chance visibly SLIDES onto the other door, counting it up to 2/3, so switching DOUBLES your odds. The payoff morphs a goat into the car with a confetti burst, then a reveal-all finale (goat · car · goat) and a Manic CTA card. speak VO carries the story, say the captions; every actor is one svg() line. Problem → solution → CTA.

// creator-monty-hall.manic — a Creator v2 Short on the Monty Hall problem, one of
// the most-searched (and most-argued) puzzles in probability, narrated with an
// ElevenLabs voice story. The whole cast is imported SVG — three door emoji, a car,
// goats, a party popper — and the teaching beat is visual: when the host opens a
// goat door, its 1/3 chance visibly SLIDES onto the other door, making it 2/3. The
// payoff `morph`s a goat into the car with a confetti `burst`. Problem → the
// counter-intuitive solution → CTA, 9:16 shorts template, branded.
//
//   ELEVENLABS_API_KEY=... manic examples/creator-monty-hall.manic --record out.mp4
//   speak("…") = voice only;  say(cap,"…") = on-screen caption.
title("The Monty Hall Problem");
canvas("9:16");
template("shorts");
voice("elevenlabs");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Try_it_free safe=reels");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

// --- header ---
text(kick, (cx, h*0.10), "The Monty Hall Problem"); size(kick, 48); color(kick, fg); bold(kick); wrap(kick, w*0.86); hidden(kick);
text(sub, (cx, h*0.155), "The puzzle that fooled even the pros"); size(sub, 29); color(sub, dim); wrap(sub, w*0.82); hidden(sub);

// --- three doors (imported emoji), numbered, with a 1/3 odds chip each ---
let dy = h*0.375;
let dsz = w*0.185;
let xL = w*0.22; let xM = w*0.50; let xR = w*0.78;
svg(door1, (xL, dy), "asset:svg/emoji/door.svg", dsz); hidden(door1);
svg(door2, (xM, dy), "asset:svg/emoji/door.svg", dsz); hidden(door2);
svg(door3, (xR, dy), "asset:svg/emoji/door.svg", dsz); hidden(door3);
text(t1, (xL, dy-dsz*0.66), "1"); size(t1, 32); color(t1, dim); bold(t1); hidden(t1);
text(t2, (xM, dy-dsz*0.66), "2"); size(t2, 32); color(t2, dim); bold(t2); hidden(t2);
text(t3, (xR, dy-dsz*0.66), "3"); size(t3, 32); color(t3, dim); bold(t3); hidden(t3);
counter(chip1, (xL, dy+dsz*1.02), 33, 0, "", "%"); size(chip1, 44); color(chip1, dim); bold(chip1); hidden(chip1);
counter(chip2, (xM, dy+dsz*1.02), 33, 0, "", "%"); size(chip2, 44); color(chip2, dim); bold(chip2); hidden(chip2);
counter(chip3, (xR, dy+dsz*1.02), 33, 0, "", "%"); size(chip3, 44); color(chip3, dim); bold(chip3); hidden(chip3);

// a selection ring for "your pick"
circle(pick, (xL, dy), dsz*0.62); outlined(pick); outline(pick, cyan); stroke(pick, 5); glow(pick, 0.8); hidden(pick);

// prizes hidden BEHIND each door (revealed when a door lifts)
svg(goat1, (xL, dy), "asset:svg/emoji/goat.svg", dsz*0.86); z(goat1, -1); hidden(goat1);
svg(goat3, (xR, dy), "asset:svg/emoji/goat.svg", dsz*0.86); z(goat3, -1); hidden(goat3);
// behind door 2: a goat that MORPHS into the car (the payoff flourish)
svg(goatH, (xM, dy), "asset:svg/emoji/goat.svg", dsz*0.92); z(goatH, -1); hidden(goatH);
svg(carH,  (xM, dy), "asset:svg/emoji/car.svg",  dsz*1.02); z(carH, -1); hidden(carH);
morph(goatH, carH);
svg(party, (xM+dsz*0.9, dy-dsz*0.8), "asset:svg/emoji/party.svg", dsz*0.7); z(party, 6); hidden(party);
circle(bcore, (xM, dy), 30); hidden(bcore);
particles(sparks, bcore, 26, 8, 11, "random"); color(sparks, gold); glow(sparks, 0.9); z(sparks, 7); hidden(sparks);

// one caption line, retexted through the story
text(cap, (cx, h*0.66), ""); size(cap, 35); color(cap, dim); bold(cap); wrap(cap, w*0.86); hidden(cap);

socials(me);
endcard(me, "title=Always_Switch cta=8gwifi.org/manic");

// ---------------- the story (voice leads; visuals punctuate) ----------------
par { show(kick); show(sub); }
stagger(0.16) { show(door1); show(door2); show(door3); }
par { show(t1); show(t2); show(t3); show(chip1); show(chip2); show(chip3); }
show(cap, 0.3); say(cap, "1 car, 2 goats — 1/3 each.");
speak("Three doors. One car, two goats. You pick door one.");
par { show(pick); pulse(door1); }
say(cap, "You pick Door 1.");

speak("Now the host, who knows, opens door three. A goat.");
recolor(cap, dim); say(cap, "Host opens Door 3 — a goat.");
show(goat3);
par { move(door3, (xR, dy-h*0.30), 0.7, smooth); fade(door3); }

speak("The twist: door three's odds don't vanish. They slide onto door two.");
recolor(cap, cyan); say(cap, "Its 1/3 slides to Door 2.");
par { move(chip3, (xM, dy+dsz*1.02), 0.8, smooth); fade(chip3); to(chip2, value, 67, 0.8); }
par { recolor(chip2, cyan); recolor(chip1, magenta); }

speak("Most people say fifty-fifty. It isn't.");
recolor(cap, red); say(cap, "Feels like 50/50. It's not."); shake(cap);

speak("Your door stays one-in-three. Door two? Two-in-three. Switching doubles it.");
recolor(cap, gold); say(cap, "STAY 33%   ·   SWITCH 67%");
par { pulse(chip2); pulse(door2); }

speak("So you switch...");
recolor(cap, dim); say(cap, "So you switch…");
show(goatH);
par { move(door2, (xM, dy-h*0.30), 0.7, smooth); fade(door2); fade(chip1); fade(chip2); }

speak("...and the goat becomes a car.");
to(goatH, morph, 1, 0.9, smooth);
par { fade(goatH); show(carH); }
recolor(cap, gold); say(cap, "…and win the car!");
par { show(sparks, 0.05); burst(sparks, 1.1); show(party); pulse(carH); }
wait(0.6);

speak("Door one? A goat. Switching wins two out of three.");
recolor(cap, dim); say(cap, "Door 1 was a goat.");
show(goat1);
par { move(door1, (xL, dy-h*0.30), 0.7, smooth); fade(door1); fade(pick); fade(party); }
wait(0.4);

speak("Always switch. One Manic script made this — turn any idea into a video at eight g wifi dot org slash manic.");
par { fade(kick); fade(sub); fade(cap); fade(carH); fade(goat1); fade(goat3); fade(t1); fade(t2); fade(t3); fade(chip3); }
show(me.endcard);
wait(2.6);

gradient-fastest-descent-shorts

The brachistochrone as a branded 9:16 Short: four height-colored wires race under gravity, the cycloid wins, then a "curvature" gradient reveals why — it bends hardest at the start. Creator chrome (socials + end card) mirrors creator-free-kicks; companion 16:9 cut is gradient-fastest-descent.

// ============================================================================
//  gradient-fastest-descent-shorts.manic — Bernoulli's brachistochrone as a
//  9:16 cinematic short, told THROUGH gradients
//  (companion: gradient-fastest-descent.manic, the 16:9 cut)
// ----------------------------------------------------------------------------
//  THE PROBLEM (Bernoulli, 1696): which wire gets a bead from A to B fastest?
//  THE GRADIENTS: every ramp is a vertical 3-stop speedometer
//  (v = √(2gΔh) — depth IS speed); the winner's secret is a curvature gradient.
//
//  Pattern mirrors creator-free-kicks.manic: hook → setup → race → secret →
//  endcard. Every curve and bead is RK4, not drawn.
// ============================================================================

title("The Fastest Descent");
canvas("9:16");
template("shorts");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=gold footer=signature cta=Try_it_free safe=reels");
watermark(mk, (w*0.955-100, h*0.045+24), "Made With Manic");

// ---- backdrop ----
circle(stage, (cx, h*0.42), w*0.55);
filled(stage);
gradient(stage, panel, void, radial);
opacity(stage, 0.55);

// ---- the race, sized for portrait: A upper-left, B lower-right ----
let rx = w*0.14;
let ry = h*0.30;
let ru = w*0.22;
brachistochrone(race, (rx, ry), ru);
untraced(race.straight); untraced(race.circle); untraced(race.parabola); untraced(race.cycloid);
hidden(race.bead_straight); hidden(race.bead_circle); hidden(race.bead_parabola); hidden(race.bead_cycloid);
hidden(race.markA); hidden(race.labelA); hidden(race.markB); hidden(race.labelB);
stroke(race.straight, 4); stroke(race.circle, 4); stroke(race.parabola, 4); stroke(race.cycloid, 6);
opacity(race.straight, 0.95); opacity(race.circle, 0.95); opacity(race.parabola, 0.95); opacity(race.cycloid, 1);

// depth IS speed — blue high (potential), gold low (kinetic)
gradient(race.straight, gold, cyan, blue, 270);
gradient(race.circle,   gold, cyan, blue, 270);
gradient(race.parabola, gold, cyan, blue, 270);
gradient(race.cycloid,  gold, cyan, blue, 270);

// ghost cycloid for the curvature reveal
brachistochrone(ghost, (rx, ry), ru);
hidden(ghost.straight); hidden(ghost.circle); hidden(ghost.parabola);
hidden(ghost.bead_straight); hidden(ghost.bead_circle); hidden(ghost.bead_parabola); hidden(ghost.bead_cycloid);
hidden(ghost.markA); hidden(ghost.labelA); hidden(ghost.markB); hidden(ghost.labelB);
hidden(ghost.cycloid); untraced(ghost.cycloid);
stroke(ghost.cycloid, 7);
gradient(ghost.cycloid, dim, magenta, "curvature");
glow(ghost.cycloid, 0.7);

// ---- typography ----
text(kicker, (cx, h*0.11), "shortest path — or fastest?");
size(kicker, 32); color(kicker, gold); bold(kicker); wrap(kicker, w*0.84);
untraced(kicker); cursor(kicker);

equation(law, (cx, h*0.62), `v=\sqrt{2g\,\Delta h}`, 38);
color(law, cyan); hidden(law);

text(cap, (cx, h*0.74), ""); size(cap, 28); color(cap, dim); wrap(cap, w*0.86);

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

// ============================== SCRIPT ==============================

// 1 — HOOK.
mark("hook");
type(kicker, 1.2);

// 2 — THE PROBLEM.
show(cap, 0.3);
say(cap, "Bernoulli, 1696 — a bead slides from A down to B. Gravity only.");
par {
  show(race.markA, 0.35); show(race.labelA, 0.25);
  show(race.markB, 0.35); show(race.labelB, 0.25);
}
pulse(race.markA); pulse(race.markB);
wait(0.4);

// 3 — FOUR WIRES, each a height→speed color bar.
say(cap, "four wires — colored by depth, and depth IS speed");
stagger(0.12) {
  draw(race.straight, 0.65);
  draw(race.circle, 0.65);
  draw(race.parabola, 0.65);
  draw(race.cycloid, 0.85);
}
show(law, 0.45);
wait(0.5);
say(cap, "blue = potential · gold = all of it cashed into speed");
wait(0.7);

// 4 — THE RACE.
say(cap, "release all four at once …");
par {
  show(race.bead_straight, 0.2);
  show(race.bead_circle, 0.2);
  show(race.bead_parabola, 0.2);
  show(race.bead_cycloid, 0.2);
}
run(race, 5.5);

// 5 — THE WINNER.
recolor(cap, gold);
say(cap, "the CYCLOID wins — the straight line isn't even close");
flash(race.cycloid, magenta);
glow(race.bead_cycloid, 1.9);
pulse(race.bead_cycloid);
wait(0.7);

// 6 — THE SECRET: curvature gradient.
recolor(cap, dim);
say(cap, "its secret, colored by curvature — it bends hardest at the start");
par {
  fade(race.straight, 0.4);
  fade(race.circle, 0.4);
  fade(race.parabola, 0.4);
  fade(race.cycloid, 0.4);
  fade(race.bead_straight, 0.35);
  fade(race.bead_circle, 0.35);
  fade(race.bead_parabola, 0.35);
  fade(race.bead_cycloid, 0.35);
  fade(law, 0.35);
}
show(ghost.cycloid, 0.15);
draw(ghost.cycloid, 1.3);
wait(0.35);
say(cap, "a near-vertical dive buys gold-speed immediately");
flash(ghost.cycloid, magenta);
wait(0.8);

// 7 — POINT + ENDCARD.
recolor(cap, cyan);
say(cap, "every color is computed — depth is the speedometer, the bend is the strategy");
wait(0.9);

mark("endcard");
par {
  fade(cap, 0.4);
  fade(me.footer, 0.4);
  fade(kicker, 0.4);
  fade(ghost.cycloid, 0.4);
  fade(race.cycloid, 0.4);
  fade(race.bead_cycloid, 0.4);
  fade(race.markA, 0.3); fade(race.markB, 0.3);
  fade(race.labelA, 0.3); fade(race.labelB, 0.3);
  fade(stage, 0.4);
}
show(me.endcard, 0.6);
wait(1.6);

gradient-pendulum-shorts

Galileo’s chandelier as a Short told THROUGH a "speed" gradient: an RK4 pendulum swings, then its arc is colored by true local speed — gold floods the bottom, blue pools at the tips. The color IS the simulation (gradient(p.path, blue, cyan, gold, "speed")), not a painted trail. Hook → reveal → energy law → prove-on-the-arc → end card.

// ============================================================================
//  gradient-pendulum-shorts.manic — a 9:16 cinematic short told THROUGH a
//  "speed" gradient. Sister piece to the brachistochrone pair
//  (gradient-fastest-descent.manic / gradient-fastest-descent-shorts.manic).
// ----------------------------------------------------------------------------
//  THE PROBLEM (Galileo, 1583): watching a chandelier swing in the Pisa
//  cathedral, Galileo timed it with his own pulse. But WHERE along the arc is
//  the bob fastest — and how would you ever see that?
//
//  THE GRADIENT DOES THE PHYSICS: the swing arc is a pre-simulated RK4
//  trajectory, uniformly sampled in time — so gradient(p.path, ..., "speed")
//  colors it by its TRUE local speed. Gold floods the bottom (all kinetic),
//  blue pools at the ends (the bob stands still for an instant). Nothing is
//  keyframed; the color IS the simulation.
//
//  Pattern mirrors creator-free-kicks.manic: hook → problem → reveal → law →
//  prove on the painted arc → endcard.
// ============================================================================

title("Galileo's Chandelier");
canvas("9:16");
template("shorts");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_math_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=gold footer=signature cta=Try_it_free safe=reels");
watermark(mk, (w*0.955-100, h*0.045+24), "Made With Manic");

// ---- backdrop: a radial pool of light under the chandelier ----
circle(halo, (cx, h*0.42), w*0.52);
filled(halo);
gradient(halo, panel, void, radial);
opacity(halo, 0.8);

// ---- the chandelier: a real RK4 pendulum, arc uniformly sampled in time ----
pendulum(p, (cx, h*0.26), 1, 55, w*0.36);
hidden(p.overlays);
untraced(p.path);
stroke(p.path, 7);
opacity(p.path, 0.95);
// the reveal: 3 stops by TRUE local speed — slowest first, fastest last
gradient(p.path, blue, cyan, gold, "speed");
color(p.bob, gold); glow(p.bob, 0.7);
stroke(p.rod, 3);

// ---- typography ----
text(kicker, (cx, h*0.11), "where is a pendulum FASTEST?");
size(kicker, 34); color(kicker, gold); bold(kicker); wrap(kicker, w*0.82);
untraced(kicker); cursor(kicker);

equation(law, (cx, h*0.64), `mgh \;=\; \tfrac{1}{2}mv^2`, 40);
color(law, cyan); hidden(law);

text(cap, (cx, h*0.76), ""); size(cap, 30); color(cap, dim); wrap(cap, w*0.84);

socials(me);
endcard(me, "title=Try_Manic cta=8gwifi.org/manic");

// ============================== SCRIPT ==============================

// 1 — HOOK.
mark("hook");
type(kicker, 1.2);

// 2 — GALILEO'S PROBLEM.
show(cap, 0.3);
say(cap, "1583 — Galileo times a swinging chandelier with his own pulse");
par {
  show(p.pivot, 0.4);
  show(p.rod, 0.4);
  show(p.bob, 0.4);
}
pulse(p.bob);
wait(0.4);

// 3 — WATCH IT SWING. Your eye can't catch where it's quickest.
say(cap, "watch it — can you SEE where it moves fastest?");
swing(p, 4);
wait(0.3);

// 4 — THE REVEAL: paint the arc with its own speed.
say(cap, "freeze — and color the arc by its true speed");
draw(p.path, 1.8);
wait(0.5);
recolor(cap, gold);
say(cap, "gold floods the bottom — blue pools at the tips, where it stops for an instant");
flash(p.path, gold);
wait(0.8);

// 5 — WHY: energy. Height traded for speed, every swing, exactly.
recolor(cap, dim);
say(cap, "height falls, speed rises — energy just changes clothes");
show(law, 0.5);
wait(0.5);
rewrite(law, `v=\sqrt{2gh}`, 0.8, smooth);
say(cap, "at the lowest point ALL the height has become speed — that's the gold");
wait(0.8);

// 6 — PROVE IT: run the bob on its own painted speedometer.
recolor(cap, cyan);
say(cap, "the color is computed, not painted — a real RK4 swing on its own speedometer");
swing(p, 4);
wait(0.5);

// 7 — END CARD.
mark("endcard");
par {
  fade(cap, 0.4);
  fade(me.footer, 0.4);
  fade(law, 0.4);
  fade(kicker, 0.4);
  fade(p.path, 0.4);
  fade(p.rod, 0.4);
  fade(p.bob, 0.4);
  fade(p.pivot, 0.4);
  fade(halo, 0.4);
}
show(me.endcard, 0.6);
wait(1.6);

creator-v2-options-socials

The asset-free v2.4 review scene: collision-safe question hierarchy, professional A/B/C/D cards, uniform correct-state spacing, and native YouTube/X/web identity lockups.

// Creator v2.4 review scene: question hierarchy, A/B/C/D answer cards,
// uniform correct-state spacing, and asset-free native social identities.
title("Creator v2.4 — Options + Socials");
canvas("9:16");
template("mono");
watermark(manicMark, (w*0.895-100, h*0.075+24), "Made With Manic");

creator(me, "@anish2good name=Olympiad_Minute yt=zarigatongy x=@anish2good web=8gwifi.org/manic footer=social accent=cyan safe=reels");

quiz(q, `In cyclic quadrilateral $ABCD$, $\angle A=68^\circ$. What is $\angle C$?`,
     "studio labels=letters layout=auto density=comfortable motion=calm safe=reels accent=cyan");
option(q, `$68^\circ$`);
option(q, `$102^\circ$`);
option(q, `$112^\circ$`, correct);
option(q, `$122^\circ$`);

timing(q, "balanced ask=1.2 options=1 think=4.8 reveal=0.8 hold=2.2 stagger=0.06");
timerstyle(q, "look=bar position=below number=outside direction=drain color=cyan track=dim label=THINK finish=pulse");

socials(me);
run(q);

creator-v2

The complete v2 core: responsive studio quiz, optics media, width-aware answer cards, a signature creator footer, optional explanation and a branded final end card.

// Creator Kit v2 core — responsive studio quiz + reusable brand system.
// Change the canvas to (1080,1350), (1080,1080), or (1280,720): the same
// question, media, choices, timer and footer reflow into the available space.
title("Creator Kit v2 — Optics Quiz");
canvas("9:16");
template("shorts");
watermark(manicMark, (w*0.91-100, h*0.055+24), "Made With Manic");

creator(me, "@anish2good name=Optics_Lab tagline=Physics_made_visible yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Follow_for_more safe=shorts");

quiz(q, "Which glass separates blue and red light more?",
     "studio layout=media-first reveal=rise timer=bar density=comfortable motion=studio safe=shorts accent=cyan");
option(q, "BK7 crown glass");
option(q, "SF11 flint glass", correct);
option(q, "Both equally");
option(q, "Neither material");
explain(q, "SF11 has stronger wavelength dispersion.", "Sellmeier model");

// Any static kit figure or tagged group can occupy the responsive media region.
prism(p, (540, 670), "sf11");
figure(p);

socials(me);
endcard(me, "cta=Follow_for_more");

par {
  run(q, 12);
  run(p, 12);
}
par {
  fade(q.parts, 0.45);
  fade(p, 0.45);
  fade(me.footer, 0.45);
}
show(me.endcard, 0.6);
wait(1.4);

creator-v2-timing

Timing v2 in a portrait quiz: exact ask/options/think/reveal/hold phases, LaTeX media, and a segmented timer whose presentation can change without changing the choreography.

// Creator Timing v2 — independent choreography and timer presentation.
// `timing` controls WHEN each beat happens; `timerstyle` controls how the
// countdown looks. With explicit phases, call run(q) without a second duration.
title("Creator Timing v2");
canvas("9:16");
template("shorts");
watermark(manicMark, (w*0.91-100, h*0.055+24), "Made With Manic");

creator(me, "@anish2good name=Number_Lab tagline=Pause_predict_prove yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=magenta secondary=cyan footer=signature cta=Try_the_next_one safe=shorts");

quiz(q, `Which number is equal to $2^5$?`,
     "studio layout=media-first reveal=rise density=comfortable motion=calm safe=shorts accent=magenta");
option(q, `$10$`);
option(q, `$16$`);
option(q, `$32$`, correct);
option(q, `$64$`);
explain(q, `$2^5=2\times2\times2\times2\times2=32$.`);

equation(eq, (cx, 650), `2^5 = 2\times2\times2\times2\times2`, 72);
color(eq, magenta); figure(eq); hidden(eq);

// Absolute phases: 1.2s question, 1.1s answers, 6s thinking, 0.8s reveal,
// then a 2.2s answer hold. The total is derived automatically by run(q).
timing(q, "calm ask=1.2 options=1.1 think=6 reveal=0.8 hold=2.2 stagger=0.07");

// A creative segmented timer in the media corner. Change only this line to
// ring/bar/number/ticks/pulse/none without changing the choreography.
timerstyle(q, "look=segments position=below number=outside direction=drain size=large thickness=1.2 color=magenta track=dim label=THINK font=display finish=pulse");

socials(me);
par {
  run(q);
  show(eq, 0.55);
}

creator-v2-timers

All six native Timing v2 looks—ring, bar, number, segments, ticks and pulse—running side by side. Native shapes keep every look scalable, theme-aware and progress-animatable.

// Timing v2 look gallery — every timer uses the same six-second behaviour.
// All visuals are native manic primitives: scalable, theme-aware and animated.
title("Creator Timing v2 — Native Looks");
canvas("16:9");
template("shorts");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

text(head, (cx, 70), "TIMING V2 — CHOOSE THE LOOK");
size(head, 34); bold(head); color(head, fg);

countdown(ring,     (220, 245), 6, "ring size=small color=cyan label=RING finish=hold");
countdown(bar,      (640, 245), 6, "bar size=small color=magenta number=outside label=BAR finish=hold");
countdown(number,  (1060, 245), 6, "number size=large font=display color=gold label=NUMBER finish=hold");
countdown(segments, (220, 520), 6, "segments size=small color=lime label=SEGMENTS finish=hold");
countdown(ticks,    (640, 520), 6, "ticks size=small direction=fill color=cyan label=TICKS finish=hold");
countdown(pulse,   (1060, 520), 6, "pulse size=small font=display color=magenta label=PULSE finish=hold");

par {
  run(ring, 6);
  run(bar, 6);
  run(number, 6);
  run(segments, 6);
  run(ticks, 6);
  run(pulse, 6);
}

creator-v2-timing-square

A square feed-card variant with a scaled dramatic preset and a filling tick timer, showing that timing and timer placement reflow independently across formats.

// Creator Timing v2 — square preset scaling and responsive timer placement.
title("Creator Timing v2 — Square");
canvas("1:1");
template("shorts");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

creator(me, "@anish2good name=Proof_Minute tagline=See_the_pattern yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=gold footer=compact cta=Save_this safe=clean");

quiz(q, `If $x+1/x=3$, find $x^2+1/x^2$`,
     "glass layout=grid density=comfortable motion=studio pace=dramatic accent=cyan");
option(q, `$5$`);
option(q, `$7$`, correct);
option(q, `$9$`);
option(q, `$11$`);
explain(q, `Square the given relation: $x^2+2+\frac{1}{x^2}=9$.`);

equation(clue, (cx, cy), `\left(x+\frac1x\right)^2`, 72);
color(clue, cyan); figure(clue);

// The timer fills clockwise below the header. The dramatic preset is scaled
// proportionally to a compact eight-second feed clip by run(q, 8).
timerstyle(q, "look=ticks position=below number=inside direction=fill size=small thickness=1.1 color=cyan track=dim label=SOLVE font=mono finish=flash");

socials(me);
run(q, 8);

creator-v2-olympiad-geometry

An olympiad-level geometry Reel built as pause → predict → prove, with a responsive construction, authored explanation and reusable creator identity.

// Creator Kit v2 — olympiad geometry problem.
//
// Problem: From an external point P, tangents PA and PB touch a circle with
// centre O and radius 5. If OP = 13, find the chord length AB.
//
// The tangent points are computed by the geo kit. Nothing is eyeballed:
// tangent-radius perpendicularity, chord AB, and M = AB ∩ OP remain live.
title("Creator v2 — Olympiad Geometry");
canvas("9:16");
template("shorts");
watermark(manicMark, (w*0.91-100, h*0.055+24), "Made With Manic");

creator(me, "@anish2good name=Geometry_Lab tagline=See_the_hidden_lemma yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Pause_then_prove safe=shorts");

quiz(q, `From $P$, $PA$ and $PB$ are tangents to circle $(O)$. If $r=5$ and $OP=13$, find $AB$.`,
     "studio layout=media-first reveal=rise timer=bar density=compact motion=calm safe=shorts accent=cyan");
option(q, `$\tfrac{60}{13}$`);
option(q, `$10$`);
option(q, `$\tfrac{120}{13}$`, correct);
option(q, `$12$`);
explain(q, `Tangent-radius gives $OA\perp PA$, hence $PA=12$. With $M=AB\cap OP$, $\triangle OMA\sim\triangle OAP$, so $AM/5=12/13$ and $AB=120/13$.`);

// Source geometry: 40 px represents one unit, so r = 5 and OP = 13.
point(O, (430, 560), "O");
point(R, (430, 360));
point(P, (950, 560), "P");
hidden(O); hidden(R); hidden(P);

circle2(circ, O, R);
color(circ, dim); stroke(circ, 3); untraced(circ);

tangent(t, P, O, R);
label(t0, "A", (22, -18));
label(t1, "B", (22, 18));
color(t0, cyan); color(t1, cyan); hidden(t0); hidden(t1);

segment(pa, P, t0); segment(pb, P, t1);
color(pa, cyan); color(pb, cyan); stroke(pa, 4); stroke(pb, 4);
untraced(pa); untraced(pb);

segment(oa, O, t0); segment(ob, O, t1); segment(op, O, P);
color(oa, dim); color(ob, dim); color(op, fg);
stroke(oa, 3); stroke(ob, 3); stroke(op, 3);
untraced(oa); untraced(ob); untraced(op);

segment(chord, t0, t1);
color(chord, magenta); stroke(chord, 5); untraced(chord);

meet(M, t0, t1, O, P);
label(M, "M", (-28, 24));
color(M, lime); hidden(M);

rightangle(raA, O, t0, P); rightangle(raB, O, t1, P);
color(raA, lime); color(raB, lime); hidden(raA); hidden(raB);

text(r5, (390, 455), "5"); color(r5, fg); size(r5, 30); hidden(r5);
text(op13, (690, 595), "13"); color(op13, fg); size(op13, 30); hidden(op13);

// Every source and dependent entity is included so figure() can safely reflow
// the construction into the responsive media region.
tag(O, fig); tag(R, fig); tag(P, fig); tag(circ, fig);
tag(t0, fig); tag(t1, fig); tag(pa, fig); tag(pb, fig);
tag(oa, fig); tag(ob, fig); tag(op, fig); tag(chord, fig);
tag(M, fig); tag(raA, fig); tag(raB, fig); tag(r5, fig); tag(op13, fig);
figure(fig);

socials(me);
endcard(me, "cta=Pause_then_prove");

par {
  run(q, 14);
  seq {
    wait(1.3);
    par { show(O, 0.25); show(P, 0.25); }
    draw(circ, 0.7);
    draw(op, 0.45);
    par { draw(pa, 0.7); draw(pb, 0.7); }
    par { show(t0, 0.25); show(t1, 0.25); }
    par { draw(oa, 0.45); draw(ob, 0.45); }
    par { show(raA, 0.3); show(raB, 0.3); }
    draw(chord, 0.5);
    par { show(M, 0.25); show(r5, 0.25); show(op13, 0.25); }
  }
}

par {
  fade(q.parts, 0.45);
  fade(fig, 0.45);
  fade(me.footer, 0.45);
}
show(me.endcard, 0.6);
wait(1.4);

creator-v2-latex-calculus

Portrait Creator v2 with inline and display LaTeX: a calculus question, fitted formula answers and crisp typesetting throughout the timed reveal.

// Creator Kit v2 + LaTeX — portrait calculus lesson.
// Review focus: mixed inline math, a responsive equation figure, explanation,
// branded footer, progress timer, and the Creator v2 end card.
title("Creator v2 — LaTeX Calculus");
canvas("9:16");
template("shorts");
watermark(manicMark, (w*0.91-100, h*0.055+24), "Made With Manic");

creator(me, "@anish2good name=Calculus_Lab tagline=One_integral_at_a_time yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Save_for_revision safe=shorts");

quiz(q, `Evaluate $\int_0^1 2x\,dx$.`,
     "studio layout=media-first reveal=rise timer=bar density=comfortable motion=calm safe=shorts accent=cyan");
option(q, `$0$`);
option(q, `$\tfrac{1}{2}$`);
option(q, `$1$`, correct);
option(q, `$2$`);
explain(q, `The antiderivative is $x^2$, so $1^2-0^2=1$.`, "Fundamental Theorem of Calculus");

equation(eq, (cx, 650), `\int_0^1 2x\,dx = [x^2]_0^1 = 1`, 76);
color(eq, cyan);
figure(eq);
hidden(eq);

socials(me);
endcard(me, "cta=Save_for_revision");

par {
  run(q, 12);
  show(eq, 0.55);
}
par {
  fade(q.parts, 0.45);
  fade(eq, 0.45);
  fade(me.footer, 0.45);
}
show(me.endcard, 0.6);
wait(1.4);

creator-v2-latex-algebra

Square Creator v2 on a paper surface, checking that algebraic LaTeX and answer cards remain balanced and readable outside the vertical format.

// Creator Kit v2 + LaTeX — square algebra card.
// Review focus: automatic square reflow, paper styling, compact choices,
// inline factor notation, and a clean numeric timer.
title("Creator v2 — LaTeX Algebra");
canvas("square");
template("paper");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

creator(me, "@anish2good name=Algebra_Studio tagline=Patterns_before_procedures yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=magenta secondary=cyan footer=compact cta=Try_it_first safe=clean");

quiz(q, `Which expression equals $x^2-5x+6$?`,
     "studio layout=auto reveal=fade timer=number density=compact motion=calm safe=clean accent=magenta");
option(q, `$(x-1)(x-6)$`);
option(q, `$(x-2)(x-3)$`, correct);
option(q, `$(x+2)(x+3)$`);
option(q, `$(x-2)(x+3)$`);
explain(q, `The two numbers multiply to $6$ and add to $-5$.`, "Factor pair: -2 and -3");

equation(eq, (cx, cy), `x^2-5x+6`, 78);
color(eq, magenta);
figure(eq);
hidden(eq);

socials(me);

par {
  run(q, 10);
  show(eq, 0.55);
}

creator-v2-latex-physics

Landscape Creator v2 with a physics equation, proving the same LaTeX quiz system reflows cleanly for widescreen explainers.

// Creator Kit v2 + LaTeX — landscape physics explainer.
// Review focus: automatic widescreen split layout, formula options, equation
// media, branded footer, and a restrained ring timer.
title("Creator v2 — LaTeX Physics");
canvas("16:9");
template("shorts");
watermark(manicMark, (w*0.955-100, h*0.045+24), "Made With Manic");

creator(me, "@anish2good name=Physics_Notes tagline=Concepts_in_one_frame yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=gold secondary=cyan footer=signature cta=Follow_for_more safe=clean");

quiz(q, `A mass $m$ moves at speed $v$. What is its kinetic energy?`,
     "studio layout=auto reveal=fade timer=ring density=compact motion=studio safe=clean accent=gold");
option(q, `$mv$`);
option(q, `$mv^2$`);
option(q, `$\tfrac{1}{2}mv^2$`, correct);
option(q, `$2mv^2$`);
explain(q, `Work changes kinetic energy: $W=\Delta K$.`, "Work–energy theorem");

equation(eq, (cx, cy), `K = \frac{1}{2}mv^2`, 82);
color(eq, gold);
figure(eq);
hidden(eq);

socials(me);

par {
  run(q, 10);
  show(eq, 0.55);
}

quiz-skins

The quiz Short in a dozen lines: quiz/option/run + a creator/socials footer. Change the one style word on quiz(...) to switch card SKIN — badge (framed panel + coloured letter badges), minimal, glass (glowing borders) or plain — and add a question REVEAL in the same string (e.g. "glass fade"). The correct card lights up with a green badge + check on reveal; a draining ring counts the timer down.

// A creator quiz Short (9:16). Try the four card SKINS by changing the style
// string on `quiz(...)`:  "badge" (default) · "minimal" · "glass" · "plain".
// You can also add a question REVEAL in the same string, order-free, e.g.
//   quiz(q, "...", "glass fade")   // glass cards + fade-in question
canvas("9:16");
template("shorts");

// a reusable creator profile (set once, drawn by `socials`)
creator(me, "@anish2good yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=magenta");

// the quiz: a question + four answers, one marked `correct`
quiz(q, "What is 7 x 8?", "badge");
option(q, "54");
option(q, "56", correct);
option(q, "48");
option(q, "63");

// play the whole ask -> countdown -> reveal beat over 8 seconds
run(q, 8);

// the footer with the creator's socials
socials(me);

quiz-euler

A quiz Short with an ANIMATED figure: the geo kit constructs the Euler line (the answer), and figure(...) AUTO-FITS the whole triangle+circumcircle into the zone between the question header and the answer cards — no coordinate tuning. The question, four cards, the countdown and the whole ask→countdown→reveal beat are just quiz/option/run.

// ============================================================================
//  quiz-euler.manic  —  the SAME quiz Short, now via the `creator` kit
// ----------------------------------------------------------------------------
//  Compare with quiz-geometry.manic (≈60 hand-authored lines): the question,
//  four option cards, the countdown, and the whole ask→countdown→reveal beat
//  are now `quiz` / `option` / `run`. The creator's footer is `creator`/`socials`.
//  Only the figure is hand-drawn (author-supplied — any manic entity/kit).
// ============================================================================

title("Quiz — the Euler Line");
canvas("9:16");
template("paper");

creator(me, "@anish2good yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=magenta");

// --- the quiz: question + four answers (kit handles layout + the beat) ---
quiz(q, "3 triangle centres are always collinear — on WHICH line?");
option(q, "the Euler line", correct);
option(q, "a perpendicular bisector");
option(q, "an angle bisector");
option(q, "a median");

// --- the figure (author-supplied): the geo kit constructs the Euler line ---
point(pA, (335, 760)); point(pB, (745, 745)); point(pC, (540, 470));
hidden(pA); hidden(pB); hidden(pC);
segment(sa, pA, pB); segment(sb, pB, pC); segment(sc, pC, pA);
untraced(sa); untraced(sb); untraced(sc);
circumcircle(cc, pA, pB, pC); color(cc, dim); untraced(cc);
circumcenter(oo, pA, pB, pC); color(oo, magenta); hidden(oo);
centroid(gg, pA, pB, pC);     color(gg, lime);    hidden(gg);
orthocenter(hh, pA, pB, pC);  color(hh, cyan);    hidden(hh);
segment(eu, oo, hh); color(eu, fg); stroke(eu, 7); glow(eu, 1.5); untraced(eu);

// tag every figure part, then AUTO-FIT the whole group into the zone between
// the question header and the answer cards — no hand-tuning coordinates.
tag(pA, fig); tag(pB, fig); tag(pC, fig); tag(sa, fig); tag(sb, fig); tag(sc, fig);
tag(cc, fig); tag(oo, fig); tag(gg, fig); tag(hh, fig); tag(eu, fig);
figure(fig, (540, 645), (720, 360));

// ================= THE BEAT =================
socials(me);
par {
  run(q, 14);                          // ask · countdown · reveal — the whole beat
  seq {                                // the figure builds while the question sits
    wait(1.6);
    par { show(pA, 0.2); show(pB, 0.2); show(pC, 0.2); }
    par { draw(sa, 0.5); draw(sb, 0.5); draw(sc, 0.5); }
    draw(cc, 0.5);
    par { show(oo); show(gg); show(hh); }
    draw(eu, 0.9); pulse(eu);
  }
}

quiz-geometry

The hand-authored proof behind the kit (≈60 lines from shipped primitives): a question, an animated geometry figure, four option cards, a countdown and a time-out reveal. Useful to see what quiz/option/run automate under the hood.

// ============================================================================
//  quiz-geometry.manic  —  a QUIZ SHORT, hand-authored (creator-template proto)
// ----------------------------------------------------------------------------
//  The first proof of the "quiz Short" format the `creator` kit will later
//  automate (see CAPABILITIES → Creator format templates). Built ENTIRELY from
//  shipped primitives on a 9:16 canvas: a typewriter question, an ANIMATED
//  geometry figure (the geo kit constructs the Euler line — which IS the answer),
//  four option cards, a countdown, a time-out reveal, and a socials footer.
//  When the `quiz`/`countdown`/`socials` builtins land, this whole file collapses
//  to a few lines — but the beat/layout are proven here first.
// ============================================================================

title("Quiz — the Euler Line");
canvas("9:16");                       // portrait 1080×1920 · cx=540 cy=960
template("paper");

// ---- the question (two typewriter lines, top / title-safe) ----
text(q1, (cx, 210), "3 triangle centres are always"); color(q1, fg);   size(q1, 44); bold(q1); untraced(q1);
text(q2, (cx, 285), "collinear — on WHICH line?");     color(q2, cyan); size(q2, 44); bold(q2); untraced(q2);

// ---- the animated geometry figure (geo kit) : the Euler line construction ----
// (colours are palette-semantic — fg/cyan/magenta/lime/dim — so they REMAP with
//  the template; gold/red/etc. are fixed and would lose contrast on `paper`)
point(A, (335, 760), "A"); point(B, (745, 745), "B"); point(C, (540, 470), "C");
hidden(A); hidden(B); hidden(C);
segment(ab, A, B); segment(bc, B, C); segment(ca, C, A); untraced(ab); untraced(bc); untraced(ca);
circumcircle(cc, A, B, C); color(cc, dim); untraced(cc);
circumcenter(O, A, B, C); color(O, magenta); label(O, "O", (20, -12)); hidden(O);
centroid(G, A, B, C);     color(G, lime);    label(G, "G", (20, -12)); hidden(G);
orthocenter(H, A, B, C);  color(H, cyan);    label(H, "H", (-34, -12)); hidden(H);
segment(euler, O, H); color(euler, fg); stroke(euler, 7); glow(euler, 1.5); untraced(euler);

// ---- four option cards, laid out 2×2 (compact — clears the figure) ----
rect(c1, (305, 1010), 428, 120); color(c1, panel); filled(c1); hidden(c1);
rect(c2, (775, 1010), 428, 120); color(c2, panel); filled(c2); hidden(c2);
rect(c3, (305, 1150), 428, 120); color(c3, panel); filled(c3); hidden(c3);
rect(c4, (775, 1150), 428, 120); color(c4, panel); filled(c4); hidden(c4);
text(t1, (305, 1010), "A  Euler line");     color(t1, fg); size(t1, 34); hidden(t1);
text(t2, (775, 1010), "B  Perp. bisector"); color(t2, fg); size(t2, 34); hidden(t2);
text(t3, (305, 1150), "C  Angle bisector"); color(t3, fg); size(t3, 34); hidden(t3);
text(t4, (775, 1150), "D  Median");         color(t4, fg); size(t4, 34); hidden(t4);

// ---- countdown ring + digit (palette-semantic → template-safe) ----
circle(ring, (cx, 1400), 62); color(ring, cyan); stroke(ring, 6); outlined(ring); hidden(ring);
text(timer, (cx, 1400), "5"); color(timer, fg); size(timer, 62); bold(timer); hidden(timer);

// ---- socials footer : icons DRAWN from primitives (manic has no raster images),
//      so they render on any template; grouped as `foot` to show together ----
line(rule, (150, 1740), (930, 1740)); color(rule, dim); stroke(rule, 2);
// ▶ YouTube chip
rect(yt,  (312, 1815), 58, 40); color(yt, magenta); filled(yt);
polygon(ytp, (300, 1802), (300, 1828), (326, 1815), bg);
// ✕ X chip
rect(xb,  (404, 1815), 46, 46); color(xb, fg); outlined(xb);
line(x1, (392, 1803), (416, 1827)); color(x1, fg); stroke(x1, 4);
line(x2, (416, 1803), (392, 1827)); color(x2, fg); stroke(x2, 4);
// ◎ Instagram chip
rect(ig,  (496, 1815), 46, 46); color(ig, fg); outlined(ig);
circle(igc, (496, 1815), 13); color(igc, fg); outlined(igc);
circle(igd, (509, 1802), 3);  color(igd, fg); filled(igd);
// handle + link
text(foot, (740, 1815), "@manic · 8gwifi.org/manic"); color(foot, dim); size(foot, 28);
tag(rule, footer); tag(yt, footer); tag(ytp, footer); tag(xb, footer); tag(x1, footer);
tag(x2, footer); tag(ig, footer); tag(igc, footer); tag(igd, footer); tag(foot, footer);
hidden(footer);

// ================= THE BEAT =================
// 1) ask — typewriter
type(q1, 1.1);
type(q2, 1.0);
wait(0.2);

// 2) the figure constructs itself (animated geometry — the geo kit)
par { show(A, 0.25); show(B, 0.25); show(C, 0.25); }
par { draw(ab, 0.5); draw(bc, 0.5); draw(ca, 0.5); }
draw(cc, 0.6);
par { show(O); show(G); show(H); }
draw(euler, 0.9); pulse(euler);      // the three centres line up → the Euler line
wait(0.3);

// 3) options fly in, staggered
seq {
  par { show(c1, 0.2); show(t1, 0.2); }
  par { show(c2, 0.2); show(t2, 0.2); }
  par { show(c3, 0.2); show(t3, 0.2); }
  par { show(c4, 0.2); show(t4, 0.2); }
}
show(footer, 0.3);

// 4) countdown 5 → 1
par { show(ring, 0.2); show(timer, 0.2); }
wait(0.8); say(timer, "4", 0.15);
wait(0.8); say(timer, "3", 0.15);
wait(0.8); say(timer, "2", 0.15);
wait(0.8); say(timer, "1", 0.15);
wait(0.8);

// 5) TIME OUT → reveal: card A (the Euler line) glows, the rest dim
say(timer, "0", 0.15); flash(ring, gold);
par {
  recolor(c1, lime); flash(c1, gold); pulse(c1);
  recolor(t1, void);
  fade(c2, 0.5); fade(t2, 0.5);
  fade(c3, 0.5); fade(t3, 0.5);
  fade(c4, 0.5); fade(t4, 0.5);
  flash(euler, gold);
}
wait(1.6);

quiz-geometry-2

A layout stress-test: a different olympiad question with TWO figures side by side (an acute triangle with its circumcentre INSIDE vs an obtuse one with it OUTSIDE), proving the 2×2 options, countdown and footer keep their spacing for richer figure content.

// ============================================================================
//  quiz-geometry-2.manic  —  a second QUIZ SHORT (olympiad geometry)
// ----------------------------------------------------------------------------
//  A layout STRESS TEST: same 9:16 quiz scaffold as quiz-geometry.manic, but a
//  different olympiad question with TWO figures side-by-side (acute vs obtuse
//  triangle) — to prove the spacing + visibility hold for richer figure content.
//  Template-agnostic (palette-semantic colours), drawn social icons, 2×2 options.
// ============================================================================

title("Quiz — Circumcentre");
canvas("9:16");
template("terminal");

// ---- the question (two typewriter lines) ----
text(q1, (cx, 210), "A triangle's CIRCUMCENTRE falls"); color(q1, fg);   size(q1, 42); bold(q1); untraced(q1);
text(q2, (cx, 283), "outside it — when is it…?");        color(q2, cyan); size(q2, 42); bold(q2); untraced(q2);

// ---- figure ①  : an ACUTE triangle (circumcentre INSIDE) ----
point(a1, (190, 800)); point(b1, (455, 800)); point(c1, (320, 560));
hidden(a1); hidden(b1); hidden(c1);
segment(s1a, a1, b1); segment(s1b, b1, c1); segment(s1c, c1, a1);
untraced(s1a); untraced(s1b); untraced(s1c);
circumcenter(o1, a1, b1, c1); color(o1, magenta); hidden(o1);
text(lab1, (322, 865), "acute · inside"); color(lab1, dim); size(lab1, 26);

// ---- figure ②  : an OBTUSE triangle (circumcentre OUTSIDE) ----
// c2 sits LEFT of a2, so the angle at a2 is obtuse → circumcentre lands outside
point(a2, (735, 800)); point(b2, (965, 800)); point(c2, (700, 600));
hidden(a2); hidden(b2); hidden(c2);
segment(s2a, a2, b2); segment(s2b, b2, c2); segment(s2c, c2, a2);
untraced(s2a); untraced(s2b); untraced(s2c);
circumcenter(o2, a2, b2, c2); color(o2, magenta); hidden(o2);
text(lab2, (830, 865), "obtuse · outside"); color(lab2, dim); size(lab2, 26);

// ---- four option cards, 2×2 (correct = C, obtuse → c3) ----
rect(c1c, (305, 1010), 428, 120); color(c1c, panel); filled(c1c); hidden(c1c);
rect(c2c, (775, 1010), 428, 120); color(c2c, panel); filled(c2c); hidden(c2c);
rect(c3c, (305, 1150), 428, 120); color(c3c, panel); filled(c3c); hidden(c3c);
rect(c4c, (775, 1150), 428, 120); color(c4c, panel); filled(c4c); hidden(c4c);
text(t1, (305, 1010), "A  Acute");       color(t1, fg); size(t1, 34); hidden(t1);
text(t2, (775, 1010), "B  Right");       color(t2, fg); size(t2, 34); hidden(t2);
text(t3, (305, 1150), "C  Obtuse");      color(t3, fg); size(t3, 34); hidden(t3);
text(t4, (775, 1150), "D  Equilateral"); color(t4, fg); size(t4, 34); hidden(t4);

// ---- countdown ring + digit ----
circle(ring, (cx, 1400), 62); color(ring, cyan); stroke(ring, 6); outlined(ring); hidden(ring);
text(timer, (cx, 1400), "5"); color(timer, fg); size(timer, 62); bold(timer); hidden(timer);

// ---- socials footer (drawn vector icons — template-safe) ----
line(rule, (150, 1740), (930, 1740)); color(rule, dim); stroke(rule, 2);
rect(yt,  (312, 1815), 58, 40); color(yt, magenta); filled(yt);
polygon(ytp, (300, 1802), (300, 1828), (326, 1815), bg);
rect(xb,  (404, 1815), 46, 46); color(xb, fg); outlined(xb);
line(x1, (392, 1803), (416, 1827)); color(x1, fg); stroke(x1, 4);
line(x2, (416, 1803), (392, 1827)); color(x2, fg); stroke(x2, 4);
rect(ig,  (496, 1815), 46, 46); color(ig, fg); outlined(ig);
circle(igc, (496, 1815), 13); color(igc, fg); outlined(igc);
circle(igd, (509, 1802), 3);  color(igd, fg); filled(igd);
text(foot, (740, 1815), "@manic · 8gwifi.org/manic"); color(foot, dim); size(foot, 28);
tag(rule, footer); tag(yt, footer); tag(ytp, footer); tag(xb, footer); tag(x1, footer);
tag(x2, footer); tag(ig, footer); tag(igc, footer); tag(igd, footer); tag(foot, footer);
hidden(footer);

// ================= THE BEAT =================
// 1) ask
type(q1, 1.1);
type(q2, 1.0);
wait(0.2);

// 2) both figures construct (side by side)
par { show(a1, 0.2); show(b1, 0.2); show(c1, 0.2); show(a2, 0.2); show(b2, 0.2); show(c2, 0.2); }
par {
  draw(s1a, 0.5); draw(s1b, 0.5); draw(s1c, 0.5);
  draw(s2a, 0.5); draw(s2b, 0.5); draw(s2c, 0.5);
}
par { show(o1); show(o2); pulse(o1); pulse(o2); }
par { show(lab1, 0.3); show(lab2, 0.3); }
wait(0.3);

// 3) options fly in, 2×2 reading order
seq {
  par { show(c1c, 0.2); show(t1, 0.2); }
  par { show(c2c, 0.2); show(t2, 0.2); }
  par { show(c3c, 0.2); show(t3, 0.2); }
  par { show(c4c, 0.2); show(t4, 0.2); }
}
show(footer, 0.3);

// 4) countdown 5 → 1
par { show(ring, 0.2); show(timer, 0.2); }
wait(0.8); say(timer, "4", 0.15);
wait(0.8); say(timer, "3", 0.15);
wait(0.8); say(timer, "2", 0.15);
wait(0.8); say(timer, "1", 0.15);
wait(0.8);

// 5) TIME OUT → reveal: card C (Obtuse) glows, the rest fade
say(timer, "0", 0.15); flash(ring, gold);
par {
  recolor(c3c, lime); flash(c3c, gold); pulse(c3c);
  recolor(t3, void);
  fade(c1c, 0.5); fade(t1, 0.5);
  fade(c2c, 0.5); fade(t2, 0.5);
  fade(c4c, 0.5); fade(t4, 0.5);
  flash(o2, gold);              // the obtuse triangle's outside centre
}
wait(1.6);

creator-race-quiz

The charts kit composed with everything else: a voiced 9:16 Short that poses a QUIZ (which economy grew fastest since 1990?), reveals the answer, then plays a bar-chart RACE that PROVES it — China climbing from the pack to #2. Quiz cards + speak narration over a par-run race + a Manic CTA card. Problem → guess → proof → CTA.

// creator-race-quiz.manic — a Creator Short that PROVES a claim with a race chart.
// Poses a quiz (which economy grew fastest since 1990?), lets you guess, reveals
// the answer, then plays a bar-chart RACE that settles it — the data as the payoff.
// Shows the charts kit composing with quiz cards, voice, and creator chrome.
//
//   ELEVENLABS_API_KEY=... manic examples/creator-race-quiz.manic --record out.mp4
title("The Race-Chart Quiz");
canvas("9:16");
template("shorts");
voice("elevenlabs");

creator(me, "@anish2good name=Manic tagline=Turn_plain_text_into_amazing_data_videos yt=zarigatongy x=@anish2good web=8gwifi.org/manic accent=cyan secondary=magenta footer=signature cta=Try_it_free safe=reels");
watermark(mark, (w*0.955-100, h*0.045+24), "Made With Manic");

// --- the question ---
text(kick, (cx, h*0.13), "Since 1990, which economy grew the FASTEST?");
size(kick, 46); color(kick, fg); bold(kick); wrap(kick, w*0.86); hidden(kick);

// --- four option cards (India · China · S. Korea · Brazil) ---
let cy0 = h*0.30; let ch = h*0.09; let gap = h*0.115;
rect(card1, (cx, cy0),        w*0.74, ch); outlined(card1); outline(card1, dim); stroke(card1, 3); hidden(card1);
rect(card2, (cx, cy0+gap),    w*0.74, ch); outlined(card2); outline(card2, dim); stroke(card2, 3); hidden(card2);
rect(card3, (cx, cy0+gap*2),  w*0.74, ch); outlined(card3); outline(card3, dim); stroke(card3, 3); hidden(card3);
rect(card4, (cx, cy0+gap*3),  w*0.74, ch); outlined(card4); outline(card4, dim); stroke(card4, 3); hidden(card4);
text(lbl1, (cx, cy0),       "India");        size(lbl1, 40); color(lbl1, fg); bold(lbl1); hidden(lbl1);
text(lbl2, (cx, cy0+gap),   "China");        size(lbl2, 40); color(lbl2, fg); bold(lbl2); hidden(lbl2);
text(lbl3, (cx, cy0+gap*2), "South Korea");  size(lbl3, 40); color(lbl3, fg); bold(lbl3); hidden(lbl3);
text(lbl4, (cx, cy0+gap*3), "Brazil");       size(lbl4, 40); color(lbl4, fg); bold(lbl4); hidden(lbl4);

// --- the proof: a GDP bar-chart race (labels only), hidden until the reveal ---
racechart(gdp, "bar", "1990 1998 2006 2014 2020 2026");
racedata(gdp, "
  USA,          5.96,  8.6, 13.8, 17.5, 21.1, 30.3
  China,        0.36,  1.1,  2.8,  10.5, 14.7, 20.5
  Japan,        3.13,  4.1,  4.6,   4.9,  5.1,  4.4
  India,        0.32,  0.4,  0.9,   2.0,  2.7,  4.6
  Brazil,       0.46,  0.9,  1.1,   2.5,  1.5,  2.4
  South Korea,  0.28,  0.6,  1.0,   1.5,  1.6,  1.9
");

text(cap, (cx, h*0.70), ""); size(cap, 34); color(cap, dim); bold(cap); wrap(cap, w*0.86); hidden(cap);

socials(me);
endcard(me, "title=Race_ANY_Dataset cta=8gwifi.org/manic");

// ---------------- the story ----------------
fade(gdp, 0.01); // keep the race hidden during the quiz
show(kick);
speak("Since nineteen-ninety, one economy grew faster than every other major country. Which one?");
stagger(0.16) { show(card1); show(card2); show(card3); show(card4); }
par { show(lbl1); show(lbl2); show(lbl3); show(lbl4); }
show(cap, 0.3); say(cap, "Lock in your guess…");
wait(1.0);

speak("The answer? China.");
par { recolor(card2, gold); pulse(card2); recolor(lbl2, gold); }
par { fade(card1); fade(card3); fade(card4); fade(lbl1); fade(lbl3); fade(lbl4); }
wait(0.6);

speak("But don't take my word for it — let the data settle it.");
par { fade(card2); fade(lbl2); fade(kick); fade(cap); }
show(gdp);
par {
  race(gdp, 8.0);
  seq {
    speak("Watch China — from the bottom of the pack,");
    speak("climbing past Brazil, Korea, India, even Japan,");
    speak("all the way to number two.");
  }
}
wait(0.6);

speak("The data doesn't argue. And this whole video is one Manic script — drop in any dataset, get a race. Free, at eight g wifi dot org slash manic.");
par { fade(gdp); }
show(me.endcard);
wait(2.6);