Skip to content

Commit bc342f0

Browse files
feat(site): add discord widget section with community logo
show the create awesome brand mark and official discord embed on the homepage
1 parent e21bbcd commit bc342f0

7 files changed

Lines changed: 119 additions & 14 deletions

File tree

190 KB
Loading

src/app/page.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import Link from 'next/link';
33
import { AnimatedGradient } from '@/components/animated-gradient';
44
import { AnimatedTerminal } from '@/components/animated-terminal';
55
import { AnnouncementBanner } from '@/components/announcement-banner';
6+
import { CommunityLogo } from '@/components/community-logo';
67
import { ContributorsSection } from '@/components/contributors-section';
78
import { CopyButton } from '@/components/copy-button';
8-
import { DiscordIcon } from '@/components/discord-icon';
9+
import { DiscordCommunitySection } from '@/components/discord-community-section';
910
import { EcosystemSection } from '@/components/ecosystem-section';
1011
import { FeaturedTemplate } from '@/components/featured-template';
1112
import { HeroSection } from '@/components/hero-section';
@@ -33,7 +34,7 @@ export default async function Home() {
3334
<div className="flex min-h-screen flex-col">
3435
<main className="flex-1">
3536
<AnnouncementBanner
36-
icon={<DiscordIcon className="h-5 w-5 shrink-0 text-yellow-200" />}
37+
icon={<CommunityLogo size={20} className="shrink-0 rounded" />}
3738
label="NEW"
3839
message={
3940
<>Join Create Awesome on Discord — chat, good first issues, and collaboration across Node / Python / V.</>
@@ -213,6 +214,8 @@ export default async function Home() {
213214

214215
<ContributorsSection />
215216

217+
<DiscordCommunitySection />
218+
216219
<EcosystemSection />
217220

218221
<section className="w-full py-12 md:py-24 lg:py-32 relative overflow-hidden">

src/components/community-logo.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Image from 'next/image';
2+
import { COMMUNITY_LOGO_SRC } from '@/lib/community';
3+
import { cn } from '@/lib/utils';
4+
5+
export function CommunityLogo({
6+
className,
7+
size = 40,
8+
priority = false,
9+
}: {
10+
className?: string;
11+
size?: number;
12+
priority?: boolean;
13+
}) {
14+
return (
15+
<Image
16+
src={COMMUNITY_LOGO_SRC}
17+
alt="Create Awesome community"
18+
width={size}
19+
height={size}
20+
priority={priority}
21+
className={cn('rounded-md object-cover', className)}
22+
/>
23+
);
24+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { ArrowRight, MessagesSquare, Sparkles } from 'lucide-react';
2+
import { AnimatedGradient } from '@/components/animated-gradient';
3+
import { CommunityLogo } from '@/components/community-logo';
4+
import { Button } from '@/components/ui/button';
5+
import { DISCORD_INVITE_URL, DISCORD_WIDGET_SRC } from '@/lib/community';
6+
7+
const highlights = [
8+
{ icon: MessagesSquare, label: 'Chat across Node, Python, and V' },
9+
{ icon: Sparkles, label: 'Good first issues and contributor help' },
10+
];
11+
12+
export function DiscordCommunitySection() {
13+
return (
14+
<section className="w-full py-12 md:py-20 lg:py-28 relative overflow-hidden bg-gradient-to-br from-slate-950 via-slate-900 to-indigo-950/70">
15+
<div className="absolute inset-0 z-0 opacity-35">
16+
<AnimatedGradient />
17+
</div>
18+
<div className="absolute inset-0 bg-grid-white/5 bg-[size:30px_30px] [mask-image:radial-gradient(white,transparent_80%)] z-0" />
19+
20+
<div className="container px-4 md:px-6 relative z-10">
21+
<div className="grid gap-10 lg:grid-cols-2 lg:gap-16 items-center">
22+
<div className="space-y-6">
23+
<CommunityLogo size={88} className="rounded-2xl border border-white/10 shadow-lg shadow-teal-900/30" />
24+
25+
<div className="inline-flex items-center gap-2 rounded-full border border-teal-400/30 bg-teal-500/10 px-4 py-1.5 text-sm font-medium text-teal-100 backdrop-blur-sm">
26+
<span>Community</span>
27+
</div>
28+
29+
<div className="space-y-3">
30+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl md:text-5xl bg-clip-text text-transparent bg-gradient-to-r from-teal-300 to-amber-300 leading-tight">
31+
Hang out on Discord
32+
</h2>
33+
<p className="text-lg text-slate-300 max-w-lg">
34+
Join Create Awesome for live chat, good first issues, and collaboration across the Node, Python, and V
35+
ecosystems.
36+
</p>
37+
</div>
38+
39+
<ul className="space-y-2">
40+
{highlights.map(({ icon: Icon, label }) => (
41+
<li key={label} className="flex items-center gap-2 text-sm text-slate-200">
42+
<Icon className="h-4 w-4 shrink-0 text-amber-400" aria-hidden />
43+
<span>{label}</span>
44+
</li>
45+
))}
46+
</ul>
47+
48+
<div className="pt-2">
49+
<Button
50+
size="lg"
51+
className="bg-gradient-to-r from-teal-500 to-amber-500 hover:from-teal-400 hover:to-amber-400 text-slate-950 font-semibold shadow-lg shadow-teal-900/40 transition-all duration-300"
52+
asChild
53+
>
54+
<a href={DISCORD_INVITE_URL} target="_blank" rel="noreferrer">
55+
Join Discord
56+
<ArrowRight className="ml-2 h-4 w-4" />
57+
</a>
58+
</Button>
59+
</div>
60+
</div>
61+
62+
<div className="flex items-center justify-center lg:justify-end">
63+
<div className="rounded-xl border border-white/10 bg-slate-950/60 p-2 shadow-2xl shadow-indigo-950/40 backdrop-blur-sm">
64+
<iframe
65+
src={DISCORD_WIDGET_SRC}
66+
width={350}
67+
height={500}
68+
allowTransparency
69+
frameBorder={0}
70+
sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
71+
title="Create Awesome Discord server widget"
72+
className="max-w-full rounded-lg bg-slate-950"
73+
/>
74+
</div>
75+
</div>
76+
</div>
77+
</div>
78+
</section>
79+
);
80+
}

src/components/discord-icon.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/site-header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Gauge, Github, Menu, Package, Search } from 'lucide-react';
44
import Link from 'next/link';
55
import { usePathname } from 'next/navigation';
66
import { useEffect, useState } from 'react';
7-
import { DiscordIcon } from '@/components/discord-icon';
7+
import { CommunityLogo } from '@/components/community-logo';
88
import { usePerformanceMode } from '@/components/performance-provider';
99
import { ThemeToggle } from '@/components/theme-toggle';
1010
import { Button } from '@/components/ui/button';
@@ -143,7 +143,7 @@ export function SiteHeader({ onOpenCommand }: { onOpenCommand?: () => void }) {
143143
</Link>
144144
<Link href={DISCORD_INVITE_URL} target="_blank" rel="noreferrer" aria-label="Discord Community">
145145
<Button variant="ghost" size="icon" className="hidden sm:inline-flex">
146-
<DiscordIcon className="h-5 w-5" />
146+
<CommunityLogo size={20} className="rounded" />
147147
</Button>
148148
</Link>
149149
<Link href="https://github.com/Create-Python-App" target="_blank" aria-label="GitHub">

src/lib/community.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
/** Canonical Create Awesome Discord invite (shared across CNA / CPA / CVA). */
22
export const DISCORD_INVITE_URL = 'https://discord.gg/bR5VyATgka';
3+
4+
/** Discord server snowflake — used by the official embed widget. */
5+
export const DISCORD_SERVER_ID = '1527933660764831825';
6+
7+
export const DISCORD_WIDGET_SRC = `https://discord.com/widget?id=${DISCORD_SERVER_ID}&theme=dark`;
8+
9+
/** Community brand mark (Create Awesome CA logo). */
10+
export const COMMUNITY_LOGO_SRC = '/community/create-awesome-community-logo.png';

0 commit comments

Comments
 (0)