{% extends "base.html" %} {% block title %}Design System - OpenAver{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
DaisyUI + Fluent Design 2 元件庫
Fix-1 ~ Fix-6 期間新增的 Bootstrap Icons(依功能分類)
Lightest background
Card background
Dropdown/Modal
Primary actions
Body background
Card, Sidebar
Dropdown, Modal
Warning alerts, suffix badge bg
Warning text on warning bg
翻譯功能圖示 / 按鈕色
Primary Text (--text-primary)
Secondary Text (--text-secondary)
Muted Text (--text-muted)
Body Text - Plus Jakarta Sans 400, 1rem/1.5
Small Text - 0.875remui-conventions §3:遮罩用角色色 token,不寫 hardcoded rgba。
核心元件的視覺狀態展示(非互動,純 CSS 強制顯示)
ui-conventions §6:每次 PR 前確認這 5 點。左欄為違規示範(紅虛線),右欄為正確寫法(綠實線)。
border-radius: 3px
border-radius: var(--fluent-radius-md)
background: rgba(255,255,255,0.5)
background: var(--surface-1)
border: 2px solid red
border: 1px solid var(--stroke-default)
box-shadow: 0 4px 8px rgba(0,0,0,0.5)
box-shadow: var(--fluent-shadow-8)
outline: none(無任何補充)
outline: 2px solid var(--accent); outline-offset: 4px; box-shadow: 0 0 0 4px var(--glow-primary)
12px 圓角 + 頂部高光線 + shadow-4
Hover: 高光線加強 + shadow-8 + 主題色發光
檔案操作相關元件,用於 Search 和 Gallery 頁面
每個 file-item row 結構固定:remove 按鈕、檔案圖示、檔名、狀態圖示、action slot。
action slot 內的 button/spinner 透過 Alpine x-show 互斥顯示(scrape-ready → searching → done / failed);
row 本身只切 .active class 表示當前選中。
x-show="canScrapeFile(file) && !file.isScraping && file.scrapeStatus !== 'done'" → 顯示 NFO 按鈕x-show="file.isScraping" → 顯示 spinnerx-show="file.scrapeStatus === 'done'" → 顯示完成按鈕(disabled)x-show="file.scrapeStatus === 'failed'" → 顯示失敗按鈕(可重試)x-show="needsNumberInput(file)" → !file.number,顯示手動輸入按鈕/* File Item 核心樣式(search.css) */
.file-item {
display: flex; align-items: center; gap: 8px;
padding: 4px 8px;
border-radius: var(--fluent-radius-sm);
font-size: 0.8rem; cursor: pointer;
transition: background var(--fluent-duration-fast) var(--fluent-ease-standard);
}
.file-item.active {
background: var(--border-light);
color: var(--accent);
font-weight: 600;
}
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-status { font-size: 0.75rem; color: var(--color-success); flex-shrink: 0; }
.file-item .btn-scrape-single { flex-shrink: 0; padding: 0 6px; font-size: 0.7rem; }
標籤使用三種 badge 變體:系統標籤(灰)、中文字幕(綠)、版本標記(黃)
.tag-badge — 預設灰(系統/來源標籤).tag-badge.subtitle — 綠色(中文字幕偵測).tag-badge.suffix-badge — 黃色(Fix-1 版本標記:-4K / -CD1 / -CD2 / -UC)<span class="badge tag-badge">HD</span>
<span class="badge tag-badge subtitle">中文字幕</span>
<span class="badge tag-badge suffix-badge">-4K</span>
拖曳檔案時的全螢幕覆蓋層,毛玻璃效果 + 大圖示提示,支援主題跟隨
主題適配:
背景色 oklch(var(--b1) / 0.6)、文字色 oklch(var(--bc)) 自動跟隨 DaisyUI 主題
<div class="drag-overlay active">
<div class="drag-overlay-content">
<i class="bi bi-file-earmark-arrow-up"></i>
<p>拖入檔案或資料夾</p>
</div>
</div>
Gallery 頁的資料夾列表項目,顯示路徑和移除按鈕
.folder-item {
display: flex;
align-items: center;
padding: 0.875rem 1.25rem;
gap: 0.75rem;
border-bottom: 1px solid var(--border-light);
}
.folder-item:hover {
background: var(--bg-body);
}
.folder-item:hover .btn-remove {
opacity: 1;
}
搜尋頁面的各種狀態展示,用於引導用戶操作或顯示進度/錯誤
{% include 'design_system/page-states.html' %}Gallery 頁面的元件系統,包含資料夾管理、統計卡片和女優別名管理
{% include 'design_system/gallery-components.html' %}Settings 頁面的基礎表單元件,包含 Toggle、Select、Number input 和 Text input
{% include 'design_system/settings-components.html' %}頁面級排版 Mockup,展示遷移後的完整視覺節奏 (純靜態展示,非互動)
{% include 'design_system/page-compositions.html' %}Fluent Design 2 風格的確認對話框,使用 DaisyUI modal + Alpine.js
刪除/確認操作的標準對話框,Smoke backdrop + Fluent 卡片樣式
<dialog> 元素 + Alpine.js $refs:class="{ 'modal-open': dirtyCheckModalOpen }")控制 modal 顯示(參見 settings.html、scanner.html);此頁 demo 使用原生 $refs.showModal() 僅為展示用途--fluent-smoke token(Light: 0.4, Dark: 0.6)--fluent-shadow-28(XXLarge elevation)--fluent-radius-xl (12px)<!-- Alpine.js 控制 -->
<div x-data>
<button @click="$refs.dialog.showModal()">Open</button>
<dialog x-ref="dialog" class="modal fluent-modal">
<div class="modal-box fluent-modal-box">
<h3 class="fluent-modal-title">Title</h3>
<p class="fluent-modal-body">Content</p>
<div class="modal-action fluent-modal-actions">
<button @click="$refs.dialog.close()">Close</button>
</div>
</div>
<form method="dialog" class="modal-backdrop">
<button>close</button>
</form>
</dialog>
</div>
Fix-1 新增:當目標檔案已存在時(如 CD1/CD2 同番號)顯示覆蓋警告
目標檔案已存在,繼續會覆蓋原有檔案:
[SONE-205][S1] SONE-205.mp4
這通常發生在同一部影片有多個版本(CD1/CD2、4K、UC)時。
請到 設定 → 進階刮削設定 → 版本標記,新增關鍵字並確認檔案命名格式包含 {suffix} 變數。
duplicateModalOpen class toggle(:class="{ 'modal-open': duplicateModalOpen }"),
而非 Confirmation Dialog 的 $refs.dialog.showModal() 方式。兩種模式均可:
@click.self 關閉)<dialog> native:適合標準 Escape 關閉 + focus trap<dialog class="modal fluent-modal"
:class="{ 'modal-open': duplicateModalOpen }"
@click.self="closeDuplicateModal()">
<div class="modal-box fluent-modal-box">
<h3 class="fluent-modal-title">
<i class="bi bi-exclamation-triangle"></i> 檔案重複
</h3>
<p>...</p>
<p>包含 <code class="badge badge-sm">{suffix}</code> 變數。</p>
<div class="modal-action">
<button class="btn btn-sm" @click="closeDuplicateModal()">了解</button>
<a href="/settings" class="btn btn-sm btn-primary">前往設定</a>
</div>
</div>
</dialog>
Help 頁面使用的鍵盤快捷鍵展示元件(DaisyUI kbd + table)
使用說明頁面的鍵盤快捷鍵對照表,展示主應用程式的核心快捷鍵
| 按鍵組合 | 功能 |
|---|---|
| Ctrl / Cmd + K | 聚焦搜尋框 |
| ← → | 切換上一個/下一個結果 |
| Esc | 清空搜尋框 |
| Enter | 執行搜尋 |
<kbd> 元件(.kbd.kbd-sm)<table> + .table-sm(減少內距)+ 符號清晰標示(如 Ctrl + K)<!-- 快捷鍵表格 -->
<table class="table table-sm">
<tbody>
<tr>
<td>
<kbd class="kbd kbd-sm">Ctrl</kbd> + <kbd class="kbd kbd-sm">K</kbd>
</td>
<td>聚焦搜尋框</td>
</tr>
</tbody>
</table>
inline question-circle + 浮動說明框,用於表單欄位的輔助說明
Set-ItemProperty -Path 'HKLM:\...' -Name 'LongPathsEnabled' -Value 1
執行後需重新啟動 Windows 才能生效。
.help-popover-btn(觸發按鈕)+ .help-popover(浮動框).help-popover__body;code block:.help-popover__code--color-base-200 為 DaisyUI 變數,自動跟隨 Light/Dark 主題切換--fluent-shadow-4(Light 模式較淺,Dark 模式自動加深)position: relative(inline 元素可用 wrapper div 提供)x-transition 提供淡入淡出效果;@click.outside 點外部自動關閉<!-- 父層容器需 position: relative -->
<div style="position: relative;">
<!-- 觸發按鈕 -->
<button type="button" class="help-popover-btn"
@click="showHelp = !showHelp"
:aria-expanded="showHelp">
<i class="bi bi-question-circle"></i>
</button>
<!-- 浮動說明框 -->
<div x-show="showHelp" x-cloak x-transition
@click.outside="showHelp = false"
class="help-popover">
<small class="help-popover__body">說明文字</small>
<!-- 可選 code block -->
<pre class="help-popover__code"><code>指令範例</code></pre>
</div>
</div>
來源:help.html Hero Card 右欄的 AI 整合入口指令框。
背景使用 var(--surface-2) 跟隨主題;[data-theme="dim"] override 固定深色(oklch(20% 0.01 250))確保 dim 模式終端外觀一致。
右上角有複製按鈕,點擊後圖示切換為 ✓,1.5 秒後自動復原。
var(--surface-2);Dim 模式 override 固定深色終端外觀
<div class="hero-terminal relative" x-data="{ curlCopied: false }">
<span class="terminal-prompt">$</span>
curl http://localhost:7080/api/capabilities
<button class="terminal-copy-btn"
@click="curlCopied = true; setTimeout(() => curlCopied = false, 1500)">
<span x-show="!curlCopied">📋</span>
<span x-show="curlCopied">✓</span>
</button>
</div>
.hero-terminal:背景 var(--surface-2),[data-theme="dim"] .hero-terminal override 為固定深色 oklch(20% 0.01 250)(design-intent).terminal-prompt:青綠 var(--color-success)(iOS Green,與 .workflow-arrow/.workflow-step-num 統一動作指引色),user-select: none.terminal-copy-btn:絕對定位右上角,:hover 有背景高亮<style> 提供;production 版定義見 help.css 行 17–52
toast-msg 和 source-toast-inline 為舊版實作,已棄用。
標準 Toast 實作為 fluent-toast,請參見
Toasts section。
detail-progress 和 batch-progress 的完整展示(含 code snippet)
請參見 Progress & Feedback section。
Showcase 頁面專屬元件:Toolbar Dropdown、Status Bar + Pagination、Table Mode、List Mode
工具列下拉選單,包含三種變體:排序(Sort)、顯示模式(Mode)、每頁數量(Per-page)。使用 .toolbar-dropdown-wrap + .toolbar-dropdown 搭配 Alpine.js x-show 控制開關。
Sort
Mode
Per-page
Showcase 頁面固定於內容區頂端的狀態列,左側顯示統計資訊,右側顯示分頁控制。使用 .showcase-status-bar、.status-total、.status-pagination、.page-btn、.page-select。
⚠️ 注意:此元件自 v0.7.8 (49a-T4) 起已從 showcase 主頁移除,改由底部 .showcase-footer 三段式統合,此處保留作為元件 reference。
.page-btn 加上 disabled attribute 呈現禁用狀態(如上方「上一頁」按鈕);.page-select 為頁碼選擇器。
表格模式使用 .showcase-table-wrapper + .table-scroll-container 實現水平捲動。每列使用 .table-row-clickable 提供 hover 互動效果。標籤欄使用 .table-tags-wrapper + .table-tag + .table-tag-more 呈現 tag 群組。
| # | 品番 | 標題 | 演員 | 廠商 | 導演 | 時長 | 日期 | 標籤 | 大小 |
|---|---|---|---|---|---|---|---|---|---|
| 1 | ABC-001 | 示範影片標題 A | 示範演員 | 示範廠商 | 示範導演 | 120 分 | 2024-01-15 | 4.2 GB | |
| 2 | DEF-002 | 示範影片標題 B | 示範演員 A, 示範演員 B | 示範廠商 | - | 95 分 | 2024-02-20 | 8.7 GB | |
| 3 | GHI-003 | 示範影片標題 C | 示範演員 A | 另一廠商 | 示範導演 B | - | 2024-03-10 | - | 2.1 GB |
清單模式使用 .showcase-list-wrapper + .showcase-list(<ul>)呈現精簡文字列表。每筆包含 .list-number(品番)、.list-title(標題)、.list-actor(演員),.list-item 具備 hover 互動效果。
Search 頁面專屬元件:Sample Gallery、Shimmer Loading、Cover Actions、Sample Strip
全螢幕 sample 圖瀏覽 overlay(.sample-gallery)。原本是 position: fixed; inset: 0,demo 中以相對定位容器模擬。
支援主圖顯示、左右導航、計數器、縮圖列。.show class 控制可見性。
Classes:.sample-gallery .show .sg-close .sg-counter
.sg-main-wrap .sg-main-img .sg-nav .sg-prev .sg-next
.sg-thumbs .sg-thumb-btn .sg-thumb-active .sg-thumb-img
載入中佔位動畫。兩種使用情境:
(1) .cover-loading-placeholder > .shimmer(詳情封面佔位,position: absolute; inset: 0);
(2) .skeleton-cover.shimmer(grid card 封面佔位,aspect-ratio: 3/2)。
動畫由 search.css 的 @keyframes shimmer 提供,此處不重複定義。
情境 1:.cover-loading-placeholder > .shimmer(詳情封面)
情境 2:.skeleton-cover.shimmer(grid card 封面)
Classes:.cover-loading-placeholder .shimmer .skeleton-cover
封面圖上的 glass-circle 按鈕群組(.cover-actions)。
CSS 選擇器為 .lightbox-cover .cover-actions,必須保留 .lightbox-cover 父容器。
預設 opacity: 0,hover .lightbox-cover 時 fade in。
Tooltip 由 CSS ::after 從 data-tooltip 屬性讀取,不需 JS。
Classes:.lightbox-cover(父容器).cover-actions .lb-action-btn
屬性:data-tooltip
水平可捲動縮圖列(.sample-strip)。每張縮圖為 .sample-thumb-btn,active 狀態加 .sample-thumb-active(outline 高亮)。
縮圖高度由 clamp(48px, calc(var(--cover-height, 400px) * 0.18), 120px) 計算;demo 容器設 --cover-height: 400px 讓計算正確。
Classes:.sample-strip .sample-thumb-btn .sample-thumb-active .sample-thumb-img
CSS var:--cover-height
53b-T1 靜態 demo — 鈴鐺 4 狀態 + 抽屜 4 嚴重度通知樣本。實際 poll / 已讀邏輯 / anchor 定位 / focus trap 已於 53b-T2~T5 接入 base.html(本頁為靜態樣本登記)。
鈴鐺 4 狀態(idle / info / warn / error),DaisyUI semantic color 自動跟主題(CD-53B-9)。
抽屜展開狀態,4 個嚴重度通知樣本。實際 anchor 定位 / 開關動畫 / focus trap 在 T4 接入。
切換假資料 / 全部清空(demo 階段為 no-op:直接清空 demoItems,T5 才接 confirm)。
bg-info / bg-success / bg-warning / bg-error),跟主題自動切換(CD-53B-9)。
抽屜 panel 用 bg-base-100 + shadow-lg + rounded-xl,T4 整合 base.html 時再對齊 §2 玻璃階。
T1 demo 不引入 @alpinejs/anchor、@alpinejs/focus、x-collapse,皆留 T4 / T5 處理。