Here’s a JS question;
I have a tool for users to create an image of a double glazed window, they input theiir height and width values. The image created needs to show the user a representation of what they will get, the absolute size is not important, but the user needs to see the correct aspect ratio of their inputted height/width - but I also need to fix the width on my Bubble page to 500px wide.
So, assume the user creates a window 900 wide x 650 high. I need to shrink the image to be 500px wide, and then make the height the correct height based on the original aspect ratio 900 x 650.
Any know how this can be done?
Here’s an example, both images below restrict the visual group to 500px wide, regardless of the users inputted size. However, I don;t know how to maintain the original inputted aspect ratio.
Example of 1000x300 (reduced to 500px wide)
Example of 700x500 (reduced to 500px wide)