Clicking magpie's Dock icon plays the header logo's .logo.wag on the
tile: the same keyframes, turn points, .9s and cubic-bezier(.3, 0, .3, 1),
a frame every 30ms. The icon macOS draws (its glass tile and glossy bird)
is cut into body, tail and wing by index.html's own clip paths, the tile
under the bird filled with the tile's colour read either side of it, and
each frame turns the pieces over it, set as the Dock tile's content view.
The tile goes back to the system's icon after. It plays only when the
Dock draws icons light (no AppleIconAppearanceTheme, RegularLight, or
RegularAutomatic in light mode); a dark, clear or tinted Dock is left as
it is. A click while it plays doesn't start another.
Run:
- go test ./internal/gui/ -run TestDockFlap: TestDockFlapIsTheLogos holds
the keyframes, origins, length and easing to app.css and parses the
bird and clips out of the embedded index.html. Broken by hand: changing
one keyframe in flapkeys.go turns it red.
- TestDockFlapFrames (MAGPIE_DOCK_APP=/Applications/magpie.app) wrote the
31 frames; looked at by eye. Frame 0 against the system's own 512px
render: inside the tile 0.03% of pixels differ by over 40/255 (the
tile's rim resampled); the pieces' seams were visible until they
overlapped by 1px.
- A sandbox bundle (own bundle id, sandbox HOME, ports 3446/3447) got the
Dock's reopen event by pid: a burst of screen captures of the real Dock
shows the tile in different poses.
- go vet ./internal/gui/, GOOS=windows go vet, GOOS=linux go vet -tags
nogui, GOOS=linux go build -tags nogui, GOOS=windows go build, gofmt -l.
Not tried: a dark or tinted Dock (skipped by the gate, not drawn), a
real mouse click on the Dock (the same reopen event, sent by pid).