feat: arc path for layout and keyframe animations#3386
feat: arc path for layout and keyframe animations#3386lochie wants to merge 23 commits intomotiondivision:mainfrom
layout and keyframe animations#3386Conversation
|
closing PR while i work on it |
|
back at it 🫡 |
layout transitionslayout and keyframe animations
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
|
|
@mattgperry I've just been thinking, would this be more suitable as a cubic bezier instead of this I originally set this up to make it as easy as possible to enable curves but it does feel a little difficult to customise. Caveats are we'd lose the ability to have the "smart" checks that change logic based on context. Alternatively we could include both options with the
|


Summary
Adds an
arctransition option that makes elements travel along a curved Bézier path rather than a straight line.Works with
motioncomponents,useAnimate, and layout animations vialayoutId:amplitude— how pronounced the arc is, as a fraction of total travel distancepeak— where along the path the arc reaches maximum height (default0.5= symmetric)direction—"cw"/"ccw"to fix which side the arc bulges toward; when unset, auto-picks a consistent screen-space direction regardless of travel directionorientToPath— rotates the element to follow the tangent of the arc path. higher number = more intensityOpinionated choices:
scale) are unaffectedTest plan
useAnimateexample toggles between positions along an arclayoutIdelement between positions — should travel in a curve, not a straight lineamplitudeslider —0= straight line,1= arc equal to travel distancepeak— arc should shift earlier/later along the pathdirection— arc should lock tocworccwregardless of movement direction