2019-11-25 20:01:17 +00:00
|
|
|
import { isTablet } from './deviceInfo';
|
|
|
|
|
|
|
|
const guidelineBaseWidth = isTablet ? 600 : 375;
|
|
|
|
const guidelineBaseHeight = isTablet ? 800 : 667;
|
2018-08-10 17:26:36 +00:00
|
|
|
|
2021-09-23 14:17:53 +00:00
|
|
|
// TODO: we need to refactor this
|
|
|
|
const scale = (size, width) => (width / guidelineBaseWidth) * size;
|
|
|
|
const verticalScale = (size, height) => (height / guidelineBaseHeight) * size;
|
|
|
|
const moderateScale = (size, factor = 0.5, width) => size + (scale(size, width) - size) * factor;
|
2018-08-10 17:26:36 +00:00
|
|
|
|
|
|
|
export { scale, verticalScale, moderateScale };
|