Skip to content

Commit 46de64f

Browse files
committed
add hero
1 parent a7930b4 commit 46de64f

10 files changed

Lines changed: 415 additions & 307 deletions

File tree

app/(main)/page.tsx

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import AnimatedHero from "@/components/animated-hero";
12
import CarbonAdBanner from "@/components/carbon-ad-banner";
23
import CoverImage from "@/components/cover-image";
34
import type { HomePageQueryResult } from "@/sanity/types";
@@ -18,41 +19,7 @@ export default async function HomePage() {
1819
return (
1920
<div className="flex flex-col min-h-dvh">
2021
<main className="flex-1">
21-
<section className="w-full pb-12 md:py-24 lg:py-32 flex flex-col items-center justify-center">
22-
<div className="container px-4 md:px-6 grid gap-8 md:grid-cols-2 lg:gap-16">
23-
<div className="flex flex-col items-start justify-center space-y-4">
24-
<h1 className="text-4xl font-bold tracking-tighter sm:text-5xl md:text-6xl">
25-
CodingCat.dev Podcast
26-
</h1>
27-
<p className="max-w-[600px] text-muted-foreground md:text-xl/relaxed">
28-
Purrfect Podcast for Web Developers
29-
</p>
30-
<div className="flex flex-col gap-2 min-[400px]:flex-row">
31-
<Link
32-
href="/podcasts"
33-
className="inline-flex items-center justify-center rounded-md border border-transparent bg-primary px-5 py-3 text-base font-medium text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 sm:px-10"
34-
>
35-
Explore Podcasts
36-
</Link>
37-
</div>
38-
</div>
39-
{homePage?.latestPodcast && (
40-
<div className="space-y-4 flex flex-col items-start gap-2">
41-
<div className="inline-block rounded-lg bg-muted px-3 py-1 text-sm">
42-
Latest Podcast
43-
</div>
44-
<div className="w-full">
45-
<CoverMedia
46-
cloudinaryImage={homePage?.latestPodcast?.coverImage}
47-
cloudinaryVideo={homePage?.latestPodcast?.videoCloudinary}
48-
youtube={homePage?.latestPodcast?.youtube}
49-
className="w-full aspect-video"
50-
/>
51-
</div>
52-
</div>
53-
)}
54-
</div>
55-
</section>
22+
<AnimatedHero />
5623
<section className="w-full py-12 md:py-24 lg:py-32 bg-muted flex flex-col items-center justify-center">
5724
<div className="container px-4 md:px-6">
5825
<div className="flex flex-col items-center justify-center space-y-4 text-center">

app/globals.css

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,65 @@
162162
@apply bg-background text-foreground;
163163
}
164164
}
165+
166+
@keyframes float {
167+
0% {
168+
transform: translateY(0px);
169+
}
170+
50% {
171+
transform: translateY(-20px);
172+
}
173+
100% {
174+
transform: translateY(0px);
175+
}
176+
}
177+
178+
@keyframes paw-one {
179+
0% {
180+
transform: translate(0, 0);
181+
}
182+
20% {
183+
transform: translate(-40px, 40px) rotate(-15deg);
184+
}
185+
40% {
186+
transform: translate(-30px, 30px) rotate(-5deg);
187+
}
188+
60% {
189+
transform: translate(-40px, 40px) rotate(-15deg);
190+
}
191+
80% {
192+
transform: translate(-30px, 30px) rotate(-5deg);
193+
}
194+
100% {
195+
transform: translate(0, 0);
196+
}
197+
}
198+
199+
@keyframes paw-two {
200+
0% {
201+
transform: translate(0, 0);
202+
}
203+
20% {
204+
transform: translate(40px, -40px) rotate(15deg);
205+
}
206+
40% {
207+
transform: translate(30px, -30px) rotate(5deg);
208+
}
209+
60% {
210+
transform: translate(40px, -40px) rotate(15deg);
211+
}
212+
80% {
213+
transform: translate(30px, -30px) rotate(5deg);
214+
}
215+
100% {
216+
transform: translate(0, 0);
217+
}
218+
}
219+
220+
.animate-paw-one {
221+
animation: paw-one 8s ease-in-out infinite;
222+
}
223+
224+
.animate-paw-two {
225+
animation: paw-two 8s ease-in-out infinite 2s;
226+
}

