Compare commits

..

1 commit

Author SHA1 Message Date
q3k 8c52de0616 look: fix scrolling to sections
Some checks failed
/ deploy (push) Failing after 2s
This fixes:

1. Sections overlapping with navbar when linked to. The fix is dirty,
   it's just a margin.
2. The inability to scroll down to 'contacts' and other lower sections.
   We just expand the second-to-last section to allow the browser to
   scroll.
3. Updating the currently active section - this now uses a global view
   of all visible sections that is updated by the observer diff, thereby
   fixing the logic.
2025-04-13 19:03:03 +02:00
2 changed files with 1 additions and 6 deletions

View file

@ -51,7 +51,7 @@ function NewSection({
after?: ReactElement; after?: ReactElement;
}) { }) {
return (<section id={id} className="bg-background"> return (<section id={id} className="bg-background">
<div className="container mx-auto px-4 gap-6 flex flex-col"> <div className="container mx-auto px-4 gap-6 flex flex-col mt-20">
{children} {children}
{after} {after}
</div> </div>

View file

@ -159,9 +159,4 @@
/* Allow to scroll past the last section, needed for fragment-directed navigation. */ /* Allow to scroll past the last section, needed for fragment-directed navigation. */
section#contact { section#contact {
min-height: 100vh; min-height: 100vh;
}
/* Fix scrolling to section by fragment, making sure it shows in the right spot and not behind the navbar. */
section {
scroll-margin-top: calc(var(--spacing) * 16 + var(--spacing) * 4);
} }