blob: 8cc1d0fbfb9f4f2a02bfef9b52f0d0428bf40f2a (
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
34
|
import React = require('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>);
}
};
|