diff options
Diffstat (limited to 'src/client/views/nodes/PhysicsSimulationWeight.tsx')
-rw-r--r-- | src/client/views/nodes/PhysicsSimulationWeight.tsx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/client/views/nodes/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsSimulationWeight.tsx index 63f8c965f..dfd463bbe 100644 --- a/src/client/views/nodes/PhysicsSimulationWeight.tsx +++ b/src/client/views/nodes/PhysicsSimulationWeight.tsx @@ -1,6 +1,5 @@ import React = require('react'); import { IWallProps } from "./PhysicsSimulationWall"; -import Wedge from "./PhysicsSimulationWedge"; export interface IForce { description: string; @@ -107,6 +106,7 @@ export default class Weight extends React.Component<IWeightProps, IState> { top: this.props.startPosY + "px", width: 2 * this.props.radius + "px", height: 2 * this.props.radius + "px", + zIndex: 5, borderRadius: 50 + "%", display: "flex", justifyContent: "center", @@ -215,6 +215,7 @@ export default class Weight extends React.Component<IWeightProps, IState> { height: 2 * this.props.radius + "px", borderRadius: 50 + "%", display: "flex", + zIndex: 5, justifyContent: "center", alignItems: "center", touchAction: "none", @@ -397,7 +398,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { this.setState({xPosition: wallX+5}); } collision = true; - console.log('collision with wall') } } else { if (maxX >= wallX) { @@ -408,7 +408,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { this.setState({xPosition: wallX - 2 * this.props.radius + 5}); } collision = true; - console.log('collision with wall') } } } @@ -425,7 +424,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { if (wall.angleInDegrees == 0) { const groundY = (wall.yPos / 100) * this.props.yMax; if (maxY >= groundY) { - console.log('collision with ground ', wall, maxY) if (this.props.elasticCollisions) { this.setState({yVelocity: -this.state.yVelocity}) } else { @@ -521,7 +519,7 @@ export default class Weight extends React.Component<IWeightProps, IState> { render () { return ( - <div style={{ zIndex: -1000 }}> + <div> <div className="weightContainer" onPointerDown={(e) => { @@ -617,7 +615,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { position: "absolute", left: 0, top: 0, - zIndex: -2, }} > <svg width={this.props.xMax + "px"} height={300 + "px"}> @@ -632,7 +629,7 @@ export default class Weight extends React.Component<IWeightProps, IState> { </svg> {!this.state.dragging && ( <div> - <p + {/* <p style={{ position: "absolute", zIndex: 5, @@ -642,11 +639,10 @@ export default class Weight extends React.Component<IWeightProps, IState> { }} > {Math.round(this.props.pendulumLength)} m - </p> + </p> */} <p style={{ position: "absolute", - zIndex: -1, left: this.props.xMax / 2 + "px", top: 30 + "px", backgroundColor: this.labelBackgroundColor, @@ -664,7 +660,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { style={{ pointerEvents: "none", position: "absolute", - zIndex: -1, left: 0, top: 0, }} @@ -709,7 +704,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { this.getNewAccelerationY(this.props.updatedForces) * 5 + 25 + "px", - zIndex: -1, lineHeight: 0.5, }} > @@ -733,7 +727,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { style={{ pointerEvents: "none", position: "absolute", - zIndex: -1, left: 0, top: 0, }} @@ -768,7 +761,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { position: "absolute", left: this.state.xPosition + this.props.radius + this.state.xVelocity * 3 + 25 + "px", top: this.state.yPosition + this.props.radius + this.state.yVelocity * 3 + "px", - zIndex: -1, lineHeight: 0.5, }} > @@ -826,7 +818,6 @@ export default class Weight extends React.Component<IWeightProps, IState> { style={{ pointerEvents: "none", position: "absolute", - zIndex: -1, left: this.props.xMin, top: this.props.yMin, }} |