Skip to content

Commit 77f78a1

Browse files
committed
More course page crap
1 parent f421621 commit 77f78a1

File tree

4 files changed

+86
-36
lines changed

4 files changed

+86
-36
lines changed

src/app/course/call-to-action.tsx

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import { Dialog, DialogBackdrop, DialogPanel } from "@headlessui/react";
77

88
export function SignUpForm() {
99
return (
10-
<div className="flex">
10+
<form className="flex" method="POST" action="https://app.kit.com/forms/7712177/subscriptions">
1111
<div className="flex items-center rounded-full bg-white">
1212
<input
1313
autoFocus
1414
type="email"
1515
id="email"
16+
name="email_address"
1617
className="w-3xs rounded-full bg-transparent px-4 py-2 text-sm/6 text-gray-950 focus:outline-none"
1718
placeholder="Enter your email"
1819
aria-label="Email address"
@@ -21,12 +22,12 @@ export function SignUpForm() {
2122
Sign up
2223
</button>
2324
</div>
24-
</div>
25+
</form>
2526
);
2627
}
2728

2829
export function HeroActions() {
29-
let [signUpState, setSignUpState] = useState<"closed" | "open" | "subscribed">("closed");
30+
let [signUpState, setSignUpState] = useState<"closed" | "open">("closed");
3031
let input = useRef<HTMLInputElement>(null);
3132
let getCourseButton = useRef(null);
3233
let containerRef = useRef<HTMLInputElement>(null);
@@ -48,7 +49,7 @@ export function HeroActions() {
4849
ref={containerRef}
4950
layout
5051
transition={{ duration: signUpState === "open" ? 0.1 : 0.2, ease: "circOut" }}
51-
className="relative flex items-center bg-white data-[state=open]:overflow-hidden data-[state=subscribed]:bg-gray-950"
52+
className="relative flex items-center bg-white data-[state=open]:overflow-hidden"
5253
style={{ borderRadius: 20 }}
5354
data-state={signUpState}
5455
>
@@ -124,33 +125,6 @@ export function HeroActions() {
124125
Get the free course &rarr;
125126
</motion.button>
126127
)}
127-
{signUpState === "subscribed" && (
128-
<motion.button
129-
onClick={() => setSignUpState("closed")}
130-
layout
131-
transition={{ duration: 0.3 }}
132-
className="inline-flex flex-nowrap items-baseline gap-1.5 self-center rounded-full bg-white/25 px-4 py-2 pl-3 text-sm/6 font-semibold whitespace-nowrap text-white hover:bg-white/30"
133-
initial={{
134-
opacity: 0,
135-
}}
136-
animate={{
137-
opacity: 1,
138-
}}
139-
exit={{
140-
opacity: 0,
141-
}}
142-
>
143-
<svg width={20} height={20} fill="none" className="self-center stroke-white">
144-
<path d="M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
145-
<path
146-
d="M13.91 9.67a.37.37 0 0 1 0 .66l-5.6 3.11a.38.38 0 0 1-.56-.33V6.9c0-.29.3-.47.56-.33l5.6 3.11Z"
147-
strokeLinecap="round"
148-
strokeLinejoin="round"
149-
/>
150-
</svg>
151-
You're in
152-
</motion.button>
153-
)}
154128
</AnimatePresence>
155129
</motion.div>
156130
</div>
@@ -186,8 +160,8 @@ export function HeroActions() {
186160
<Dialog open={isDialogOpen} onClose={() => setIsDialogOpen(false)}>
187161
<DialogBackdrop className="fixed inset-0 bg-black/85" />
188162
<div className="fixed inset-0 grid place-items-center">
189-
<DialogPanel>
190-
<video controls className="rounded-2xl">
163+
<DialogPanel className="max-w-7xl p-8">
164+
<video autoPlay controls className="aspect-video rounded-2xl">
191165
<source src="https://assets.tailwindcss.com/build-uis-that-dont-suck/intro.mp4" type="video/mp4" />
192166
</video>
193167
</DialogPanel>

src/app/course/confirmed/page.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import BaseContainer from "@/components/grid-container";
2+
import { Logo } from "@/components/logo";
3+
4+
function GridContainer({ children }: { children: React.ReactNode }) {
5+
return (
6+
<BaseContainer>
7+
<div className="px-0 py-2 sm:px-2">{children}</div>
8+
</BaseContainer>
9+
);
10+
}
11+
12+
export default async function Course() {
13+
return (
14+
<div className="dark relative grid min-h-dvh grid-cols-1 place-items-center px-4 py-8 sm:px-0">
15+
<div>
16+
<GridContainer>
17+
<div className="flex justify-center p-2">
18+
<Logo className="h-7" />
19+
</div>
20+
</GridContainer>
21+
<div className="mt-6 space-y-4">
22+
<GridContainer>
23+
<h1 className="text-center text-5xl tracking-tighter text-balance text-white lg:text-8xl">You’re in!</h1>
24+
</GridContainer>
25+
<GridContainer>
26+
<p className="mx-auto max-w-xl text-center text-lg/7 font-medium text-pretty text-gray-400">
27+
Look for the first video in your inbox any minute, and check again every morning for the next one in the
28+
series.
29+
</p>
30+
</GridContainer>
31+
</div>
32+
</div>
33+
</div>
34+
);
35+
}

src/app/course/page.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ export default async function Course() {
1414
return (
1515
<div className="dark relative px-4 py-8 sm:px-0">
1616
<div>
17-
<div className="absolute inset-x-0 top-0 -z-10 aspect-video opacity-75">
17+
<div className="absolute inset-x-0 top-0 left-1/5 -z-10 aspect-video opacity-50">
1818
<video autoPlay loop muted playsInline className="absolute size-full object-right">
19-
<source src="https://assets.tailwindcss.com/course-demos/background-video.mp4" type="video/mp4" />
19+
<source
20+
src="https://assets.tailwindcss.com/build-uis-that-dont-suck/background-loop.mp4"
21+
type="video/mp4"
22+
/>
2023
Your browser does not support the video tag.
2124
</video>
22-
<div className="absolute inset-0 size-full bg-linear-to-r from-gray-950 from-30%"></div>
25+
<div className="absolute inset-0 size-full bg-linear-to-r from-gray-950 to-75%"></div>
2326
<div className="absolute inset-0 size-full bg-linear-to-t from-gray-950 to-50%"></div>
2427
</div>
2528
<GridContainer>

src/app/course/subscribed/page.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import BaseContainer from "@/components/grid-container";
2+
import { Logo } from "@/components/logo";
3+
4+
function GridContainer({ children }: { children: React.ReactNode }) {
5+
return (
6+
<BaseContainer>
7+
<div className="px-0 py-2 sm:px-2">{children}</div>
8+
</BaseContainer>
9+
);
10+
}
11+
12+
export default async function Course() {
13+
return (
14+
<div className="dark relative grid min-h-dvh grid-cols-1 place-items-center px-4 py-8 sm:px-0">
15+
<div>
16+
<GridContainer>
17+
<div className="flex justify-center p-2">
18+
<Logo className="h-7" />
19+
</div>
20+
</GridContainer>
21+
<div className="mt-6 space-y-4">
22+
<GridContainer>
23+
<h1 className="text-center text-5xl tracking-tighter text-balance text-white lg:text-8xl">
24+
Check your email.
25+
</h1>
26+
</GridContainer>
27+
<GridContainer>
28+
<p className="mx-auto max-w-xl text-center text-lg/7 font-medium text-pretty text-gray-400">
29+
You should get a confirmation email any minute —{" "}
30+
<strong className="font-medium text-white">open it up</strong> and{" "}
31+
<strong className="font-medium text-white">confirm your email</strong> and I'll send you the first video.
32+
</p>
33+
</GridContainer>
34+
</div>
35+
</div>
36+
</div>
37+
);
38+
}

0 commit comments

Comments
 (0)