components/animated-hero.tsx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
'use client';
2+
3+
import { useState } from 'react';
4+
import { FaReact, FaVuejs, FaAngular, FaNodeJs, FaPython } from 'react-icons/fa';
5+
import { SiSvelte } from 'react-icons/si';
6+
import { SiNextdotjs, SiTypescript, SiJavascript, SiOpenai, SiTensorflow } from 'react-icons/si';
7+
import { RiGeminiFill } from "react-icons/ri";
8+
import AJHeadphones from '@/components/icons/aj-headphones';
9+
import AJPrimary from '@/components/icons/aj-primary-alt';
10+
11+
const icons = [
12+
{ icon: <FaReact />, name: 'React' },
13+
{ icon: <FaVuejs />, name: 'Vue.js' },
14+
{ icon: <FaAngular />, name: 'Angular' },
15+
{ icon: <SiSvelte />, name: 'Svelte' },
16+
{ icon: <FaNodeJs />, name: 'Node.js' },
17+
{ icon: <SiNextdotjs />, name: 'Next.js' },
18+
{ icon: <SiTypescript />, name: 'TypeScript' },
19+
{ icon: <SiJavascript />, name: 'JavaScript' },
20+
{ icon: <FaPython />, name: 'Python' },
21+
{ icon: <SiOpenai />, name: 'OpenAI' },
22+
{ icon: <SiTensorflow />, name: 'TensorFlow' },
23+
{ icon: <RiGeminiFill />, name: 'Gemini' },
24+
];
25+
26+
export default function AnimatedHero() {
27+
const [isHovered, setIsHovered] = useState(false);
28+
29+
return (
30+
<div className="relative w-full h-[500px] overflow-hidden">
31+
<div className="absolute inset-0 grid grid-cols-4 grid-rows-3 gap-4">
32+
{icons.map((item, index) => (
33+
<div
34+
key={item.name}
35+
className="flex items-center justify-center text-6xl text-muted-foreground/20"
36+
style={{
37+
animation: `float 6s ease-in-out infinite`,
38+
animationDelay: `${index * 0.5}s`,
39+
}}
40+
>
41+
{item.icon}
42+
</div>
43+
))}
44+
</div>
45+
<div className="relative z-10 flex flex-col items-center justify-center h-full space-y-4">
46+
<div
47+
className="relative bg-background/80 p-8 rounded-lg"
48+
onMouseEnter={() => setIsHovered(true)}
49+
onMouseLeave={() => setIsHovered(false)}
50+
>
51+
<h1 className="text-4xl font-bold tracking-tighter text-center sm:text-5xl md:text-6xl">
52+
CodingCat.dev Podcast
53+
</h1>
54+
<p className="max-w-[600px] text-center text-muted-foreground md:text-xl/relaxed">
55+
Purrfect Podcast for Web Developers
56+
</p>
57+
<div className="absolute top-0 left-0 w-full h-full overflow-hidden rounded-lg">
58+
<AJHeadphones
59+
cls={`absolute w-24 h-24 -top-12 -right-12 transition-transform duration-500 ${isHovered ? 'translate-x-32 -translate-y-32 rotate-45' : 'animate-paw-one'}`}
60+
/>
61+
<AJPrimary
62+
cls={`absolute w-24 h-24 -bottom-12 -left-12 transition-transform duration-500 ${isHovered ? '-translate-x-32 translate-y-32 -rotate-45' : 'animate-paw-two'}`}
63+
/>
64+
</div>
65+
</div>
66+
</div>
67+
</div>
68+
);
69+
}

