Skip to content

v0.3.7

Choose a tag to compare

@dyike dyike released this 21 Oct 00:25
· 8 commits to main since this release

Add experimental declarative animation primitives.

  • ui/motion provides frame-time driven animation values: physics springs, tweens and cubic-bezier easing, keyframes and repeat modes, inertia, stagger, presence, color mixing and range mapping. Sampling uses el.Context.Now; only unsettled values call Context.Animating, so a settled application stays event-driven, and reduced motion jumps directly to the declared target.
  • Transform is paint-only, so layout and automation bounds stay unchanged. LayoutGroup performs position-only FLIP for Div elements in one scroll coordinate space. PointerGlow draws a cursor-origin glow and ripple driven by pointer movement, and Confetti keeps an uncapped reusable particle slice, emitting and updating without allocating once capacity is available; both own Decorate.
  • Transform, PointerGlow, Confetti and LayoutGroup replace an element's existing Decorate callback; wrap an element if it must also use another decoration. The API is experimental and may change.
  • The module depends on ui/el, ui/core, ui/theme and Gio, never on ui/kit or ui/window, and is listed in the internal/deps table as opt-in for heavy dependencies. examples/motion (go run ./examples/motion -section effects) demonstrates the pointer effects and an order confetti burst.

Validation: gofmt, vet, module tests, go test -race ./ui/motion, the offline component check from a clean checkout, and CGO_ENABLED=0 GOOS=windows go build ./....

本版新增实验性的声明式动效基础能力 ui/motion:弹簧、补间、缓动、关键帧、惯性与交错,只作用于绘制的变换、FLIP 布局组、指针光晕/波纹和彩纸,并附 examples/motion 示例。API 尚不稳定。

Compare: v0.3.6...v0.3.7