secretgspot
9/26/2019 - 4:56 AM

Find Screen Height

// Find screen resolution based on ratio
function findScreenHeight(width, ratio) {
  const [widthRatio, heightRatio] = ratio.split(':')
  const height = width / widthRatio * heightRatio
  return width + 'x' + height
}
findScreenHeight(1280,"16:9"); // '1280x720'