Jump to content
Search Community

Aspect ratio animation

Fettahaud
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

Posted

Hello

 

Firstly, it's weird how I'm first one who is asking about this(probably I'm diving deeply here 😁)

 

However, my question is simple, I have a box and I want to change it's aspect ration while moving based on path

 

Here is a helper image to understand the steps I want to go through 


Screenshot2024-09-22at14_32_072.thumb.png.d5cceb6ebf627613129431d0af4c3f68.png

See the Pen mdNbaYB by Fettah_Aud (@Fettah_Aud) on CodePen.

  • Solution
Posted

It seems like the browser converts aspect-ratio to 1 / 1, with spaces and this also seems to be the standaard https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio

 

When animating complex strings it is best to provide the string in the same format. Converting it to include spaces fixes your issue. Probably converting your tweens to a .fromTo() would also work and you could then write it how ever you want. Hope it helps and happy tweening! 

 

See the Pen mdNbYGz?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen.

  • Like 1
Posted

A tinny space was causing this issue, weird things!

 

Thank you for your time

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...