From 0cda1a8f8b4e3d79c30291685456c7cb62fd7e8e Mon Sep 17 00:00:00 2001 From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> Date: Mon, 24 Apr 2023 13:39:14 -0400 Subject: add folder for physics box --- .../nodes/PhysicsBox/PhysicsSimulationBox.scss | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss') diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss new file mode 100644 index 000000000..0f05010b4 --- /dev/null +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss @@ -0,0 +1,72 @@ +* { + box-sizing: border-box; + font-size: 14px; +} + +.mechanicsSimulationContainer { + background-color: white; + height: 100%; + width: 100%; + display: flex; + + .mechanicsSimulationEquationContainer { + position: fixed; + left: 70%; + padding: 1em; + + .mechanicsSimulationControls { + display: flex; + justify-content: space-between; + } + } +} + +.coordinateSystem { + z-index: -100; +} + +th, +td { + border-collapse: collapse; + padding: 1em; +} + +table { + min-width: 300px; +} + +tr:nth-child(even) { + background-color: #d6eeee; +} + +button { + z-index: 50; +} + +.angleLabel { + font-weight: bold; + font-size: 20px; + user-select: none; + pointer-events: none; +} + +.mechanicsSimulationSettingsMenu { + width: 100%; + height: 100%; + font-size: 12px; + background-color: rgb(224, 224, 224); + border-radius: 2px; + border-color: black; + border-style: solid; + padding: 10px; + position: fixed; + z-index: 1000; +} + +.mechanicsSimulationSettingsMenuRow { + display: flex; +} + +.mechanicsSimulationSettingsMenuRowDescription { + width: 50%; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 617d008889a6b9640bc9cf8a87d24a5ed24cb660 Mon Sep 17 00:00:00 2001 From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> Date: Tue, 2 May 2023 20:39:02 -0400 Subject: debug --- .../nodes/PhysicsBox/PhysicsSimulationBox.scss | 4 + .../nodes/PhysicsBox/PhysicsSimulationBox.tsx | 102 ++++++++++----------- .../nodes/PhysicsBox/PhysicsSimulationWeight.tsx | 58 ++++-------- 3 files changed, 70 insertions(+), 94 deletions(-) (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss') diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss index 0f05010b4..2e16417f5 100644 --- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.scss @@ -69,4 +69,8 @@ button { .mechanicsSimulationSettingsMenuRowDescription { width: 50%; +} + +.dropdownMenu { + z-index: 50; } \ No newline at end of file diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx index 5335fc1ec..3cb34d5b9 100644 --- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx @@ -33,10 +33,9 @@ import { import Typography from "@mui/material/Typography"; import "./PhysicsSimulationBox.scss"; import InputField from "./PhysicsSimulationInputField"; -// import questions from "./PhysicsSimulationQuestions.json"; -// import tutorials from "./PhysicsSimulationTutorial.json"; +import questions from "./PhysicsSimulationQuestions.json"; +import tutorials from "./PhysicsSimulationTutorial.json"; import Wall from "./PhysicsSimulationWall"; -import IWall from "./PhysicsSimulationWall"; import Weight from "./PhysicsSimulationWeight"; interface IWallProps { @@ -211,7 +210,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent { - if (this.dataDoc.simulationType != "Circular Motion") { + setupSimulation = (simulationType: string, mode: string) => { + this.dataDoc.simulationPaused = true; + if (simulationType != "Circular Motion") { this.dataDoc.startVelX = 0; this.dataDoc.setStartVelY = 0; this.dataDoc.velocityXDisplay = (0); this.dataDoc.velocityYDisplay = (0); } - if (this.dataDoc.mode == "Freeform") { + if (mode == "Freeform") { this.dataDoc.showForceMagnitudes = (true); - if (this.dataDoc.simulationType == "One Weight") { + if (simulationType == "One Weight") { this.dataDoc.showComponentForces = false; this.dataDoc.startPosY = (this.yMin + this.radius); this.dataDoc.startPosX = ((this.xMax + this.xMin) / 2 - this.radius); @@ -252,7 +252,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent )} -
-
- -
-
)} +
+ +
{ - this.dataDoc.simulationType = event.target.value; - this.setupSimulation(event.target.value, this.dataDoc.mode); + this.dataDoc.simulation_Type = event.target.value; + this.setupSimulation(event.target.value, StrCast(this.dataDoc.mode)); }} style={{ height: '2em', width: '100%', fontSize: '16px' }}> @@ -1088,10 +1058,10 @@ export class PhysicsSimulationBox extends ViewBoxAnnotatableComponent