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.

Add entrance animations

Tim Wilsond8e3c2f44076
diff --git a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx
index d51abc6213..88f2193b49 100644
--- a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx
+++ b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/header.tsx
@@ -19,7 +19,7 @@ export function Header({
showApply?: boolean;
}) {
const router = useRouter();
- const { data: session } = useSession();
+ const { data: session, status } = useSession();
const scrolled = useScroll(0);
@@ -37,7 +37,7 @@ export function Header({
)}
/>
- <Link href={`/apply/${slug}`} className="my-0.5 block">
+ <Link href={`/apply/${slug}`} className="animate-fade-in my-0.5 block">
{program.wordmark || program.logo ? (
<img
className="h-7 max-w-32"
@@ -49,12 +49,12 @@ export function Header({
</Link>
<div className="flex items-center gap-2">
- {showLogin && !session?.user && (
+ {showLogin && !session?.user && status !== "loading" && (
<Button
type="button"
variant="outline"
text="Log in"
- className="text-neutral-600"
+ className="animate-fade-in h-8 w-fit text-neutral-600"
onClick={() => router.push(`/login?next=/apply/${slug}`)}
/>
)}
@@ -62,7 +62,7 @@ export function Header({
<Button
type="button"
text="Apply"
- className="h-8 w-fit border-[var(--brand)] bg-[var(--brand)] hover:bg-[var(--brand)] hover:ring-[var(--brand-ring)]"
+ className="animate-fade-in h-8 w-fit border-[var(--brand)] bg-[var(--brand)] hover:bg-[var(--brand)] hover:ring-[var(--brand-ring)]"
onClick={() => router.push(`/apply/${slug}/application`)}
/>
)}
diff --git a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/page.tsx b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/page.tsx
index 2d42dac832..36f683c75a 100644
--- a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/page.tsx
+++ b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/page.tsx
@@ -7,6 +7,7 @@ import { AccordionBlock } from "@/ui/partners/lander-blocks/AccordionBlock";
import { FilesBlock } from "@/ui/partners/lander-blocks/FilesBlock";
import { ImageBlock } from "@/ui/partners/lander-blocks/ImageBlock";
import { TextBlock } from "@/ui/partners/lander-blocks/TextBlock";
+import { cn } from "@dub/utils";
import { notFound } from "next/navigation";
import { CSSProperties } from "react";
import { z } from "zod";
@@ -68,13 +69,28 @@ export default async function ApplyPage({
<div className="p-6">
{/* Hero section */}
<div className="grid grid-cols-1 gap-5 sm:pt-20">
- <p className="font-mono text-xs font-medium uppercase text-[var(--brand)]">
+ <span
+ className={cn(
+ "font-mono text-xs font-medium uppercase text-[var(--brand)]",
+ "animate-slide-up-fade [--offset:5px] [animation-duration:1s] [animation-fill-mode:both]",
+ )}
+ >
Affiliate Program
- </p>
- <h1 className="text-4xl font-semibold">
+ </span>
+ <h1
+ className={cn(
+ "text-4xl font-semibold",
+ "animate-slide-up-fade [--offset:5px] [animation-delay:100ms] [animation-duration:1s] [animation-fill-mode:both]",
+ )}
+ >
Join the {program.name} affiliate program
</h1>
- <p className="text-base text-neutral-700">
+ <p
+ className={cn(
+ "text-base text-neutral-700",
+ "animate-slide-up-fade [--offset:5px] [animation-delay:200ms] [animation-duration:1s] [animation-fill-mode:both]",
+ )}
+ >
Share {program.name} with your audience and for each subscription
generated through your referral, you'll earn a share of the revenue
on any plans they purchase.
@@ -92,10 +108,13 @@ export default async function ApplyPage({
</div>
{/* Program details grid */}
- <DetailsGrid program={program} className="mt-10" />
+ <DetailsGrid
+ program={program}
+ className="animate-slide-up-fade mt-10 [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]"
+ />
{/* Buttons */}
- <div className="mt-10 flex flex-col gap-2">
+ <div className="animate-scale-in-fade mt-10 flex flex-col gap-2 [animation-delay:400ms] [animation-fill-mode:both]">
<ApplyButton programSlug={programSlug} />
{/* <Button type="button" variant="secondary" text="Learn more" /> */}
</div>
diff --git a/packages/tailwind-config/tailwind.config.ts b/packages/tailwind-config/tailwind.config.ts
index 24d2a9059f..4317a3c746 100644
--- a/packages/tailwind-config/tailwind.config.ts
+++ b/packages/tailwind-config/tailwind.config.ts
@@ -44,6 +44,7 @@ const config: Config = {
// Modal
"scale-in": "scale-in 0.2s cubic-bezier(0.16, 1, 0.3, 1)",
"fade-in": "fade-in 0.2s ease-out forwards",
+ "scale-in-fade": "scale-in-fade 0.2s ease-out forwards",
// Popover, Tooltip
"slide-up-fade": "slide-up-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
"slide-right-fade":
@@ -82,6 +83,10 @@ const config: Config = {
"0%": { opacity: "0" },
"100%": { opacity: "1" },
},
+ "scale-in-fade": {
+ "0%": { transform: "scale(0.95)", opacity: "0" },
+ "100%": { transform: "scale(1)", opacity: "1" },
+ },
// Popover, Tooltip
"slide-up-fade": {
"0%": { opacity: "0", transform: "translateY(var(--offset, 2px))" },