Skip to content

Animate clip-path: interpolate polygon, inset, circle and ellipse in keyframes #384

Description

@LeadcodeDev

Context

In the reel 4 reference, the dark wall of a neon room keeps changing silhouette while the camera moves: its cut corners slide from the top to the bottom, open, then close. The whole identity of the set rests on that living frame. Since #339, a static clip-path renders. Animating it isn't possible.

What happens

  • In keyframes, clip-path is rejected: unknown animation property 'clip-path'.
  • rules/clip-path.md states that it doesn't interpolate in a timeline either.
  • Attributes of an inline svg are frozen too.

The only option left is a crossfade between two walls, which shows a double chamfer mid-fade, or transforms, which move the shape without deforming it.

Proposed vocabulary

{ "property": "clip-path", "easing": "ease_in_out", "keyframes": [
  { "time": 0, "value": { "kind": "polygon", "points": [[320,0],[1600,0],[1920,320],[1920,1080],[0,1080],[0,320]] } },
  { "time": 2, "value": { "kind": "polygon", "points": [[0,0],[1920,0],[1920,780],[1620,1080],[300,1080],[0,780]] } } ] }
  • polygon: point-by-point interpolation when both values have the same vertex count. Otherwise, a validation error naming the two counts.
  • inset, circle, ellipse: field-by-field interpolation.
  • Two different kinds: a validation error.
  • The same values usable in a timeline step's style, with the step's transition easing.

Found in: reel 4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions