Skip to content

Commit

Permalink
Add empty pages and scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluesmile82 committed Oct 9, 2024
1 parent 18d7c24 commit 009b7eb
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 10 deletions.
9 changes: 9 additions & 0 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function About() {
return (
<main className="bg-green-700">
<div className="pt-[90px] text-white container">
About
</div>
</main>
);
}
9 changes: 9 additions & 0 deletions src/app/case-study-energy/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function Energy() {
return (
<main className="bg-green-700">
<div className="pt-[90px] text-white container">
Case study: Energy
</div>
</main>
);
}
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function RootLayout({
return (
<html lang="en">
<body className={cn(
"min-h-screen bg-background font-sans antialiased",
"min-h-screen bg-background font-sans antialiased scroll-smooth",
fontSans.variable
)}>
<ContextWrapper>
Expand Down
6 changes: 3 additions & 3 deletions src/components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const Footer = ({ backgroundClass = "bg-green-700" }) => {
</Link>
</li>
<li className="text-white text-base font-bold underline">
<Link href="/"><HoverRepeatAnimation>Impact mode: Energy</HoverRepeatAnimation></Link>
<Link href="/case-study-energy"><HoverRepeatAnimation>Impact mode: Energy</HoverRepeatAnimation></Link>
</li>
<li className="text-white text-base font-bold underline">
<Link href="/"><HoverRepeatAnimation>About Us</HoverRepeatAnimation></Link>
<Link href="/about"><HoverRepeatAnimation>About Us</HoverRepeatAnimation></Link>
</li>
<li className="text-white text-base font-bold underline">
<Link href="/"><HoverRepeatAnimation>Contact</HoverRepeatAnimation></Link>
<Link href="mailto:#"><HoverRepeatAnimation>Contact</HoverRepeatAnimation></Link>
</li>
</ul>
</div >
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Header() {
);

return (
<div className={cn("fixed inset-0 w-full h-[90px] py-6 flex z-20 transition-colors duration-500",
<header className={cn("fixed inset-0 w-full h-[90px] py-6 flex z-20 transition-colors duration-500",
{
"bg-blue-900": isScrolled,
"bg-transparent": !isScrolled
Expand All @@ -55,6 +55,6 @@ export default function Header() {
<Logo className="w-60 h-10 text-white" />
<MenuButton />
</div>
</ div >
</header>
);
};
8 changes: 7 additions & 1 deletion src/components/intro/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import HeroVideo from './hero-video';
import Lines from '@/components/lines';

export default function Intro() {
const handleAnchor = (anchor: string) => {
const element = document.getElementById(anchor);
if (element) {
element.scrollIntoView({ behavior: "smooth", block: "start" });
}
}
return (
<section className="relative h-[110vh] bg-blue-900">
<HeroVideo />
Expand Down Expand Up @@ -42,7 +48,7 @@ export default function Intro() {
className='z-10'
>
<HoverRepeatAnimation isChild>
<Link href="#">Keep exploring</Link>
<Link href="/#section-1" onClick={() => handleAnchor('section-1')} scroll={false}>Keep exploring</Link>
</HoverRepeatAnimation>
</MotionButton>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export default function Menu() {
<HoverRepeatAnimation>Home</HoverRepeatAnimation></Link>
</li>
<li>
<Link href="/"><HoverRepeatAnimation className="pb-1">Case Studies: Energy</HoverRepeatAnimation></Link>
<Link href="/case-study-energy"><HoverRepeatAnimation className="pb-1">Case Studies: Energy</HoverRepeatAnimation></Link>
</li>
<li>
<Link href="/"><HoverRepeatAnimation>About Us</HoverRepeatAnimation></Link>
<Link href="/about"><HoverRepeatAnimation>About Us</HoverRepeatAnimation></Link>
</li>
<li>
<a href="mailto:#"><HoverRepeatAnimation>Contact</HoverRepeatAnimation></a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/section-1/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Section1() {
'grid-cols-[1fr_1fr_1fr]': hoveredIndex === null,
};
return (
<section className="relative bg-white py-20 ">
<section className="relative bg-white py-20 scroll-mt-8" id="section-1">
<Lines verticalClassName="pl-[152px] pr-[152px]" sectionName="section-1" rows={[474, (!hoveredIndex || hoveredIndex === 0) ? 1134 : 1154]} colorClass="bg-blue-900/20" hoveringColumnsNumber={3} hoveredIndex={hoveredIndex} />
<div className="container px-[150px]">
<div className="max-w-[594px] text-green-700 space-y-5 pb-20">
Expand Down

0 comments on commit 009b7eb

Please sign in to comment.