diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-24 10:46:33 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 40197552bed794b92410bdf803532162c8f5e27d (patch) | |
| tree | 487a457c688aaff215d2c3925735d6b5e8bb2ede /src/tag_layer.zig | |
| parent | 3f6ad1bc30570348297ae4aa6d1fd676de229a09 (diff) | |
| download | pardes-40197552bed794b92410bdf803532162c8f5e27d.tar.gz pardes-40197552bed794b92410bdf803532162c8f5e27d.zip | |
Ease a message into its row fast first, its colour ahead of it, and out slow first
A message fell in on t*t, an ease-in: it hung near its start for the first
frames and was still moving at its fastest when it hit the row, a sixth of a
row in its last frame. It now decelerates into place with an ease-out cubic,
slide = -(1-t)^3: a quarter of the way in the first frame, and the last
frames only settle it. There is no overshoot. At a row's height and the
dozen frames of the 180 ms fall, a follow-through is a pixel or two, which
reads as a jitter rather than a bounce. MessageFall keeps its 180 ms: the
ease-out puts the chip where it is going within about 100 ms.
The colour leads the motion: alpha = 1 - (1 - min(1, 2t))^2, whole by half
way, so what lands is already legible. The SDL shell used to show the chip
solid while it slid and fade it only on the way out; it now fades it up with
the same alpha, and the rule under a chip carries the chip's fade (a new
TagLayer.fade) instead of standing solid while the chip comes or goes.
The dissolve was an ease-out, (1-t)^2: it lost a tenth of its colour in the
first frame and spent its last frames nearly invisible. An exit eases in
instead, alpha = 1 - t^2 over the same 300 ms: it lets go gently and leaves
faster and faster. t is now counted to the last frame, so that frame shows
it gone rather than it blinking out from 0.3%. 1 - t^3 was the other
candidate; in captures it held the chip nearly untouched for half the
dissolve after the linger had already held it, then dropped a sixth of its
colour a frame, which reads as a pop. It stays in place: the lines stacked
around it do not move, and a drift would read as it leaving its row.
The test pins the shapes: a fast first step into the row, never past it,
solid by half way; a dissolve whose first drop is smaller than its last and
which ends at exactly nothing.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Diffstat (limited to 'src/tag_layer.zig')
| -rw-r--r-- | src/tag_layer.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tag_layer.zig b/src/tag_layer.zig index f8cc6eca..52da297d 100644 --- a/src/tag_layer.zig +++ b/src/tag_layer.zig @@ -30,6 +30,10 @@ pub const Layer = struct { /// that is moving into place. A pixel shell draws it offset and clipped /// to the rows below the viewport's top; the grid has no such thing. slide: f32 = 0, + /// How present a notice band is (1 = fully) while it fades up or + /// dissolves. `bg` and the cells are already blended by it; a pixel + /// shell uses it for what it draws around the band, like its rule. + fade: f32 = 1, pub fn capacity(layer: *const Layer, metrics: pardes.RowMetrics) u16 { return @intCast(@min(std.math.maxInt(u16), @max(1, @as(u32, layer.viewport.w) * @max(1, metrics.body_w) / @max(1, metrics.tagline_w)))); |
