diff options
author | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-21 12:07:39 -0500 |
---|---|---|
committer | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-21 12:07:39 -0500 |
commit | 0fd4eb6a8bf80861345633aabe6d482c24cb4d70 (patch) | |
tree | 755a11ee50f70cc8211450e84487903470d81461 /src | |
parent | b8762e80e3fd6b1c78b62f6bd50acb2029a68f58 (diff) |
settings menu
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/PhysicsSimulationBox.tsx | 45 | ||||
-rw-r--r-- | src/client/views/nodes/PhysicsSimulationWeight.tsx | 4 |
2 files changed, 17 insertions, 32 deletions
diff --git a/src/client/views/nodes/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsSimulationBox.tsx index b7f4ed0fb..f0e009deb 100644 --- a/src/client/views/nodes/PhysicsSimulationBox.tsx +++ b/src/client/views/nodes/PhysicsSimulationBox.tsx @@ -361,14 +361,14 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi <div style = {{width: this.layoutDoc._width+'px', height: this.layoutDoc._height+'px'}}> {this.menuIsOpen && ( <div className="mechanicsSimulationSettingsMenu"> - <div className="close-button" onClick={() => {this.menuIsOpen = false}}> - <FontAwesomeIcon icon={'times'} color="black" size={'lg'} /> + <div className="close-button" onClick={() => {this.menuIsOpen = false; this.dataDoc.simulationReset = !this.dataDoc.simulationReset;}} style={{zIndex: 20000}}> + <FontAwesomeIcon icon={'times'} color="yellow" size={'lg'} /> </div> - <h4>Simulation Settings</h4> + <h4 style={{zIndex: 20000}}>Simulation Settings</h4> {this.dataDoc.simulationType == "Free Weight" && <div className="mechanicsSimulationSettingsMenuRow"> - <p>Elastic collisions </p> - <CheckBox default={false} title={""} parent={this} numCount={1} updateStatus={(val: boolean) => {this.dataDoc.elasticCollisions = val}} originalStatus={this.dataDoc.elasticCollisions} /> + <p style={{zIndex: 20000}}>Elastic collisions </p> + <input type="checkbox" checked={this.dataDoc.elasticCollisions} onClick={() => {this.dataDoc.elasticCollisions = !this.dataDoc.elasticCollisions}}/> </div> } {/* {this.dataDoc.simulationType == "Inclined Plane" && @@ -376,40 +376,25 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi <p>Inclined plane angle </p> <p>input field!</p> </div> - } - {this.dataDoc.simulationType == "Pendulum" && + } */} + {/* {this.dataDoc.simulationType == "Pendulum" && <div className="mechanicsSimulationSettingsMenuRow"> <p>Pendulum angle </p> <p>input field!</p> </div> - } + } */} <div className="mechanicsSimulationSettingsMenuRow"> - <p>Show forces </p> - <Checkbox - value={this.dataDoc.showForces} - onChange={() => - this.dataDoc.showForces = !this.dataDoc.showForces - } - /> + <p style={{zIndex: 20000}}>Show forces </p> + <input type="checkbox" checked={this.dataDoc.showForces} onClick={() => {this.dataDoc.showForces = !this.dataDoc.showForces}}/> </div> <div className="mechanicsSimulationSettingsMenuRow"> - <p>Show acceleration </p> - <Checkbox - value={this.dataDoc.showAcceleration} - onChange={() => - this.dataDoc.showAcceleration = !this.dataDoc.showAcceleration - } - /> + <p style={{zIndex: 20000}}>Show acceleration </p> + <input type="checkbox" checked={this.dataDoc.showAcceleration} onClick={() => {this.dataDoc.showAcceleration = !this.dataDoc.showAcceleration}}/> </div> <div className="mechanicsSimulationSettingsMenuRow"> - <p>Show velocity </p> - <Checkbox - value={this.dataDoc.showVelocity} - onChange={() => - this.dataDoc.showVelocity = !this.dataDoc.showVelocity - } - /> - </div> */} + <p style={{zIndex: 20000}}>Show velocity </p> + <input type="checkbox" checked={this.dataDoc.showVelocity} onClick={() => {this.dataDoc.showVelocity = !this.dataDoc.showVelocity}}/> + </div> </div> )} </div> diff --git a/src/client/views/nodes/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsSimulationWeight.tsx index b9fa14df0..66af645b5 100644 --- a/src/client/views/nodes/PhysicsSimulationWeight.tsx +++ b/src/client/views/nodes/PhysicsSimulationWeight.tsx @@ -769,12 +769,12 @@ export default class Weight extends React.Component<IWeightProps, IState> { let arrowEndY: number = arrowStartY - Math.abs(force.magnitude) * - 20 * + 10 * Math.sin((force.directionInDegrees * Math.PI) / 180); const arrowEndX: number = arrowStartX + Math.abs(force.magnitude) * - 20 * + 10 * Math.cos((force.directionInDegrees * Math.PI) / 180); let color = "#0d0d0d"; |