diff --git a/app/api/og/route.tsx b/app/api/og/route.tsx new file mode 100644 index 0000000..25eb80b --- /dev/null +++ b/app/api/og/route.tsx @@ -0,0 +1,49 @@ +import { ImageResponse } from 'next/og' +import { appConfig } from '../../config/app' + +export const runtime = 'edge' + +export async function GET(request: Request) { + const url = new URL(request.url) + const baseUrl = `${url.protocol}//${url.host}` + + return new ImageResponse( + ( +
+ {appConfig.name} +
{appConfig.name}
+
+ {appConfig.description} +
+
+ ), + { + width: appConfig.assets.ogImage.width, + height: appConfig.assets.ogImage.height, + }, + ) +} \ No newline at end of file diff --git a/app/components/SpeechBubble.tsx b/app/components/SpeechBubble.tsx index c07ba1d..2cfcf40 100644 --- a/app/components/SpeechBubble.tsx +++ b/app/components/SpeechBubble.tsx @@ -10,7 +10,7 @@ interface SpeechBubbleProps { triggerCount: number; } -export function SpeechBubble({ isShaken, triggerCount }: SpeechBubbleProps) { +export function SpeechBubble({ triggerCount }: SpeechBubbleProps) { const [message, setMessage] = useState(''); const [isVisible, setIsVisible] = useState(false); const [messageQueue, setMessageQueue] = useState([]); diff --git a/app/config/app.ts b/app/config/app.ts new file mode 100644 index 0000000..c08738d --- /dev/null +++ b/app/config/app.ts @@ -0,0 +1,14 @@ +export const appConfig = { + name: 'Shake the Frog', + description: 'A fun interactive frog that reacts to shaking!', + url: 'https://shakethefrog.vercel.app', + assets: { + favicon: '/images/frog.svg', + ogImage: { + width: 1200, + height: 630, + bgColor: '#f0fdf4', + textColor: '#374151' + } + } +} as const \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index c94be82..402c536 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,15 +1,36 @@ import type { Metadata } from 'next' import { Inter } from 'next/font/google' import { ThemeProvider } from './providers/ThemeProvider' +import { appConfig } from './config/app' import './globals.css' const inter = Inter({ subsets: ['latin'] }) export const metadata: Metadata = { - title: 'Shake the Frog', - description: 'A fun interactive frog that reacts to shaking!', + title: appConfig.name, + description: appConfig.description, icons: { - icon: '/images/frog.svg' + icon: appConfig.assets.favicon + }, + openGraph: { + title: appConfig.name, + description: appConfig.description, + url: appConfig.url, + siteName: appConfig.name, + images: [{ + url: '/api/og', + width: appConfig.assets.ogImage.width, + height: appConfig.assets.ogImage.height, + alt: `${appConfig.name} preview` + }], + locale: 'en_US', + type: 'website', + }, + twitter: { + card: 'summary_large_image', + title: appConfig.name, + description: appConfig.description, + images: ['/api/og'] } }