Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Major CSS updates #37

Merged
merged 1 commit into from
Feb 26, 2024
Merged

Major CSS updates #37

merged 1 commit into from
Feb 26, 2024

Conversation

BobDotCom
Copy link
Contributor

I made a bunch of changes locally, and I figured it would be too much to make them into separate PRs, so I bunched it all together:

  1. Restructures the CSS. Common CSS identifiers which were duplicated between files have now been moved into a puzzle.css file which is imported into every puzzle page. This is both better for maintenance (don't have to edit multiple files to fix duplicated code), and marginally better for the end user because the puzzle.css file can be cached across puzzles.
  2. Makes the lockpick and laundromat puzzles responsive. This is very similar to the change I made to the roof running puzzle. It uses a special calculation based on the vertical height and width of the screen, and resizes the puzzle box based on that. This also required some changes to the TS, including an event listener that resets size when the viewport is resized.

Note

To be honest, I don't think this is actually the best solution. I believe it would be better to have the parent puzzle box determine the size of the puzzle by using CSS % to fill the available space. Then, the puzzle adjusts to the max size inside of that. This is much more efficent (requires less calculations), much simpler CSS (no need to preset the extra outside space), and better to maintain (won't need to update if you add another element to the page).

However, this would need some major refactoring from how the CSS is currently written, so that is probably something better tackled in another PR and I'll make an issue for that. For these changes, I just moved the calculation from using PX to using vw/vh.

  1. Finally, I changed the "check other mini-games" button to use a relative href instead of an absolute URL. That way, when someone (like me) runs it on localhost for development, it links to the correct page.

@BobDotCom
Copy link
Contributor Author

@MaximilianAdF I'm seeing some overwritten changes in the js files for lockpick and roofrunning. Did you push just the js files and forget to push the TS as well? Or other way around, did you forget to push some of the JS?

This was referenced Feb 24, 2024
@MaximilianAdF
Copy link
Owner

@MaximilianAdF I'm seeing some overwritten changes in the js files for lockpick and roofrunning. Did you push just the js files and forget to push the TS as well? Or other way around, did you forget to push some of the JS?

  • As for the RoofRunning TS it was just some type casting so it didn't have an effect on the JS file.
  • When it comes to the LockPick I am not sure what could have cause that, might have been me forgetting to compile the TS file before pushing

@BobDotCom
Copy link
Contributor Author

BobDotCom commented Feb 26, 2024

  • As for the RoofRunning TS it was just some type casting so it didn't have an effect on the JS file.

  • When it comes to the LockPick I am not sure what could have cause that, might have been me forgetting to compile the TS file before pushing

Ok. If that's the only overwritten change, this PR shouldn't cause any new conflicts with that. It's ready to merge, pending your review and approval

@MaximilianAdF MaximilianAdF merged commit 34da58a into MaximilianAdF:main Feb 26, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants