实验室

动效

碰它一下会动的东西。时长、缓动曲线、精确到像素的位移 —— 决定一个交互是「活的」还是「只是有动画」的那部分。

磁吸按钮

指针还没碰到,按钮就先朝它偏过来;离开时弹回原位。成本是两个 CSS 变量加一个 pointermove 监听。

  • Catchment radius 60px beyond the button box
  • Pull strength 0.35 × offset from centre
  • Release 450ms cubic-bezier(0.23, 1, 0.32, 1)
全部分类