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.

final touches

Steven Tey794c0d33cade
diff --git a/app/[domain]/page.tsx b/app/[domain]/page.tsx
index 3b80621e22..18d238017d 100644
--- a/app/[domain]/page.tsx
+++ b/app/[domain]/page.tsx
@@ -1,5 +1,6 @@
import prisma from "#/lib/prisma";
import { constructMetadata } from "#/lib/utils";
+import Background from "#/ui/home/background";
import PlaceholderContent from "./placeholder";
export async function generateMetadata({
@@ -38,5 +39,10 @@ export async function generateStaticParams() {
}
export default function CustomDomainPage() {
- return <PlaceholderContent />;
+ return (
+ <>
+ <Background />
+ <PlaceholderContent />
+ </>
+ );
}
diff --git a/app/[domain]/placeholder.tsx b/app/[domain]/placeholder.tsx
index 66dc00e385..ffe9cb8705 100644
--- a/app/[domain]/placeholder.tsx
+++ b/app/[domain]/placeholder.tsx
@@ -1,6 +1,5 @@
"use client";
-import Background from "#/ui/home/background";
import { useState } from "react";
import { motion } from "framer-motion";
import { useDebounce } from "use-debounce";
@@ -22,77 +21,74 @@ export default function PlaceholderContent() {
const [showText] = useDebounce(loading ? false : true, 800);
return (
- <>
- <Background />
+ <motion.div
+ className="z-10 mb-20"
+ exit={{ opacity: 0, scale: 0.95 }}
+ transition={{ duration: 0.5, type: "spring" }}
+ >
+ <div
+ className={`${
+ loading ? "scale-[25%] blur-md" : "scale-100 blur-0"
+ } mt-[7vh] h-[50vh] w-screen object-cover transition-all duration-1000`}
+ >
+ <Spline
+ onLoad={onLoad}
+ style={{ opacity: opacity }}
+ scene="https://prod.spline.design/cJkq6hsiUPNRHeMf/scene.splinecode"
+ />
+ </div>
<motion.div
- className="z-10 mb-20"
- exit={{ opacity: 0, scale: 0.95 }}
- transition={{ duration: 0.5, type: "spring" }}
+ variants={{
+ show: {
+ transition: {
+ staggerChildren: 0.3,
+ },
+ },
+ }}
+ initial="hidden"
+ animate={showText ? "show" : "hidden"}
+ className="mx-5 flex flex-col items-center space-y-10 text-center sm:mx-auto"
>
- <div
- className={`${
- loading ? "scale-[25%] blur-md" : "scale-100 blur-0"
- } mt-[7vh] h-[50vh] w-screen object-cover transition-all duration-1000`}
+ <motion.h1
+ className="font-display text-4xl font-bold text-gray-800 transition-colors sm:text-5xl"
+ variants={STAGGER_CHILD_VARIANTS}
>
- <Spline
- onLoad={onLoad}
- style={{ opacity: opacity }}
- scene="https://prod.spline.design/cJkq6hsiUPNRHeMf/scene.splinecode"
- />
- </div>
- <motion.div
- variants={{
- show: {
- transition: {
- staggerChildren: 0.3,
- },
- },
- }}
- initial="hidden"
- animate={showText ? "show" : "hidden"}
- className="mx-5 flex flex-col items-center space-y-10 text-center sm:mx-auto"
+ Welcome to Dub
+ </motion.h1>
+ <motion.p
+ className="max-w-xl text-gray-600 transition-colors sm:text-lg"
+ variants={STAGGER_CHILD_VARIANTS}
>
- <motion.h1
- className="font-display text-4xl font-bold text-gray-800 transition-colors sm:text-5xl"
- variants={STAGGER_CHILD_VARIANTS}
- >
- Welcome to Dub
- </motion.h1>
- <motion.p
- className="max-w-xl text-gray-600 transition-colors sm:text-lg"
- variants={STAGGER_CHILD_VARIANTS}
- >
- <InlineSnippet>{domain}</InlineSnippet> is a custom domain on{" "}
- <a
- className="bg-gradient-to-r from-purple-400 to-pink-600 bg-clip-text font-semibold text-transparent decoration-rose-600 hover:underline"
- href="https://dub.co"
- onClick={() =>
- va.track("Referred from custom domain", {
- domain,
- medium: "text",
- })
- }
- >
- Dub
- </a>{" "}
- - a link management tool for modern marketing teams to create,
- share, and track short links.
- </motion.p>
- <motion.a
- variants={STAGGER_CHILD_VARIANTS}
+ <InlineSnippet>{domain}</InlineSnippet> is a custom domain on{" "}
+ <a
+ className="bg-gradient-to-r from-purple-400 to-pink-600 bg-clip-text font-semibold text-transparent decoration-rose-600 hover:underline"
href="https://dub.co"
onClick={() =>
va.track("Referred from custom domain", {
domain,
- medium: "button",
+ medium: "text",
})
}
- className="rounded-full bg-gray-800 px-10 py-2 font-medium text-white transition-colors hover:bg-black"
>
- Create Your Free Branded Link
- </motion.a>
- </motion.div>
+ Dub
+ </a>{" "}
+ - a link management tool for modern marketing teams to create, share,
+ and track short links.
+ </motion.p>
+ <motion.a
+ variants={STAGGER_CHILD_VARIANTS}
+ href="https://dub.co"
+ onClick={() =>
+ va.track("Referred from custom domain", {
+ domain,
+ medium: "button",
+ })
+ }
+ className="rounded-full bg-gray-800 px-10 py-2 font-medium text-white transition-colors hover:bg-black"
+ >
+ Create Your Free Branded Link
+ </motion.a>
</motion.div>
- </>
+ </motion.div>
);
}
diff --git a/middleware.ts b/middleware.ts
index 5c38f3f884..b5ad6eeb73 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -51,15 +51,15 @@ export default async function middleware(req: NextRequest, ev: NextFetchEvent) {
return NextResponse.redirect(DEFAULT_REDIRECTS[key]);
}
- // for root pages (e.g. dub.co, vercel.fyi, etc.)
- if (key.length === 0) {
- return RootMiddleware(req, ev);
- }
-
// for Admin
if (ADMIN_HOSTNAMES.has(domain)) {
return AdminMiddleware(req);
}
+ // for root pages (e.g. dub.co, vercel.fyi, etc.)
+ if (key.length === 0) {
+ return RootMiddleware(req, ev);
+ }
+
return LinkMiddleware(req, ev);
}