@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
22 lines (21 loc) • 561 B
JavaScript
export function mapPageAlignment(alignment) {
switch (alignment) {
case "top":
return "flex-start";
case "center":
return "center";
case "bottom":
return "flex-end";
}
}
export function clamp(value, min, max) {
return Math.max(min, Math.min(value, max));
}
export function getTranslation(element) {
if (element === null) {
return 0;
}
const style = window.getComputedStyle(element);
const trasform = new WebKitCSSMatrix(style.transform);
return trasform.m41;
}