Skip to content

Conversation

LiveNathan
Copy link
Owner

No description provided.

Updated the HTML form and related JavaScript to make some inputs dynamic, depending on checkbox values. Introduced a new JavaScript file "updated-alignment-position-fields.js" to handle changes in form field values based on user inputs. The changes allow users to dynamically adjust the array alignment position and automatically update other related fields. An event listener has been added to handle real-time changes in "sub depth relative to mains on x-axis" and "units" fields. This allows for a more interactive, use-friendly experience.
This commit fixes a bug where the sub's X position was not updating and the scene not re-rendering due to missing code in the event listener. A conversion from the input event value into a number was also added for correct positioning calculation. Now the submarine properly moves along the x-axis on input and the animation is triggered on each change.
This commit encompasses a significant refactor of the cube creation and positioning in the main.js file. Originally, the cubes were created and placed directly within the main script. Now, I have introduced a utility class, "Location", for encapsulating a 3D location (x, y, z), and a helper function, "createCube", to portion out the creation of cubes. This enhancement adds more readability, maintains code cleanliness, and allows easy reusability of the logic for creating a cube.
The code's structure was rearranged to clarify what each section does. Some parts have been repositioned and others extracted into seperate functions to make it easier to understand. The 'Location' class was moved to the top, and event listeners were moved to the bottom. Moreover, the inline code for the 'sub' y location setting was extracted into a separate function 'setSubLocationY', resulting in more straightforward, easier-to-read code.
@LiveNathan LiveNathan requested a review from iansedano October 20, 2023 00:56
@iansedano iansedano changed the base branch from master to initial-cubes-axes-labels October 23, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant