amenui
en·中 github ↗ v0.0.1
01docs 02components 03lab 04works
en·中github ↗
×

docs / lab / stack docs / lab /

Stack

On this page ▾
  1. Formula
  2. Parameters
  3. How it is made
drawn by amenuiopen ↗

The card stack (widgets::card_stack) in the lab's look: hover or press a card and the ones beneath fan out.

Formula

text
angle(n) = angle0 × falloff^n,  delay(n) = delay × n

Parameters

Every number is a number control under the cell (type, arrow keys, drag sideways); none is a slider.

namedefaultrangewhat it is
angle042°0–90first card's turn
falloff0.700.1–1each next one's share
delay28 ms0–200stagger

How it is made

Each card has its own spring with velocity hand-off (DESIGN.md §1.24): when the pointer moves to another card before the fan has settled, the springs keep the speed they had and turn toward the new target instead of starting again from rest. Card n starts delay × n after the first, so the fan opens from the top card down and closes the same way.

The cards are drawn in the lab's look, near the ground with a hairline outline; the card under the pointer takes the accent. Turning falloff to 1 gives every card the same angle, and a delay of 0 moves them all at once. The code is examples/lab/stack.rs.