Skip to content
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
31 changes: 22 additions & 9 deletions apps/website/src/components/navigation.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import crocoderLogo from "../assets/crocoder-logo.png";
import Menu from "./Menu.astro";
import MenuItem from "./MenuItem.astro";

const { position } = Astro.props;

const optimizedLogo = await getImage({
src: crocoderLogo,
width: 63,
Expand All @@ -25,15 +27,19 @@ const caseStudies = [
href: "/blog/migrating-an-enterprise-app-from-angularjs-to-react",
},
];

const isBlogPage = Astro.url.pathname.startsWith("/blog");

const href = "#book-a-call-section";
---

<header
class="fixed m-auto
top-0
md:mx-2
md:top-1
z-50
w-full flex flex-col"
class={`${position ?? "fixed"} m-auto
top-0
md:mx-2
${isBlogPage ? "md:mt-1" : "md:top-1"}
z-50
w-full flex flex-col`}
>
<nav
id="nav-bar"
Expand Down Expand Up @@ -130,7 +136,7 @@ const caseStudies = [
data-navhidden="true"
id="book-a-call-action"
class="invisible w-fit font-medium h-[39px] items-center px-4 py-2 rounded-md text-base text-center whitespace-nowrap bg-[#545664] text-[#ffffff] hover:opacity-90"
href={"#book-a-call-section"}
href={href}
>
Book a call
</a>
Expand Down Expand Up @@ -171,7 +177,10 @@ const caseStudies = [

{
caseStudies.map((item) => (
<a class="text-xl hover:text-white text-wrap min-h-8" href={item.href}>
<a
class="text-xl hover:text-white text-wrap min-h-8"
href={item.href}
>
{item.title}
</a>
))
Expand All @@ -186,7 +195,7 @@ const caseStudies = [
text-base text-center
whitespace-nowrap
bg-[#545664] text-[#ffffff] hover:opacity-90"
href={"#book-a-call-section"}
href={href}
>
Book a call
</a>
Expand Down Expand Up @@ -228,6 +237,8 @@ const caseStudies = [
const mobileList = document.getElementById("mobile-list");
const navMenuToggle = document.getElementById("nav-menu-toggle");

const isBlogPage = window.location.pathname.startsWith("/blog");

mm.add("(width >= 768px)", () => {
if (!navBar || !bookACallAction) return;

Expand All @@ -244,6 +255,8 @@ const caseStudies = [
display: "none",
});

if (isBlogPage) return;

const tl = gsap.timeline({
paused: true,
defaults: { duration: FRAME_DURATION, ease: "none" },
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/layouts/base-blog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import theme from "../..//theme.json";
import Footer from "../components/footer.astro";
import Posthog from "../components/posthog.astro";
import Header from "./header.astro";
import "../styles/main.css";
import { AstroFont } from "astro-font";
import Navigation from "../components/navigation.astro";

const pf = theme.fonts.font_family.primary;
const sf = theme.fonts.font_family.secondary;
Expand Down Expand Up @@ -56,7 +56,7 @@ if (theme.fonts.font_family.secondary) {
/>
</head>
<body class="bg-body font-primary font-normal leading-relaxed text-text">
<Header />
<Navigation position="static" />
<main class="min-h-[60vh]">
<slot />
</main>
Expand Down
137 changes: 0 additions & 137 deletions apps/website/src/layouts/header.astro

This file was deleted.