Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

Commit 809faef

Browse files
committed
...
1 parent ae144ba commit 809faef

File tree

1 file changed

+98
-48
lines changed

1 file changed

+98
-48
lines changed

encorpora-edu/components/Hero.tsx

Lines changed: 98 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,106 @@
11
// app/components/Hero.tsx
22
"use client";
33

4-
import { FC } from "react";
4+
import { FC, useState, useRef, useEffect } from "react";
55
import Link from "next/link";
66
import { Button } from "@/components/ui/button";
77
import { motion } from "framer-motion";
8+
import { FaApple, FaGooglePlay } from "react-icons/fa";
89

9-
export const Hero: FC = () => (
10-
<motion.section
11-
className="min-h-screen bg-white flex flex-col items-center justify-center text-center px-6"
12-
initial={{ opacity: 0 }}
13-
animate={{ opacity: 1 }} // typo fixed here
14-
transition={{ duration: 1, ease: "easeOut" }}
15-
>
16-
<motion.h1
17-
className="text-6xl font-extrabold text-gray-900 leading-tight max-w-3xl"
18-
initial={{ opacity: 0, y: -30 }}
19-
animate={{ opacity: 1, y: 0 }}
20-
transition={{ duration: 1.2, ease: "easeOut" }}
21-
>
22-
Pure. Clean. Private.
23-
</motion.h1>
24-
25-
<motion.p
26-
className="mt-4 text-2xl text-gray-700 max-w-2xl"
27-
initial={{ opacity: 0, scale: 0.9 }}
28-
animate={{ opacity: 1, scale: 1 }}
29-
transition={{ duration: 1, ease: "easeOut", delay: 0.5 }}
30-
>
31-
Educational Books and Apps
32-
</motion.p>
33-
34-
<motion.p
35-
className="mt-4 text-xl text-gray-600 max-w-2xl"
36-
initial={{ opacity: 0, scale: 0.9 }}
37-
animate={{ opacity: 1, scale: 1 }}
38-
transition={{ duration: 1, ease: "easeOut", delay: 0.7 }}
10+
export const Hero: FC = () => {
11+
const [appsOpen, setAppsOpen] = useState(false);
12+
const chooserRef = useRef<HTMLDivElement>(null);
13+
14+
// Close pop-up if clicking outside
15+
useEffect(() => {
16+
function onClick(e: MouseEvent) {
17+
if (chooserRef.current && !chooserRef.current.contains(e.target as Node)) {
18+
setAppsOpen(false);
19+
}
20+
}
21+
document.addEventListener("mousedown", onClick);
22+
return () => document.removeEventListener("mousedown", onClick);
23+
}, []);
24+
25+
return (
26+
<motion.section
27+
className="min-h-screen bg-white flex flex-col items-center justify-center text-center px-6"
28+
initial={{ opacity: 0 }}
29+
animate={{ opacity: 1 }}
30+
transition={{ duration: 1, ease: "easeOut" }}
3931
>
40-
No tracking. No ads. No wasted time.
41-
</motion.p>
42-
43-
<div className="mt-8 flex flex-wrap justify-center gap-4">
44-
{/* Primary CTA */}
45-
<Button size="lg" asChild>
46-
<Link href="https://shop.encorpora.io">Explore Books</Link>
47-
</Button>
48-
49-
{/* Secondary CTA */}
50-
<Button variant="outline" size="lg" asChild>
51-
<Link href="/apps">Expore Apps</Link>
52-
</Button>
53-
54-
</div>
55-
</motion.section>
56-
);
32+
<motion.h1
33+
className="text-6xl font-extrabold text-gray-900 leading-tight max-w-3xl"
34+
initial={{ opacity: 0, y: -30 }}
35+
animate={{ opacity: 1, y: 0 }}
36+
transition={{ duration: 1.2, ease: "easeOut" }}
37+
>
38+
Pure. Clean. Private.
39+
</motion.h1>
40+
41+
<motion.p
42+
className="mt-4 text-2xl text-gray-700 max-w-2xl"
43+
initial={{ opacity: 0, scale: 0.9 }}
44+
animate={{ opacity: 1, scale: 1 }}
45+
transition={{ duration: 1, ease: "easeOut", delay: 0.5 }}
46+
>
47+
Educational Books and Apps
48+
</motion.p>
49+
50+
<motion.p
51+
className="mt-4 text-xl text-gray-600 max-w-2xl"
52+
initial={{ opacity: 0, scale: 0.9 }}
53+
animate={{ opacity: 1, scale: 1 }}
54+
transition={{ duration: 1, ease: "easeOut", delay: 0.7 }}
55+
>
56+
No tracking. No ads. No wasted time.
57+
</motion.p>
58+
59+
<div className="mt-8 flex flex-wrap justify-center gap-4">
60+
{/* Primary CTA */}
61+
<Button size="lg" asChild>
62+
<Link href="https://shop.encorpora.io">Explore Books</Link>
63+
</Button>
64+
65+
{/* Apps chooser */}
66+
<div className="relative" ref={chooserRef}>
67+
<Button
68+
variant="outline"
69+
size="lg"
70+
onClick={() => setAppsOpen((o) => !o)}
71+
>
72+
Explore Apps
73+
</Button>
74+
75+
{appsOpen && (
76+
<motion.div
77+
className="absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg ring-1 ring-gray-200 overflow-hidden z-10"
78+
initial={{ opacity: 0, y: -10 }}
79+
animate={{ opacity: 1, y: 0 }}
80+
transition={{ duration: 0.2 }}
81+
>
82+
<Link
83+
href="https://play.google.com/store/apps/developer?id=Corpora+Inc"
84+
target="_blank"
85+
rel="noopener noreferrer"
86+
className="flex items-center gap-2 px-4 py-3 hover:bg-gray-50"
87+
>
88+
<FaGooglePlay size={20} /> Google Play
89+
</Link>
90+
{/* TODO: get url for publisher
91+
curl https://itunes.apple.com/lookup\?id\=6744656859 */}
92+
<Link
93+
href="https://apps.apple.com/developer/corpora-inc/idYOUR_DEVELOPER_ID"
94+
target="_blank"
95+
rel="noopener noreferrer"
96+
className="flex items-center gap-2 px-4 py-3 hover:bg-gray-50"
97+
>
98+
<FaApple size={20} /> Coming Soon!
99+
</Link>
100+
</motion.div>
101+
)}
102+
</div>
103+
</div>
104+
</motion.section>
105+
);
106+
};

0 commit comments

Comments
 (0)