Skip to content

Conversation

@NeatNit
Copy link

@NeatNit NeatNit commented Oct 28, 2025

Fixes #2893.

I am so very rusty with JavaScript and DOM manipulation. This was more painful to get done than I expected. But I think it was worth it.

The premise is simple: if Ferris is hiding some code, let the user scroll horizontally far enough until the code is no longer hidden. However, we don't want to create excessive scrolling unnecessarily.

THIS IS A DRAFT. To do:

  • JavaScript: need code review. Some lines are obvious junk. I think the general code structure is sound, but I'm really not sure about style and linter errors. As I said, I'm rusty with JS, and not in the good meaning of "rusty"! Let me know what needs fixing.
  • CSS: should probably use CSS variables to put the ferris width and margin size in one place. Also, I wasn't sure if I should use margin or padding. Any idea?
  • Make the margin smaller for small Ferris.

Before: Note that the horizontal scroll bar is at its limit.
image
After:
image

Before:
image
After: The longer line below Ferris is not given a margin unnecessarily.
image

@NeatNit
Copy link
Author

NeatNit commented Oct 28, 2025

Just a note: setTimeout is needed because getBoundingClientRect would otherwise return unusable results.

I know there's a lot to clean up in the code, the reasons I didn't do that before submitting is I wanted to first get feedback on the result. The rendered result is pretty much complete.

I will add screenshots to the OP in a few minutes.

@NeatNit NeatNit marked this pull request as draft October 28, 2025 00:29
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.

Symbols can cover up code on smartphones.

1 participant