diff --git a/src/app/[locale]/timeline/page.tsx b/src/app/[locale]/timeline/page.tsx index b9b348c..4108adb 100644 --- a/src/app/[locale]/timeline/page.tsx +++ b/src/app/[locale]/timeline/page.tsx @@ -1,5 +1,6 @@ import { getAIEvents } from '@/hooks/useAIEvents'; import { Metadata } from 'next'; +import { getTranslations } from 'next-intl/server'; export const revalidate = 3600; @@ -9,16 +10,23 @@ export async function generateMetadata({ params: Promise<{ locale: string }>; }): Promise { const { locale } = await params; + const t = await getTranslations('timeline'); return { - title: locale === 'zh' ? 'AI 发展时间轴' : 'AI Timeline', - description: locale === 'zh' - ? '探索人工智能大语言模型的发展历程' - : 'Explore the evolution of AI large language models', + title: t('metaTitle'), + description: t('metaDescription'), }; } -export default async function TimelinePage() { +export default async function TimelinePage({ + params, +}: { + params: Promise<{ locale: string }>; +}) { + const { locale } = await params; + const t = await getTranslations('timeline'); + const tCommon = await getTranslations('common'); + const events = await getAIEvents(); // 按年份分组 @@ -41,10 +49,10 @@ export default async function TimelinePage() {

- 暂无数据 + {t('emptyData')}

- 时间轴数据正在收集中... + {t('collecting')}

@@ -75,11 +83,11 @@ export default async function TimelinePage() { />

- THE STORY
OF A.I. + {t('title')}

- Pinned. Stacked. Zigzagged. + {t('subtitle')}

@@ -132,7 +140,7 @@ export default async function TimelinePage() { } pt-20`} >
- {eventsByYear[year].map((event, eventIndex) => ( + {eventsByYear[year]?.map((event, eventIndex) => (
- {new Date(event.eventDate).toLocaleDateString('zh-CN')} + {new Date(event.eventDate).toLocaleDateString(locale === 'zh' ? 'zh-CN' : 'en-US')}
{/* Source Link */} @@ -174,7 +182,7 @@ export default async function TimelinePage() { rel="noopener noreferrer" className="absolute bottom-4 right-4 text-[10px] font-bold underline" > - 来源 → + {locale === 'zh' ? '来源 →' : 'Source →'} )}
@@ -195,22 +203,22 @@ export default async function TimelinePage() {

- Join the Park + {t('joinThePark')}

- Subscribe to the Agent Park weekly zine. No spam, just ducks and data. + {t('subscribeDesc')}

@@ -220,7 +228,7 @@ export default async function TimelinePage() { type="checkbox" />
diff --git a/src/components/timeline/EventCard.tsx b/src/components/timeline/EventCard.tsx index 29499ba..b813c2e 100644 --- a/src/components/timeline/EventCard.tsx +++ b/src/components/timeline/EventCard.tsx @@ -3,22 +3,32 @@ import { AIEvent } from '@prisma/client'; interface EventCardProps { event: AIEvent; index: number; + baseIndex?: number; } -export function EventCard({ event, index }: EventCardProps) { - const rotation = (Math.random() - 0.5) * 6; - const zIndex = Math.max(1, 50 - index * 10); +export function EventCard({ event, index, baseIndex = 30 }: EventCardProps) { + // Generate consistent rotation based on event ID + const rotation = ((parseInt(event.id.slice(-4), 36) % 14) - 7); // -7 to 7 degrees + const zIndex = Math.max(1, baseIndex - index * 10); return (
- {/* Tape decoration */} -
+ {/* Tape decoration with transparency and blur */} +
{/* Image */}
diff --git a/src/messages/en.json b/src/messages/en.json index 5b3b064..41496a8 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -108,5 +108,19 @@ "loadFailed": "Failed to load", "retry": "Retry", "hotKeyword": "“{word}” is the hottest keyword this quarter!" + }, + "timeline": { + "metaTitle": "AI Timeline - Agent Park", + "metaDescription": "Explore the evolution of AI large language models from 2017 Transformer to today", + "title": "THE STORY OF A.I.", + "subtitle": "Pinned. Stacked. Zigzagged.", + "emptyData": "No data available", + "collecting": "Timeline data is being collected...", + "joinThePark": "Join the Park", + "subscribeDesc": "Subscribe to the Agent Park weekly zine. No spam, just ducks and data.", + "emailPlaceholder": "Your email here...", + "subscribe": "SUBSCRIBE", + "agreeToBeCool": "I agree to be cool.", + "earlier": "Earlier" } } diff --git a/src/messages/zh.json b/src/messages/zh.json index 8797e6d..7e99e1a 100644 --- a/src/messages/zh.json +++ b/src/messages/zh.json @@ -106,7 +106,20 @@ "subtitle": "从 “大型语言模型” 到 “Agent 工作流”。探索 AI 话语的演变历程。", "loading": "加载中...", "loadFailed": "加载失败", - "retry": "重试", - "hotKeyword": "“{word}” 是本季度最热门词汇!" + "retry": "重试" + }, + "timeline": { + "metaTitle": "AI 发展时间轴 - Agent Park", + "metaDescription": "探索人工智能大语言模型的发展历程,从 2017 年 Transformer 到今天", + "title": "AI 的故事", + "subtitle": "钉住。堆叠。之字形。", + "emptyData": "暂无数据", + "collecting": "时间轴数据正在收集中...", + "joinThePark": "加入 Agent Park", + "subscribeDesc": "订阅 Agent Park 周刊。没有垃圾邮件,只有干货。", + "emailPlaceholder": "您的电子邮箱...", + "subscribe": "订阅", + "agreeToBeCool": "我同意保持礼貌。", + "earlier": "更早" } }