blob: 69635229656ef74951286fbaf1d9a069437e83db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import * as React from 'react';
export interface Force {
magnitude: number;
directionInDegrees: number;
}
export interface IWallProps {
length: number;
xPos: number;
yPos: number;
angleInDegrees: number;
}
export default class Wall extends React.Component<IWallProps> {
constructor(props: any) {
super(props);
}
wallStyle = {
width: this.props.angleInDegrees == 0 ? this.props.length + '%' : '5px',
height: this.props.angleInDegrees == 0 ? '5px' : this.props.length + '%',
position: 'absolute' as 'absolute',
left: this.props.xPos + '%',
top: this.props.yPos + '%',
backgroundColor: '#6c7b8b',
margin: 0,
padding: 0,
};
render() {
return <div style={this.wallStyle}></div>;
}
}
|