Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

[Feature] Support for transform Perspective #231

@nk-o

Description

@nk-o

Is your feature request related to a problem? Please describe.
Currently, when we use animation with transform variables, there is no possibility to specify the perspective at all. We should use pure transform string instead. Example - https://codepen.io/_nK/pen/ZEVPWRg

Describe the solution you'd like
Add support for perspective property here:

const order = ["translate", "scale", "rotate", "skew"]

To add possibility to call animation like so:

animate(
  el,
  {
    perspective: 500,
    rotateX: [50, -50],
    rotateY: [-20, 20],
  }
);

Describe alternatives you've considered
This call is working as expected:

animate(
  el,
  {
    transform: [
      'perspective(500px) rotateX(50deg) rotateY(-20deg)',
      'perspective(500px) rotateX(-50deg) rotateY(20deg)'
    ]
  }
);

Additional context
Example - https://codepen.io/_nK/pen/ZEVPWRg

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureFeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions