Devlog #4
What I learned
- Learned how to use arrow functions and how to add classes to an HTML element via
element.classList.add("..."); - Learned
width: fit-contentso that I don’t have to guess the width of my div.
Changes & Bug Fixes
Aesthetic tweak: Changed cursor grab to only show when hovering over handle instead of showing over the whole window).
-
Reduced repetition and improved scalability by turning open/close window into a generalized function that works for all windows, so I can call the function for future apps.
-
A lot of bugs and back-and-forth and commenting out code to add open-close function for the apps. I found out that I needed 2 parameters for the functions closeWindowOnClick and openWindowOnClick. First parameter is used for checking if the open button (app icon) or close button was selected/tapped, and second parameter is used for targeting the specific window that should be opened/closed. The parameters made me very confused because I would sometimes misinterpret the element as the button when the element parameter being passed was linked to the window.
-
Added an icon and CSS styling for my first app: poseidon.md
-
Added attributions to my README, for the bg image and the icons.
Programming Decisions
-
Called addWindowTapHandler() on line 19 instead of calling addWindowTapHandler() for each window directly to reduce redundancy.
-
Chose mousedown instead of click for event listener so that the window auto-focus when it is tapped immediately (if click is used then the window will only focus after mouse is up).
What’s Next?
- More README tweaks coming soon!
- More apps and content about Poseidon within each app.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.