2021-05-30 11:43:09 -07:00
|
|
|
export const minimumAspectRatio = 9 / 16; // Portrait phone
|
|
|
|
export const maximumAspectRatio = 10; // Generous min-height
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
export const isPanoramic = ar => {
|
|
|
|
if (isNaN(ar)) return false;
|
|
|
|
return ar >= maximumAspectRatio;
|
2020-04-14 11:44:40 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
export const isPortrait = ar => {
|
|
|
|
if (isNaN(ar)) return false;
|
|
|
|
return ar <= minimumAspectRatio;
|
2020-04-14 11:44:40 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
export const isNonConformingRatio = ar => {
|
|
|
|
if (isNaN(ar)) return false;
|
|
|
|
return !isPanoramic(ar) && !isPortrait(ar);
|
2020-04-14 11:44:40 -07:00
|
|
|
};
|