Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: anchor for meet the team has fixed #293

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/components/Navbar/NavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ const links = [
{ title: 'Sponsors', href: 'sponsors-anchor', offset: 200 },
{ title: 'Partners', href: 'partners-anchor', offset: 20 },
{ title: 'FAQ', href: 'faq-anchor', offset: 120 },
{ title: 'The Team', href: 'team-anchor' },
{ title: 'The Team', href: 'team-anchor', offset: 180 },
{ title: 'Contact', href: 'contact-anchor', offset: 100 },
];

const rowStyle = 'flex-row items-center';
const colStyle = 'flex-col lg:p-0';
const navbarHeightPx = 80;
const scrollPaddingPx = -navbarHeightPx; // navbarHeight + extra padding
const navbarHeightPx = -88;

const NavItems: React.FC<NavItemsProps> = ({ isHorizontal, handleClick }) => {
const handleLinkClick = (title: string) => {
Expand All @@ -34,7 +33,7 @@ const NavItems: React.FC<NavItemsProps> = ({ isHorizontal, handleClick }) => {
to={link.href}
smooth
duration={500}
offset={link.offset ? -link.offset + scrollPaddingPx : scrollPaddingPx}
offset={link.offset ? -link.offset + navbarHeightPx : navbarHeightPx}
className="text-md w-full"
onClick={() => handleLinkClick(link.title)}
>
Expand Down
13 changes: 7 additions & 6 deletions src/components/sections/TeamFAQ.section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,9 @@ const TeamFAQSection = () => {

<section
id="team"
className="relative isolate p-4 md:-translate-y-[10%] md:p-8 lg:p-12 xl:-translate-y-[15%]"
className="relative isolate mx-auto p-4 md:p-8 lg:p-12"
>
<div
id="team-anchor"
className="relative mx-auto mb-10 w-fit sm:mb-24 lg:mb-32"
>
<div className="relative mx-auto mb-10 w-fit sm:mb-24 lg:mb-32">
<img
className="mx-auto hidden w-full max-w-fit sm:block"
src={MeetTheTeamBalloon}
Expand All @@ -90,10 +87,14 @@ const TeamFAQSection = () => {
alt=""
/>
<img
className="absolute bottom-0 z-10 hidden translate-y-1/2 sm:block"
className="absolute bottom-0 z-10 hidden translate-y-1/2 sm:block"
src={Clouds}
alt=""
/>
<span
className="anchor sr-only bottom-1/4 left-0 -translate-y-1/2"
id="team-anchor"
></span>
</div>

<img
Expand Down
Loading