Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat: Cap Friday

Richie McIlroy0765fee5e62b
diff --git a/apps/web/app/(site)/BlackFridayBanner.tsx b/apps/web/app/(site)/BlackFridayBanner.tsx
new file mode 100644
index 000000000..005aa3633
--- /dev/null
+++ b/apps/web/app/(site)/BlackFridayBanner.tsx
@@ -0,0 +1,47 @@
+"use client";
+
+import { buildEnv } from "@cap/env";
+import Link from "next/link";
+import { useState } from "react";
+
+export function BlackFridayBanner() {
+ const [isHovered, setIsHovered] = useState(false);
+
+ if (buildEnv.NEXT_PUBLIC_IS_CAP !== "true") {
+ return null;
+ }
+
+ return (
+ <Link
+ href="https://pay.cap.so/b/aFa5kD2EnaNH2Pdg4obII00?prefilled_promo_code=BLACKFRIDAY"
+ target="_blank"
+ onMouseEnter={() => setIsHovered(true)}
+ onMouseLeave={() => setIsHovered(false)}
+ className="fixed top-0 left-0 right-0 z-[52] flex items-center justify-center gap-1 sm:gap-2 bg-black py-2 px-3 text-center text-xs sm:text-sm text-white cursor-pointer hover:bg-gray-900 transition-colors"
+ >
+ <span className="font-semibold">Black Friday:</span>
+ <span className="hidden sm:inline">50% off Cap Pro Annual with code</span>
+ <span className="sm:hidden">50% off Cap Pro</span>
+ <span className="relative font-mono font-bold bg-white/20 px-1.5 sm:px-2 py-0.5 rounded text-xs sm:text-sm overflow-hidden">
+ <span
+ className={`inline-block transition-all duration-300 ${
+ isHovered
+ ? "-translate-y-full opacity-0"
+ : "translate-y-0 opacity-100"
+ }`}
+ >
+ BLACKFRIDAY
+ </span>
+ <span
+ className={`absolute inset-0 flex items-center justify-center transition-all duration-300 ${
+ isHovered
+ ? "translate-y-0 opacity-100"
+ : "translate-y-full opacity-0"
+ }`}
+ >
+ Buy Now
+ </span>
+ </span>
+ </Link>
+ );
+}
diff --git a/apps/web/app/(site)/Navbar.tsx b/apps/web/app/(site)/Navbar.tsx
index 18a7ddc6e..862cb0012 100644
--- a/apps/web/app/(site)/Navbar.tsx
+++ b/apps/web/app/(site)/Navbar.tsx
@@ -1,5 +1,6 @@
"use client";
+import { buildEnv } from "@cap/env";
import {
Button,
Logo,
@@ -131,7 +132,14 @@ export const Navbar = () => {
return (
<>
- <header className="fixed top-4 left-0 right-0 z-[51] lg:top-10 animate-in fade-in slide-in-from-top-4 duration-500">
+ <header
+ className={classNames(
+ "fixed left-0 right-0 z-[51] animate-in fade-in slide-in-from-top-4 duration-500",
+ buildEnv.NEXT_PUBLIC_IS_CAP === "true"
+ ? "top-[60px] lg:top-[65px]"
+ : "top-4 lg:top-10",
+ )}
+ >
<nav className="p-2 mx-auto w-full max-w-[calc(100%-20px)] bg-white rounded-full border backdrop-blur-md lg:max-w-fit border-zinc-200 h-fit">
<div className="flex gap-12 justify-between items-center mx-auto max-w-4xl h-full transition-all">
<div className="flex items-center">
diff --git a/apps/web/app/(site)/layout.tsx b/apps/web/app/(site)/layout.tsx
index d8deb49e2..7d5dea56b 100644
--- a/apps/web/app/(site)/layout.tsx
+++ b/apps/web/app/(site)/layout.tsx
@@ -1,12 +1,18 @@
+import { buildEnv } from "@cap/env";
import type { PropsWithChildren } from "react";
import { Intercom } from "../Layout/Intercom";
+import { BlackFridayBanner } from "./BlackFridayBanner";
import { Footer } from "./Footer";
import { Navbar } from "./Navbar";
export default function Layout(props: PropsWithChildren) {
+ const showBanner = buildEnv.NEXT_PUBLIC_IS_CAP === "true";
+
return (
<>
+ <BlackFridayBanner />
<Navbar />
+ {showBanner && <div className="h-[36px]" />}
{props.children}
<Footer />
<Intercom />
diff --git a/apps/web/components/pages/HomePage/Header.tsx b/apps/web/components/pages/HomePage/Header.tsx
index c1ca4ff26..1619ff359 100644
--- a/apps/web/components/pages/HomePage/Header.tsx
+++ b/apps/web/components/pages/HomePage/Header.tsx
@@ -71,33 +71,12 @@ const Header = ({ serverHomepageCopyVariant = "" }: HeaderProps) => {
const headerContent = getHeaderContent();
return (
- <div className="mt-[100px] mb-10 sm:mb-[150px] min-h-screen w-full max-w-[1920px] overflow-x-hidden md:overflow-visible mx-auto md:mt-[20vh]">
+ <div className="mt-[110px] mb-10 sm:mb-[150px] min-h-screen w-full max-w-[1920px] overflow-x-hidden md:overflow-visible mx-auto md:mt-[20vh]">
<div className="flex flex-col justify-center lg:justify-start xl:flex-row relative z-10 px-5 w-full mb-[200px]">
<div className="w-full max-w-2xl xl:max-w-[530px] 2xl:mt-12 mx-auto xl:ml-[100px] 2xl:ml-[150px]">
- <motion.div
- initial="hidden"
- animate="visible"
- custom={0}
- variants={fadeIn}
- >
- <Link
- href={homepageCopy.header.announcement.href}
- className="flex gap-2 items-center px-3 py-2 mb-8 bg-white rounded-full border group border-gray-4 w-fit"
- >
- <p className="font-mono text-xs text-gray-12">
- {homepageCopy.header.announcement.text}
- </p>
- <FontAwesomeIcon
- fontWeight="light"
- className="w-1.5 text-gray-12 group-hover:translate-x-0.5 transition-transform"
- icon={faAngleRight}
- />
- </Link>
- </motion.div>
-
<div className="flex flex-col text-left w-full max-w-[650px]">
<motion.h1
- className="text-[2.8rem] font-medium leading-[3rem] md:text-[3.75rem] md:leading-[4rem] relative z-10 text-black mb-4"
+ className="text-[2.25rem] font-medium leading-[2.5rem] md:text-[3.75rem] md:leading-[4rem] relative z-10 text-black mb-4"
initial="hidden"
animate="visible"
custom={1}