Last active
November 23, 2018 19:14
-
-
Save rootasjey/a238aa2cf228a4cf88e5b241ae7640da to your computer and use it in GitHub Desktop.
Example module which places visual elements according to device detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App | |
/** | |
* Return horizontal icon position. | |
*/ | |
export function getIconX() { | |
const hPos = { | |
Ionic: 290, | |
Versa: 250, | |
}; | |
return hPos[deviceType]; | |
} | |
/** | |
* Return vertical icon position. | |
*/ | |
export function getIconY({ metricNumber }) { | |
const vPos = { | |
Ionic: { | |
0: 20, | |
1: 77, | |
2: 120, | |
3: 165, | |
4: 210, | |
}, | |
Versa: { | |
0: 30, | |
1: 90, | |
2: 150, | |
3: 200, | |
4: 255, | |
}, | |
}; | |
return vPos[deviceType][metricNumber]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment