Open rogueyoshi opened 4 years ago
https://css-tricks.com/scaled-proportional-blocks-with-css-and-javascript/
CSS scale() seems to be the way.
var scale = Math.min( availableWidth / contentWidth, availableHeight / contentHeight );
Here we go. Whipped this up. https://svelte.dev/repl/88d29ad782d443e2af1f8f21eaadc3ba?version=3.29.0
https://css-tricks.com/scaled-proportional-blocks-with-css-and-javascript/
CSS scale() seems to be the way.
var scale = Math.min( availableWidth / contentWidth, availableHeight / contentHeight );