blob: 2608e4772850c98bf752b7bba87a431b00587152 (
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
35
36
|
import React from "react";
import { useState, useEffect } from "react";
export interface Force {
magnitude: number;
directionInDegrees: number;
}
export interface IWallProps {
length: number;
xPos: number;
yPos: number;
angleInDegrees: number;
}
export default class App extends React.Component<IWallProps> {
constructor(props: any) {
super(props)
}
wallStyle = {
width: this.props.angleInDegrees == 0 ? this.props.length + "%" : 0.5 + "vw",
height: this.props.angleInDegrees == 0 ? 0.5 + "vw" : this.props.length + "%",
position: "absolute" as "absolute",
left: this.props.xPos + "%",
top: this.props.yPos + "%",
backgroundColor: "#6c7b8b",
zIndex: -1000,
margin: 0,
padding: 0,
};
render () {
return (<div style={this.wallStyle}></div>);
}
};
|