components/icons/aj-alt.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export default function AjAlt({ cls = "block w-12 h-12" }) {
2+
return (
3+
<svg className={cls} width="277" height="243" viewBox="0 0 277 243" fill="none" xmlns="http://www.w3.org/2000/svg">
4+
<path d="M207.1 109.635C224.876 88.2515 232.545 74.8477 234.38 43.637L194.852 85.5761L207.1 109.635Z" fill="#824B2E" />
5+
<path d="M201.533 51.6567L234.38 43.637C226.48 60.0926 199.724 89.3887 195.688 86.8908C191.651 84.3928 167.991 56.6525 167.991 56.6525L201.533 51.6567Z" fill="#0A0A0A" />
6+
<path d="M0.278118 118.181C0.835922 49.8366 8.09916 23.8481 34.2382 0.909058C32.9695 54.0027 26.0265 92.2811 26.0265 92.2811C26.0265 92.2811 6.50655 112.969 0.278118 118.181Z" fill="#824B2E" />
7+
<path d="M207.24 110.292L195.827 86.8906L168.965 56.258L164.651 54.1545L160.753 51.5251C160.753 51.5251 159.222 49.4215 160.753 49.4215C162.284 49.4215 163.955 49.9474 163.955 49.9474L168.13 50.9992L172.305 52.3139C172.305 52.3139 173.001 52.5768 173.28 52.3139C173.558 52.051 173.28 50.9992 173.28 50.9992L172.723 50.0789C172.723 50.0789 171.47 49.0272 170.635 48.6327C169.8 48.2383 156.578 43.6369 153.238 42.7165C149.897 41.7962 146.14 41.6647 141.964 41.5333C137.789 41.4019 133.196 41.5333 132.917 41.5333C132.639 41.5333 132.639 41.0074 132.639 41.0074C132.639 41.0074 132.639 40.7445 132.917 40.4815C133.196 40.2186 145.165 40.2186 145.444 40.0871C145.722 39.9557 146.696 39.8242 146.696 39.8242C146.696 39.8242 148.366 39.5612 148.506 39.4298C148.645 39.2983 148.923 38.5095 148.506 37.9836C148.088 37.4577 147.253 37.5892 146.975 37.1948C146.696 36.8003 144.748 36.406 144.748 36.406L116.216 37.1948L105.638 39.4298L92.6942 43.7683L80.0288 49.9474H76.1317L66.5283 45.2145L55.2547 36.0116L45.0945 20.6295C45.0945 20.6295 35.491 0.908923 34.3776 0.777452C33.2641 0.645982 28.9495 8.79715 28.9495 8.79715L23.5215 22.2071L19.9028 46.9236L18.7894 66.7757L17.5367 98.0656L0 117.918V118.706H0.695892L8.90755 111.344L3.75787 130.144L0 148.813L2.7836 151.574L16.8408 160.646V161.303L12.2479 160.251L8.90755 159.725H4.73213C2.7836 159.725 4.73213 163.144 4.73213 163.144C4.73213 163.144 58.7889 216.507 72.6522 224.672C86.5155 232.837 109.096 236.809 132.778 242.552H139.737C149.889 241.571 155.409 240.383 164.929 237.03C183.02 228.35 193.611 221.141 213.085 205.214L223.245 192.461L230.344 181.418C233.434 175.898 233.823 173.661 233.684 173.004C233.545 172.346 231.04 169.586 227.978 164.195L223.245 155.65L207.24 110.292Z" fill="black" />
8+
<path d="M86.2918 174.713C51.4083 180.114 36.1271 190.263 12.5261 214.943C37.3448 190.842 52.8174 180.598 86.5702 175.239L86.2918 174.713Z" fill="white" />
9+
<path d="M95.9474 182.996C67.621 188.397 55.2122 198.545 36.0475 223.226C56.201 199.125 68.7652 188.881 96.1735 183.521L95.9474 182.996Z" fill="white" />
10+
<path d="M97.1382 196.932C78.5162 200.886 70.3585 208.314 57.7595 226.381C71.0086 208.739 79.2684 201.24 97.2868 197.316L97.1382 196.932Z" fill="white" />
11+
<path d="M64.023 129.618C64.023 112.659 86.8486 95.2535 103.411 98.8544C120.948 102.667 131.149 126.552 130.69 138.69C130.736 152.467 121.505 158.593 103.411 159.199C83.7867 159.857 64.023 146.578 64.023 129.618Z" fill="#C9F180" />
12+
<path d="M99.1302 98.587C120.342 101.466 122.373 150.768 105.135 149.849C87.8979 148.929 77.9179 95.7085 99.1302 98.587Z" fill="black" />
13+
<ellipse cx="1.94853" cy="1.84059" rx="1.94853" ry="1.84059" transform="matrix(-1 0 0 1 98.2252 136.354)" fill="white" />
14+
<path d="M179.96 103.719C192.347 103.719 201.812 121.862 199.446 140.662C197.635 150.969 191.217 156.427 179.96 154.861C159.938 149.151 162.097 103.719 179.96 103.719Z" fill="#C9F180" />
15+
<path d="M180.656 103.719C195.966 105.296 199.306 149.733 186.919 149.733C174.532 149.733 165.346 102.141 180.656 103.719Z" fill="black" />
16+
<ellipse cx="1.94853" cy="1.84059" rx="1.94853" ry="1.84059" transform="matrix(-1 0 0 1 182.744 136.323)" fill="white" />
17+
<path d="M202.925 168.797C237.809 174.198 253.09 184.347 276.691 209.027C251.872 184.926 236.399 174.682 202.647 169.323L202.925 168.797Z" fill="white" />
18+
<path d="M193.269 177.079C221.596 182.481 234.004 192.629 253.169 217.309C233.016 193.209 220.451 182.965 193.043 177.605L193.269 177.079Z" fill="white" />
19+
<path d="M192.078 191.015C210.7 194.969 218.858 202.398 231.457 220.465C218.208 202.822 209.948 195.324 191.93 191.4L192.078 191.015Z" fill="white" />
20+
<path opacity="0.07" d="M124.942 192.867C131.787 195.932 140.164 218.976 154.593 218.976C173.963 218.976 183.107 187.423 186.516 184.727C186.172 184.701 185.855 184.674 185.512 184.674C184.085 184.674 182.657 184.912 181.204 184.912C180.913 184.912 180.623 184.912 180.332 184.886C177.108 192.365 159.534 195.589 154.038 195.668C148.779 195.747 134.905 192.919 132.764 188.321C132.368 189.458 126.29 192.814 124.942 192.867Z" fill="#091427" />
21+
<path d="M135.275 204.204C140.507 211.497 147.378 218.315 155.306 218.315C156.416 218.315 157.896 217.919 159.64 217.153C159.376 213.876 159.27 210.255 157.922 207.269C151.369 203.649 138.763 201.323 135.275 204.204Z" fill="#C47499" />
22+
<path d="M157.341 207.56C158.689 210.546 159.349 213.876 159.614 217.153C161.226 216.439 163.049 215.382 164.952 213.981C162.811 211.259 160.221 209.145 157.341 207.56Z" fill="#AD6585" />
23+
<path d="M160.221 195.853C157.817 196.143 155.2 196.249 152.373 196.17C144.709 195.959 137.23 194.294 131.76 189.801C130.545 190.673 129.223 191.413 127.875 192.021C129.672 195.404 132.183 199.87 135.248 204.204C143.969 202.829 153.43 204.283 160.406 209.542C163.736 207.798 164.318 198.02 160.221 195.853Z" fill="#6B3F3C" />
24+
<path d="M160.221 195.853C162.547 199.975 162.441 205.155 160.406 209.542C162.071 210.81 163.578 212.264 164.925 213.955C171.876 208.855 179.962 199.262 183.133 185.124C179.116 189.246 172.113 194.452 160.221 195.853Z" fill="#8D5548" />
25+
<path d="M123.647 193.342C124.704 193.184 125.656 192.761 126.581 192.259C126.818 192.153 127.03 192.021 127.268 191.862C127.506 191.73 127.717 191.598 127.928 191.44C128.378 191.175 128.8 190.858 129.25 190.567C129.461 190.409 129.673 190.25 129.884 190.092L130.492 189.59C130.888 189.246 131.311 188.929 131.734 188.638L133.002 187.74L134.324 186.815L134.429 186.894C134.271 187.449 134.006 187.951 133.663 188.401C133.504 188.638 133.319 188.85 133.134 189.061C132.949 189.273 132.764 189.484 132.553 189.669C132.157 190.039 131.707 190.383 131.232 190.673L130.518 191.096C130.28 191.228 130.042 191.36 129.805 191.492C129.329 191.757 128.853 192.021 128.351 192.232C128.113 192.338 127.849 192.47 127.611 192.549C127.347 192.655 127.109 192.761 126.845 192.84C126.581 192.919 126.343 193.025 126.052 193.104C125.788 193.184 125.524 193.263 125.259 193.316C124.731 193.448 124.176 193.501 123.621 193.474V193.342H123.647Z" fill="#8D5548" />
26+
<path d="M179.064 184.463C179.962 184.542 180.834 184.648 181.706 184.701C182.155 184.727 182.578 184.754 183.001 184.727C183.397 184.701 183.847 184.648 184.27 184.595C185.115 184.489 185.934 184.146 186.78 184.04C187.626 183.908 188.471 183.829 189.396 183.776L189.449 183.882C189.132 184.252 188.736 184.542 188.339 184.78C187.943 185.018 187.494 185.203 187.071 185.335C186.199 185.626 185.247 185.573 184.349 185.599C183.9 185.599 183.45 185.599 182.975 185.546C182.499 185.494 182.076 185.414 181.627 185.309C180.755 185.097 179.909 184.859 179.037 184.595L179.064 184.463Z" fill="#8D5548" />
27+
<path d="M147.668 169.071C151.006 168.954 157.404 172.282 158.924 171.966C160.443 171.649 166.367 166.443 168.113 168.355C169.86 170.267 167.341 173.513 167.341 173.513C161.803 181.469 162.796 180.216 159.361 183.133L156.858 183.221C156.858 183.221 146.833 176.204 145.365 174.282C143.897 172.36 144.33 169.187 147.668 169.071Z" fill="#FFCDCF" />
28+
</svg>
29+
);
30+
}

0 commit comments

Comments
 (0)