Created
April 7, 2017 16:01
-
-
Save mvbattan/4def305854368b6216c642ad1e84e420 to your computer and use it in GitHub Desktop.
createLine
This file contains hidden or 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
| export const createLine = (dist, angle, color, opacity, startingPoint) => { | |
| return { | |
| backgroundColor: color, | |
| height: 4, | |
| width: dist, | |
| bottom: dist * Math.sin(angle) / 2 + startingPoint.y, | |
| left: -dist * (1 - Math.cos(angle)) / 2 + startingPoint.x, | |
| position: 'absolute', | |
| opacity, | |
| transform: [ | |
| { rotate: `${(-1) * angle} rad` } | |
| ] | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment