style(theme): 更新网站主题色彩方案与字体配置

- 调整主色调从 #1C1C1C 至 #1A1A1A,优化视觉层次
- 更新背景色系为暖白色调 (#FAFAF7, #F5F4F0 等)
- 配置中文字体栈,添加 serif 字体支持
- 优化文本颜色梯度,提升可读性
- 调整边框颜色,统一水墨风格
- 添加 Google Search Console 验证码配置项
- 新增桌面应用架构专家代理配置文件
- 重构 E2E 测试等待策略,提升稳定性
- 添加回归测试脚本,增强质量保障
This commit is contained in:
张翔
2026-06-17 11:37:25 +08:00
parent a3cc4c9d43
commit 415a103a24
50 changed files with 3651 additions and 1186 deletions
@@ -3,38 +3,49 @@
import { StaticLink } from '@/components/ui/static-link';
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
import { PageNav } from '@/components/layout/page-nav';
import { InkCard } from '@/components/ui/ink-wash';
import { Calendar, ArrowLeft, Newspaper } from 'lucide-react';
import { motion } from 'framer-motion';
import { useReducedMotion } from '@/hooks/use-reduced-motion';
import { NEWS } from '@/lib/constants';
const EASE = [0.25, 1, 0.5, 1] as const;
interface NewsDetailClientProps {
news: typeof NEWS[0];
}
export function NewsDetailClient({ news }: NewsDetailClientProps) {
const shouldReduceMotion = useReducedMotion();
const fadeUp = shouldReduceMotion ? {} : { initial: { opacity: 0, y: 20 } };
const relatedNews = NEWS
.filter((n) => n.id !== news.id && n.category === news.category)
.slice(0, 3);
return (
<div className="min-h-screen bg-[var(--color-bg-primary)]">
{/* Article Header */}
<section className="pt-32 pb-12">
<div className="container-wide">
<PageNav items={[{ label: '新闻动态', href: '/news' }, { label: news.title }]} />
{/* Breadcrumb */}
<nav className="flex items-center gap-2 text-sm text-[var(--color-text-muted)] mb-8">
<StaticLink href="/news" className="hover:text-[var(--color-brand-primary)] transition-colors duration-300">
新闻动态
</StaticLink>
<span>/</span>
<span className="text-[var(--color-text-primary)] line-clamp-1">{news.title}</span>
</nav>
<motion.div
{...fadeUp}
animate={shouldReduceMotion ? {} : { opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
className="max-w-4xl mt-6"
initial={shouldReduceMotion ? {} : { opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6, ease: EASE }}
className="max-w-4xl"
>
<Badge className="mb-4 bg-[var(--color-brand-primary-bg)] text-[var(--color-brand-primary)] hover:bg-[var(--color-brand-primary)]/20 border-0">
{news.category}
</Badge>
<h1 className="text-3xl sm:text-4xl lg:text-5xl font-bold text-[var(--color-text-primary)] mb-4 tracking-tight">
<h1 className="text-3xl sm:text-4xl lg:text-5xl font-semibold text-[var(--color-text-primary)] mb-5 tracking-tight leading-tight">
{news.title}
</h1>
<div className="flex items-center gap-4 text-[var(--color-text-muted)] text-sm">
@@ -43,21 +54,24 @@ export function NewsDetailClient({ news }: NewsDetailClientProps) {
{news.date}
</div>
</div>
<div className="ink-divider mt-8" />
</motion.div>
</div>
</section>
<section className="pb-16">
{/* Article Body */}
<section className="pb-16 md:pb-24">
<div className="container-wide">
<motion.div
{...fadeUp}
whileInView={shouldReduceMotion ? {} : { opacity: 1, y: 0 }}
initial={shouldReduceMotion ? {} : { opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
transition={{ duration: 0.6, ease: EASE }}
className="max-w-4xl"
>
{/* Featured Image */}
{news.image ? (
<div className="aspect-video rounded-xl overflow-hidden mb-8">
<div className="aspect-video rounded-xl overflow-hidden mb-10">
<img
src={news.image}
alt={news.title}
@@ -65,34 +79,37 @@ export function NewsDetailClient({ news }: NewsDetailClientProps) {
/>
</div>
) : (
<div className="aspect-video bg-gradient-to-br from-[var(--color-brand-primary-bg)] to-[var(--color-bg-tertiary)] rounded-xl mb-8 flex items-center justify-center">
<div className="aspect-video bg-gradient-to-br from-[var(--color-brand-primary-bg)] to-[var(--color-bg-tertiary)] rounded-xl mb-10 flex items-center justify-center">
<Newspaper className="w-16 h-16 text-[var(--color-brand-primary)]/30" />
</div>
)}
<div className="bg-[var(--color-brand-primary-bg)] rounded-xl p-6 mb-8">
{/* Excerpt */}
<InkCard padding="md" className="mb-10">
<p className="text-lg text-[var(--color-text-muted)] leading-relaxed">
{news.excerpt}
</p>
</div>
</InkCard>
<div className="text-[var(--color-text-primary)] leading-relaxed whitespace-pre-line">
{/* Article Content */}
<div className="prose-ink text-[var(--color-text-primary)] text-base sm:text-lg leading-[1.8] whitespace-pre-line">
{news.content}
</div>
{/* Related News */}
{relatedNews.length > 0 && (
<div className="mt-16 pt-12 border-t border-[var(--color-border)]">
<h2 className="text-2xl font-bold text-[var(--color-text-primary)] mb-8">相关新闻</h2>
<div className="mt-16 pt-12 border-t border-[var(--color-border-primary)]">
<h2 className="text-2xl font-semibold text-[var(--color-text-primary)] mb-8">相关新闻</h2>
<div className="grid md:grid-cols-3 gap-6">
{relatedNews.map((related) => (
<StaticLink key={related.id} href={`/news/${related.id}`}>
<div className="group cursor-pointer">
<div className="aspect-video rounded-lg mb-4 overflow-hidden">
<InkCard padding="none" interactive className="overflow-hidden group h-full">
<div className="aspect-video overflow-hidden">
{related.image ? (
<img
src={related.image}
alt={related.title}
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"
/>
) : (
<div className="w-full h-full bg-gradient-to-br from-[var(--color-brand-primary-bg)] to-[var(--color-bg-tertiary)] flex items-center justify-center">
@@ -100,18 +117,21 @@ export function NewsDetailClient({ news }: NewsDetailClientProps) {
</div>
)}
</div>
<Badge variant="secondary" className="mb-2 text-xs">{related.category}</Badge>
<h3 className="text-base font-semibold text-[var(--color-text-primary)] mb-1 line-clamp-2 group-hover:text-[var(--color-brand-primary)] transition-colors">
{related.title}
</h3>
<p className="text-sm text-[var(--color-text-muted)] line-clamp-2">{related.excerpt}</p>
</div>
<div className="p-4">
<Badge variant="secondary" className="mb-2 text-xs">{related.category}</Badge>
<h3 className="text-base font-semibold text-[var(--color-text-primary)] mb-1 line-clamp-2 group-hover:text-[var(--color-brand-primary)] transition-colors duration-300">
{related.title}
</h3>
<p className="text-sm text-[var(--color-text-muted)] line-clamp-2 leading-relaxed">{related.excerpt}</p>
</div>
</InkCard>
</StaticLink>
))}
</div>
</div>
)}
{/* Navigation */}
<div className="mt-12 flex justify-center gap-4">
<StaticLink href="/news">
<Button variant="outline" size="lg">
+105 -98
View File
@@ -9,15 +9,16 @@ import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { StaticLink } from '@/components/ui/static-link';
import { LoadingState } from '@/components/ui/loading-state';
import { InkCard } from '@/components/ui/ink-wash';
import { Search, Calendar, ChevronLeft, ChevronRight, ArrowRight, Newspaper } from 'lucide-react';
import { PageNav } from '@/components/layout/page-nav';
const EASE = [0.25, 1, 0.5, 1] as const;
const categories = ['全部', '公司新闻', '研发动态'];
const ITEMS_PER_PAGE = 9;
export default function NewsListPage() {
const shouldReduceMotion = useReducedMotion();
const fadeUp = shouldReduceMotion ? {} : { initial: { opacity: 0, y: 20 } };
const [selectedCategory, setSelectedCategory] = useState('全部');
const [searchQuery, setSearchQuery] = useState('');
const [currentPage, setCurrentPage] = useState(1);
@@ -61,34 +62,40 @@ export default function NewsListPage() {
return (
<div className="min-h-screen bg-[var(--color-bg-primary)]">
<section className="pt-32 pb-16">
<div className="container-wide">
<PageNav items={[{ label: '新闻动态' }]} />
{/* Hero */}
<section className="relative pt-32 pb-12 overflow-hidden">
<div className="container-wide relative z-10">
<motion.div
{...fadeUp}
animate={shouldReduceMotion ? {} : { opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
initial={shouldReduceMotion ? {} : { opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6, ease: EASE }}
className="max-w-3xl"
>
<p className="text-sm font-medium text-[var(--color-brand-primary)] mb-4 tracking-wide uppercase">News</p>
<h1 className="text-4xl md:text-5xl font-bold text-[var(--color-text-primary)] mb-6 tracking-tight">
<div className="inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-[var(--color-brand-primary-bg)] text-[var(--color-brand-primary)] text-xs font-medium border border-[var(--color-brand-primary)]/10 mb-6">
新闻动态
</div>
<p className="text-base sm:text-lg text-[var(--color-text-muted)] mb-3">
了解行业趋势,把握数字化脉搏
</p>
<h1 className="text-4xl md:text-5xl lg:text-6xl tracking-tight mb-6 leading-[1.12]">
新闻<span className="text-[var(--color-brand-primary)] font-calligraphy">动态</span>
</h1>
<p className="text-lg text-[var(--color-text-muted)] leading-relaxed">
了解{COMPANY_INFO.displayName}最新动态,把握行业发展脉搏
<p className="text-base sm:text-lg text-[var(--color-text-muted)] max-w-lg leading-relaxed">
{COMPANY_INFO.displayName}最新动态、产品更新与行业洞察
</p>
</motion.div>
</div>
</section>
<section className="pb-16">
{/* Filters + List */}
<section className="pb-16 md:pb-24">
<div className="container-wide">
<motion.div
{...fadeUp}
whileInView={shouldReduceMotion ? {} : { opacity: 1, y: 0 }}
initial={shouldReduceMotion ? {} : { opacity: 0, y: 16 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="mb-8 space-y-4"
transition={{ duration: 0.5, ease: EASE }}
className="mb-10 space-y-4"
>
<div className="flex flex-wrap gap-2">
{categories.map((category) => (
@@ -128,91 +135,91 @@ export default function NewsListPage() {
) : (
<LoadingState isLoading={isLoading} variant="list">
<>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{paginatedNews.map((newsItem, index) => (
<motion.div
key={newsItem.id}
{...fadeUp}
whileInView={shouldReduceMotion ? {} : { opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: index * 0.1 }}
>
<StaticLink href={`/news/${newsItem.id}`}>
<div className="group h-full bg-[var(--color-bg-primary)] rounded-xl border border-[var(--color-border)] overflow-hidden hover:border-[var(--color-brand-primary)]/30 hover:shadow-md transition-all duration-300">
{newsItem.image ? (
<div className="aspect-video bg-[var(--color-bg-tertiary)] overflow-hidden">
<img
src={newsItem.image}
alt={newsItem.title}
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
/>
</div>
) : (
<div className="aspect-video bg-gradient-to-br from-[var(--color-brand-primary-bg)] to-[var(--color-bg-tertiary)] flex items-center justify-center">
<Newspaper className="w-12 h-12 text-[var(--color-brand-primary)]/30" />
</div>
)}
<div className="p-6">
<div className="flex items-center gap-2 mb-3">
<Badge variant="secondary" className="text-xs">{newsItem.category}</Badge>
<div className="flex items-center gap-1 text-xs text-[var(--color-text-muted)]">
<Calendar className="w-3 h-3" />
{newsItem.date}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8">
{paginatedNews.map((newsItem, index) => (
<motion.div
key={newsItem.id}
initial={shouldReduceMotion ? {} : { opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: index * 0.08, ease: EASE }}
>
<StaticLink href={`/news/${newsItem.id}`}>
<InkCard padding="none" interactive className="h-full overflow-hidden group">
{newsItem.image ? (
<div className="aspect-video bg-[var(--color-bg-tertiary)] overflow-hidden">
<img
src={newsItem.image}
alt={newsItem.title}
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"
/>
</div>
) : (
<div className="aspect-video bg-gradient-to-br from-[var(--color-brand-primary-bg)] to-[var(--color-bg-tertiary)] flex items-center justify-center">
<Newspaper className="w-12 h-12 text-[var(--color-brand-primary)]/30" />
</div>
)}
<div className="p-6">
<div className="flex items-center gap-2 mb-3">
<Badge variant="secondary" className="text-xs">{newsItem.category}</Badge>
<div className="flex items-center gap-1 text-xs text-[var(--color-text-muted)]">
<Calendar className="w-3 h-3" />
{newsItem.date}
</div>
</div>
<h3 className="text-lg font-semibold text-[var(--color-text-primary)] mb-2 line-clamp-2 group-hover:text-[var(--color-brand-primary)] transition-colors duration-300">
{newsItem.title}
</h3>
<p className="text-sm text-[var(--color-text-muted)] line-clamp-3 mb-4 leading-relaxed">
{newsItem.excerpt}
</p>
<div className="flex items-center text-[var(--color-brand-primary)] text-sm font-medium">
阅读更多
<ArrowRight className="ml-1 w-4 h-4 group-hover:translate-x-1 transition-transform duration-300" />
</div>
</div>
<h3 className="text-lg font-semibold text-[var(--color-text-primary)] mb-2 line-clamp-2 group-hover:text-[var(--color-brand-primary)] transition-colors">
{newsItem.title}
</h3>
<p className="text-sm text-[var(--color-text-muted)] line-clamp-3 mb-4">
{newsItem.excerpt}
</p>
<div className="flex items-center text-[var(--color-brand-primary)] text-sm font-medium">
阅读更多
<ArrowRight className="ml-1 w-4 h-4 group-hover:translate-x-1 transition-transform" />
</div>
</div>
</div>
</StaticLink>
</motion.div>
))}
</div>
{totalPages > 1 && (
<div className="flex justify-center items-center gap-2 mt-8">
<Button
variant="outline"
size="icon"
onClick={() => handlePageChange(currentPage - 1)}
disabled={currentPage === 1}
>
<ChevronLeft className="w-4 h-4" />
</Button>
{Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => (
<Button
key={page}
variant={currentPage === page ? 'default' : 'outline'}
size="icon"
onClick={() => handlePageChange(page)}
className={
currentPage === page
? 'bg-[var(--color-brand-primary)] hover:bg-[var(--color-brand-primary-hover)] text-white'
: ''
}
>
{page}
</Button>
</InkCard>
</StaticLink>
</motion.div>
))}
<Button
variant="outline"
size="icon"
onClick={() => handlePageChange(currentPage + 1)}
disabled={currentPage === totalPages}
>
<ChevronRight className="w-4 h-4" />
</Button>
</div>
)}
</>
{totalPages > 1 && (
<div className="flex justify-center items-center gap-2 mt-10">
<Button
variant="outline"
size="icon"
onClick={() => handlePageChange(currentPage - 1)}
disabled={currentPage === 1}
>
<ChevronLeft className="w-4 h-4" />
</Button>
{Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => (
<Button
key={page}
variant={currentPage === page ? 'default' : 'outline'}
size="icon"
onClick={() => handlePageChange(page)}
className={
currentPage === page
? 'bg-[var(--color-brand-primary)] hover:bg-[var(--color-brand-primary-hover)] text-white'
: ''
}
>
{page}
</Button>
))}
<Button
variant="outline"
size="icon"
onClick={() => handlePageChange(currentPage + 1)}
disabled={currentPage === totalPages}
>
<ChevronRight className="w-4 h-4" />
</Button>
</div>
)}
</>
</LoadingState>
)}
</div>