Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update onboarding layout + welcome/splash page

Tim Wilson58480a3379a4
diff --git a/apps/web/app/app.dub.co/(onboarding)/layout.tsx b/apps/web/app/app.dub.co/(onboarding)/layout.tsx
index 1c041d81b9..93d5518c6a 100644
--- a/apps/web/app/app.dub.co/(onboarding)/layout.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/layout.tsx
@@ -1,11 +1,9 @@
import Toolbar from "@/ui/layout/toolbar/toolbar";
-import { NewBackground } from "@/ui/shared/new-background";
import { PropsWithChildren } from "react";
export default function Layout({ children }: PropsWithChildren) {
return (
<>
- <NewBackground />
{children}
<Toolbar show={["help"]} />
</>
diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/layout.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/layout.tsx
index c08bf51353..35026b0340 100644
--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/layout.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/layout.tsx
@@ -1,20 +1,61 @@
-import { Wordmark } from "@dub/ui";
+import { Grid, Wordmark } from "@dub/ui";
+import { cn } from "@dub/utils";
import Link from "next/link";
import { PropsWithChildren } from "react";
export default function Layout({ children }: PropsWithChildren) {
return (
<>
- <div className="relative flex flex-col items-center">
- {/* <div className="absolute right-0 top-0">
- <ExitButton />
- </div> */}
- <Link href="https://dub.co/home" target="_blank">
- <Wordmark className="mt-6 h-8" />
- </Link>
- <div className="mt-8 flex w-full flex-col items-center px-3 pb-16 md:mt-20 lg:px-8">
- {children}
+ <div className="absolute inset-0 isolate overflow-hidden bg-white">
+ {/* Grid */}
+ <div
+ className={cn(
+ "absolute inset-y-0 left-1/2 w-[1200px] -translate-x-1/2",
+ "[mask-composite:intersect] [mask-image:linear-gradient(black,transparent_320px),linear-gradient(90deg,transparent,black_5%,black_95%,transparent)]",
+ )}
+ >
+ <Grid
+ cellSize={60}
+ patternOffset={[0.75, 0]}
+ className="text-neutral-200"
+ />
</div>
+
+ {/* Gradient */}
+ {[...Array(2)].map((_, idx) => (
+ <div
+ key={idx}
+ className={cn(
+ "absolute left-1/2 top-6 size-[80px] -translate-x-1/2 -translate-y-1/2 scale-x-[1.6]",
+ idx === 0 ? "mix-blend-overlay" : "opacity-10",
+ )}
+ >
+ {[...Array(idx === 0 ? 2 : 1)].map((_, idx) => (
+ <div
+ key={idx}
+ className={cn(
+ "absolute -inset-16 mix-blend-overlay blur-[50px] saturate-[2]",
+ "bg-[conic-gradient(from_90deg,#F00_5deg,#EAB308_63deg,#5CFF80_115deg,#1E00FF_170deg,#855AFC_220deg,#3A8BFD_286deg,#F00_360deg)]",
+ )}
+ />
+ ))}
+ </div>
+ ))}
+ </div>
+
+ <div className="relative flex min-h-screen w-full flex-col items-center justify-between">
+ <div className="grow basis-0">
+ <div className="pt-4">
+ <Link href="https://dub.co/home" target="_blank" className="block">
+ <Wordmark className="h-8" />
+ </Link>
+ </div>
+ </div>
+
+ <div className="py-16">{children}</div>
+
+ {/* Empty div to center main content */}
+ <div className="grow basis-0" />
</div>
</>
);
diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/welcome/page.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/welcome/page.tsx
index cf2341e731..2b1ef3ce73 100644
--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/welcome/page.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/welcome/page.tsx
@@ -1,4 +1,6 @@
+import { NewBackground } from "@/ui/shared/new-background";
import { Wordmark } from "@dub/ui";
+import { cn } from "@dub/utils/src";
import { NextButton } from "../next-button";
import TrackSignup from "./track-signup";
@@ -6,32 +8,45 @@ export default function Welcome() {
return (
<>
<TrackSignup />
- <div className="relative mx-auto mt-24 flex max-w-sm flex-col items-center px-3 text-center md:mt-32 md:px-8 lg:mt-48">
- <div className="animate-slide-up-fade relative flex w-auto items-center justify-center px-6 py-2 [--offset:20px] [animation-duration:1.3s] [animation-fill-mode:both]">
- <div className="absolute inset-0 opacity-10">
- {[...Array(3)].map((_, i) => (
- <div
- key={i}
- className="animate-pulse-scale absolute inset-0 rounded-full mix-blend-color-burn"
- style={{
- animationDelay: `${i * -2}s`,
- backgroundImage: `linear-gradient(90deg, #000, transparent, #000)`,
- }}
- />
- ))}
+ <NewBackground showAnimation showGradient={false} />
+ <div className="relative flex min-h-screen flex-col items-center justify-center">
+ <div className="flex max-w-sm flex-col items-center px-4 py-16 text-center">
+ <div className="animate-slide-up-fade relative flex w-auto items-center justify-center px-6 py-2 [--offset:20px] [animation-duration:1.3s] [animation-fill-mode:both]">
+ <Gradient className="opacity-10 mix-blend-overlay" />
+ <Wordmark className="relative h-24 sm:h-36" />
+ <Gradient className="opacity-50 mix-blend-hard-light" />
+ </div>
+ <h1 className="animate-slide-up-fade mt-14 text-xl font-semibold text-neutral-900 [--offset:10px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
+ Welcome to Dub
+ </h1>
+ <p className="animate-slide-up-fade mt-2 text-balance text-base text-neutral-500 [--offset:10px] [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
+ Dub gives you the superpowers to connect marketing and revenue.
+ </p>
+ <div className="animate-slide-up-fade mt-8 w-full [--offset:10px] [animation-delay:750ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <NextButton text="Get started" step="workspace" />
</div>
- <Wordmark className="relative h-16" />
- </div>
- <h1 className="animate-slide-up-fade mt-10 text-2xl font-medium [--offset:10px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
- Welcome to Dub
- </h1>
- <p className="animate-slide-up-fade mt-2 text-neutral-500 [--offset:10px] [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
- Dub gives you marketing superpowers with short links that stand out.
- </p>
- <div className="animate-slide-up-fade mt-10 w-full [--offset:10px] [animation-delay:750ms] [animation-duration:1s] [animation-fill-mode:both]">
- <NextButton text="Get started" step="workspace" />
</div>
</div>
</>
);
}
+
+function Gradient({ className }: { className?: string }) {
+ return (
+ <div
+ className={cn(
+ "absolute inset-y-0 left-1/2 aspect-square -translate-x-1/2",
+ className,
+ )}
+ >
+ <div className="size-full -scale-x-[1.8] blur-[40px]">
+ <div
+ className={cn(
+ "size-full -rotate-90 saturate-[3]",
+ "bg-[conic-gradient(from_279deg,#EAB308_47deg,#F00_121deg,#00FFF9_190deg,#855AFC_251deg,#3A8BFD_267deg,#A3ECB3_314deg,#EAB308_360deg)]",
+ )}
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/ui/shared/new-background.tsx b/apps/web/ui/shared/new-background.tsx
index 26826e2573..41b71d1a14 100644
--- a/apps/web/ui/shared/new-background.tsx
+++ b/apps/web/ui/shared/new-background.tsx
@@ -2,18 +2,19 @@
import { cn } from "@dub/utils";
import Image from "next/image";
-import { usePathname } from "next/navigation";
import { useState } from "react";
-export function NewBackground(props: { showAnimation?: boolean }) {
- const pathname = usePathname();
+export function NewBackground({
+ showAnimation = false,
+ showGradient = true,
+}: {
+ showGradient?: boolean;
+ showAnimation?: boolean;
+}) {
const [isGridLoaded, setIsGridLoaded] = useState(false);
const [isBackgroundLoaded, setIsBackgroundLoaded] = useState(false);
const isLoaded = isGridLoaded && isBackgroundLoaded;
- const showAnimation =
- props.showAnimation || pathname === "/onboarding/welcome";
-
return (
<div
className={cn(
@@ -21,8 +22,13 @@ export function NewBackground(props: { showAnimation?: boolean }) {
showAnimation ? (isLoaded ? "opacity-100" : "opacity-0") : "opacity-60",
)}
>
- <BackgroundGradient className="opacity-15" />
- <div className="absolute left-1/2 top-0 -translate-x-1/2 opacity-50 transition-all sm:opacity-100">
+ {showGradient && <BackgroundGradient className="opacity-15" />}
+ <div
+ className={cn(
+ "absolute left-1/2 top-[57%] -translate-x-1/2 -translate-y-1/2 opacity-50 transition-all sm:opacity-100",
+ "[mask-composite:intersect] [mask-image:linear-gradient(transparent,black_5%,black_95%,transparent),linear-gradient(90deg,transparent,black_5%,black_95%,transparent)]",
+ )}
+ >
<Image
src="https://assets.dub.co/misc/welcome-background-grid.svg"
onLoad={() => setIsGridLoaded(true)}
@@ -39,11 +45,14 @@ export function NewBackground(props: { showAnimation?: boolean }) {
height={1046}
className={cn(
"relative min-w-[1000px] max-w-screen-2xl transition-opacity duration-300",
+ "[mask-composite:intersect] [mask-image:radial-gradient(black,transparent)]",
showAnimation ? "opacity-100" : "opacity-0",
)}
/>
</div>
- <BackgroundGradient className="opacity-100 mix-blend-soft-light" />
+ {showGradient && (
+ <BackgroundGradient className="opacity-100 mix-blend-soft-light" />
+ )}
</div>
);
}