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

[Feature] Support for transform Perspective #231

Open
nk-o opened this issue Oct 11, 2023 · 0 comments
Open

[Feature] Support for transform Perspective #231

nk-o opened this issue Oct 11, 2023 · 0 comments
Labels
Feature Feature request

Comments

@nk-o
Copy link

nk-o commented Oct 11, 2023

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

@nk-o nk-o added the Feature Feature request label Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Feature request
Projects
None yet
Development

No branches or pull requests

1 participant