Zoom in or Zoom out group on sliderinput value change

Hello guys. i am creating an image editor app like canva.com. I am trying to make the canva to auto zoom out when it’s width or height it’s bigger than it’s parent group or page itself. also i have a slider that i want to zoom in or zoom out the canva when the value is changed. i will attach some photos from canva and my app to see. if anyone could help me with this i would much appreciate it.