Files
website-enchun-mgr/specs/001-users-pukpuk-dev/ux-story-1-9-blog-spec.md
pkupuk e9897388dc docs: separate documentation and specs into initial commit
Establish baseline for project documentation including BMAD specs, PRD, and system architecture notes.
2026-02-11 11:49:49 +08:00

7.7 KiB
Raw Blame History

Story 1-9 Blog System - UX Pixel-Perfect Specifications

UX Expert Review Document 參考來源: research/www.enchun.tw/news.html 設計系統: apps/frontend/src/styles/theme.css 目標視覺保真度: 95%+ URL 結構: /blog (SEO 友好)


🎨 Design Token 驗證

色彩系統

用途 變數名稱 Hex Color CSS Variable 驗證狀態
主品牌色 Enchun Blue #23608c --color-enchunblue 已定義
深品牌色 Enchun Blue Dark #3083bf --color-enchunblue-dark 已定義
深灰文字 Tarawera #2d3748 --color-tarawera 已定義
通知紅 Notification Red #d84038 --color-accent 已定義
CTA 強調 Amber #f6c456 --color-amber 已定義

類別分區顏色

類別 Hex Color CSS Variable 驗證狀態
Google 小學堂 #67aee1 --color-category-google 已定義
Meta 小學堂 #8974de --color-category-meta 已定義
行銷時事最前線 #3083bf --color-category-news 已定義
恩群數位 #3898ec --color-category-enchun 已定義

📐 Section 詳細規格

1. Blog 列表頁

頁面路徑: /blog

.blog-section {
    padding: 60px 0 80px;
    background-color: var(--color-background);
}

.blog-header {
    text-align: center;
    margin-bottom: 50px;
}

.blog-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-tarawera);
    margin-bottom: 10px;
    line-height: 1.2;
}

.blog-subtitle {
    font-size: 1.125rem;
    color: var(--color-gray-700);
    font-weight: 400;
    line-height: 1.6;
}

分類篩選器

.category-filter {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.category-button {
    padding: 12px 24px;
    background-color: var(--color-gray-100);
    border: 2px solid transparent;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-gray-700);
    transition: all 200ms ease-in-out;
}

.category-button:hover {
    background-color: var(--color-gray-200);
    transform: translateY(-2px);
}

.category-button.active {
    background-color: var(--color-enchunblue);
    border-color: var(--color-enchunblue);
    color: white;
}

文章卡片網格

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

2. 文章卡片組件

組件檔案: components/blog/ArticleCard.astro

.article-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 300ms ease-in-out;
    display: block;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    background-color: var(--color-gray-100);
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease-in-out;
}

.article-card:hover .card-image {
    transform: scale(1.05);
}

.category-badge-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.6);
}

.card-content {
    padding: 24px;
}

.category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-tarawera);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

3. 分頁元件

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination-link {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background-color: white;
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    color: var(--color-gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 200ms ease-in-out;
}

.pagination-link:hover {
    background-color: var(--color-enchunblue);
    border-color: var(--color-enchunblue);
    color: white;
}

.pagination-link.active {
    background-color: var(--color-enchunblue);
    border-color: var(--color-enchunblue);
    color: white;
}

4. 文章詳情頁

頁面路徑: /blog/[slug]

.article-header {
    text-align: center;
    padding: 60px 0 40px;
}

.article-hero {
    margin-bottom: 40px;
}

.hero-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-tarawera);
    margin-bottom: 16px;
    line-height: 1.2;
}

.article-category-badge {
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

.article-content-wrapper {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.125rem;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 40px 0 20px;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 16px;
}

📱 響應式斷點總結

Breakpoint 字體大小 主容器 卡片佈局
Desktop (≥1200px) 16px 1200px 3 columns
Tablet (768-1199px) 19px 96% 2 columns
Mobile (479-767px) 16px 96% 1 column
Small Mobile (<479px) 13px 96% 1 column

🏗️ 組件實現清單

需新增

  • ArticleCard.astro - 文章卡片
  • CategoryFilter.astro - 分類篩選器
  • Pagination.astro - 分頁元件
  • RelatedPosts.astro - 相關文章

📝 URL 結構

  • 列表頁: /blog
  • 詳情頁: /blog/[slug]
  • 分類頁: /blog/category/[slug]

📋 驗收標準

視覺保真度檢查

  • 文章卡片樣式與設計一致
  • 分類標籤顏色正確
  • Hover 效果流暢
  • 響應式佈局正確

功能檢查

  • 分類篩選功能正常
  • 分頁導航正常
  • 文章詳情頁渲染正確
  • 相關文章顯示正常

性能檢查

  • Lighthouse Performance ≥ 90
  • 圖片懶加載實現
  • 分頁載入實現

此文件由 UX Expert 創建最後更新2026-02-10