function getAspectRatio()

in src/components/VideoGrid/index.tsx [9:38]


function getAspectRatio(height: number, width: number) {
  const aspectRatio = width / height;

  if (aspectRatio > 36 / 9) {
    return 'r36by9';
  }
  if (aspectRatio > 29 / 9) {
    return 'r29by9';
  }
  if (aspectRatio > 21 / 9) {
    return 'r21by9';
  }
  if (aspectRatio > 16 / 9) {
    return 'r16by9';
  }
  if (aspectRatio > 3 / 2) {
    return 'r3by2';
  }
  if (aspectRatio > 4 / 3) {
    return 'r4by3';
  }
  if (aspectRatio > 1) {
    return 'r1by1';
  }
  if (aspectRatio > 2 / 3) {
    return 'r2by3';
  }

  return 'slim';
}