summaryrefslogtreecommitdiff
path: root/anim/src/words.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 18:06:30 -0300
committerGabriel Schneider <[email protected]>2026-11-10 19:01:23 -0300
commite63b0624f57472d40af32a006c32cc47d403b822 (patch)
treeb7295da62acd96bc7aba425720eed95605526693 /anim/src/words.zig
parent318e16181a28725e218121363555580725d6d0d4 (diff)
downloadcomputeranim-e63b0624f57472d40af32a006c32cc47d403b822.tar.gz
computeranim-e63b0624f57472d40af32a006c32cc47d403b822.zip
canim: what the review found; the band as two panels; list and sort by instruction
The first videos were reviewed frame by frame and the catalogue changed with them. A lens is a drawing over the program column and its view over the state column, so the stack keeps six slots, its window on the whole frame. Operands are whole. list and sort are recorded by instruction from main (record --from), so their registers strike, links reach nodes and cells, rows that ran are marked and jumps are drawn. A call's node is a projection of its return address; pins travel and keep their side; a mark covers the bytes that changed, at the element's width; a syscall's result is stored after the kernel returns it and every panel is of one moment; fast passes are veiled; the clock stands still during a step; captions get their reading time and a scene's first step comes by four seconds. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/src/words.zig')
-rw-r--r--anim/src/words.zig26
1 files changed, 23 insertions, 3 deletions
diff --git a/anim/src/words.zig b/anim/src/words.zig
index 5601156..bec5116 100644
--- a/anim/src/words.zig
+++ b/anim/src/words.zig
@@ -7,6 +7,7 @@ const sk = @import("sketch");
const anim = @import("anim");
const ui = @import("ui.zig");
const Cursor = @import("cursor.zig").Cursor;
+const cursors = @import("cursor.zig");
const theme = ui.theme;
const Rect = ui.Rect;
const t = theme.color.text;
@@ -33,11 +34,30 @@ pub const Clock = struct {
u.fill(.{ .x = -c.width, .y = 0, .w = c.width + stage.x - 8, .h = c.height }, theme.color.page);
u.fill(.{ .x = stage.x + stage.w + 8, .y = 0, .w = c.width, .h = c.height }, theme.color.page);
u.fill(.{ .x = stage.x, .y = c.clock_y - 1, .w = stage.w, .h = theme.stroke.rule }, theme.color.rule);
- u.fill(.{ .x = stage.x, .y = c.clock_y - 2, .w = stage.w * now.place, .h = 4 }, theme.mark(.current).solid);
+ // Time itself: still while a step plays at a walk or a run; once its
+ // mark has landed, the step's piece fades in (12 f, 8 at a run) and
+ // the count changes as it starts. At a sprint it grows with the recording.
+ const gold = theme.mark(.current).solid;
+ const at_stop = struct {
+ fn of(n: cursors.Now, m: u64) f32 {
+ return std.math.clamp(@as(f32, @floatFromInt(m -| n.way[0])) / @as(f32, @floatFromInt(@max(n.way[1] -| n.way[0], 1))), 0, 1);
+ }
+ }.of;
+ var counted = now.marked();
+ if (now.plan.gait == .sprint or now.resting()) {
+ u.fill(.{ .x = stage.x, .y = c.clock_y - 2, .w = stage.w * now.place, .h = 4 }, gold);
+ } else {
+ const landed = now.plan.advance + now.plan.travel;
+ const fade = std.math.clamp((now.time - landed) / @as(f32, if (now.plan.gait == .run) theme.time.run_ease else theme.time.quick), 0, 1);
+ const from = at_stop(now, now.stops[1]);
+ const to = at_stop(now, now.stops[0]);
+ u.fill(.{ .x = stage.x, .y = c.clock_y - 2, .w = stage.w * from, .h = 4 }, gold);
+ if (fade > 0) u.fill(.{ .x = stage.x + stage.w * from, .y = c.clock_y - 2, .w = stage.w * (to - from), .h = 4 }, ui.mix(theme.color.page, gold, fade));
+ counted = if (now.time >= landed) now.stops[0] else now.stops[1];
+ }
const size = theme.size.mono.context;
const base = c.clock_y + 28;
- // The count is where the current mark is: it changes as the mark moves on.
- const count = u.print("moment {d} of {d}", .{ now.marked() -| now.way[0], now.way[1] -| now.way[0] });
+ const count = u.print("moment {d} of {d}", .{ counted -| now.way[0], now.way[1] -| now.way[0] });
const count_x = stage.x + stage.w - u.width(.mono, size, count);
u.text(.mono, size, count_x, base, count, t.faint);
// Secondary action: the pace, said quietly. It only fades.