From e5214420fc76c38e9289ef260c27d14437968d1b Mon Sep 17 00:00:00 2001 From: kushidou Date: Sat, 18 Jul 2026 20:53:35 +0800 Subject: [PATCH] feat: switch to table layout and add image URL field --- index.html | 570 ++++++++++++++++++++------------------------- sample_config.json | 28 +-- 2 files changed, 263 insertions(+), 335 deletions(-) diff --git a/index.html b/index.html index 1d6119a..3bbf9d2 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ body { } .container { - max-width: 960px; + max-width: 1100px; margin: 0 auto; padding: 20px; } @@ -56,29 +56,13 @@ body { font-weight: 500; } -.btn-primary { - background: #1677ff; - color: #fff; -} +.btn-primary { background: #1677ff; color: #fff; } .btn-primary:hover { background: #4096ff; } - -.btn-default { - background: #fff; - color: #333; - border: 1px solid #d9d9d9; -} +.btn-default { background: #fff; color: #333; border: 1px solid #d9d9d9; } .btn-default:hover { border-color: #1677ff; color: #1677ff; } - -.btn-danger { - background: #ff4d4f; - color: #fff; -} +.btn-danger { background: #ff4d4f; color: #fff; } .btn-danger:hover { background: #ff7875; } - -.btn-sm { - padding: 4px 10px; - font-size: 12px; -} +.btn-sm { padding: 4px 10px; font-size: 12px; } .mode-toggle { background: #f0f0f0; @@ -104,48 +88,140 @@ body { box-shadow: 0 1px 3px rgba(0,0,0,0.1); } -/* Component Cards */ -.component-list { - display: flex; - flex-direction: column; - gap: 12px; +/* Table */ +.config-table-wrap { + background: #fff; + border-radius: 12px; + box-shadow: 0 2px 8px rgba(0,0,0,0.06); + overflow: hidden; margin-bottom: 80px; } -.component-card { - background: #fff; - border-radius: 12px; - padding: 20px 24px; - box-shadow: 0 2px 8px rgba(0,0,0,0.06); - transition: box-shadow 0.2s; +.config-table { + width: 100%; + border-collapse: collapse; + font-size: 14px; } -.component-card:hover { - box-shadow: 0 4px 16px rgba(0,0,0,0.1); +.config-table thead { + background: #fafafa; } -.card-header { +.config-table th { + padding: 12px 16px; + text-align: left; + font-weight: 600; + color: #666; + font-size: 13px; + border-bottom: 1px solid #f0f0f0; + white-space: nowrap; +} + +.config-table td { + padding: 12px 16px; + border-bottom: 1px solid #f0f0f0; + vertical-align: middle; +} + +.config-table tbody tr:last-child td { + border-bottom: none; +} + +.config-table tbody tr:hover { + background: #fafafa; +} + +/* Image cell */ +.cell-img { + width: 64px; + height: 64px; + border-radius: 8px; + object-fit: contain; + background: #f5f5f5; + border: 1px solid #eee; +} + +.cell-img-placeholder { + width: 64px; + height: 64px; + border-radius: 8px; + background: #f5f5f5; + border: 1px solid #eee; display: flex; align-items: center; - justify-content: space-between; - margin-bottom: 12px; + justify-content: center; + color: #ccc; + font-size: 20px; } -.component-type { +/* Type badge */ +.type-badge { font-size: 13px; font-weight: 600; color: #1677ff; background: #e6f4ff; - padding: 4px 12px; + padding: 4px 10px; border-radius: 6px; + display: inline-block; } -.card-actions { +/* Price cell */ +.price-cell { + font-weight: 700; + color: #ff4d4f; + white-space: nowrap; +} + +.price-cell .currency { + font-size: 12px; + font-weight: 500; +} + +/* Link cell */ +.link-cell a { + color: #1677ff; + text-decoration: none; + font-size: 13px; +} +.link-cell a:hover { text-decoration: underline; } + +/* Alt selector */ +.alt-selector { + margin-top: 4px; +} + +.alt-label { + font-size: 11px; + color: #999; + margin-bottom: 4px; +} + +.alt-options { display: flex; - gap: 6px; + gap: 4px; + flex-wrap: wrap; } -.card-actions button { +.alt-pill { + padding: 3px 8px; + border: 1px solid #e8e8e8; + border-radius: 4px; + font-size: 11px; + cursor: pointer; + background: #fff; + color: #666; + transition: all 0.2s; +} + +.alt-pill:hover { border-color: #1677ff; color: #1677ff; } +.alt-pill.active { border-color: #1677ff; background: #e6f4ff; color: #1677ff; font-weight: 500; } + +/* Action cells */ +.action-cell { + white-space: nowrap; +} + +.action-cell button { background: none; border: 1px solid #e8e8e8; border-radius: 6px; @@ -154,107 +230,17 @@ body { font-size: 12px; color: #666; transition: all 0.2s; + margin-left: 4px; } -.card-actions button:hover { - border-color: #1677ff; - color: #1677ff; -} +.action-cell button:first-child { margin-left: 0; } +.action-cell button:hover { border-color: #1677ff; color: #1677ff; } +.action-cell button.delete-btn:hover { border-color: #ff4d4f; color: #ff4d4f; } -.card-actions button.delete-btn:hover { - border-color: #ff4d4f; - color: #ff4d4f; -} - -.card-body { - display: grid; - grid-template-columns: 1fr auto; - gap: 8px 20px; - align-items: start; -} - -.card-info { - display: flex; - flex-direction: column; - gap: 6px; -} - -.info-row { - display: flex; - align-items: baseline; - gap: 8px; -} - -.info-label { - font-size: 12px; - color: #999; - min-width: 42px; -} - -.info-value { - font-size: 14px; - color: #333; -} - -.info-value a { - color: #1677ff; - text-decoration: none; -} -.info-value a:hover { text-decoration: underline; } - -.card-price { - font-size: 22px; - font-weight: 700; - color: #ff4d4f; - white-space: nowrap; -} - -.card-price .currency { - font-size: 14px; - font-weight: 500; -} - -/* Alternative Selector */ -.alt-selector { - grid-column: 1 / -1; - margin-top: 8px; - padding-top: 12px; - border-top: 1px solid #f0f0f0; -} - -.alt-label { - font-size: 12px; - color: #999; - margin-bottom: 6px; -} - -.alt-options { - display: flex; - gap: 6px; - flex-wrap: wrap; -} - -.alt-pill { - padding: 5px 12px; - border: 1px solid #e8e8e8; - border-radius: 6px; - font-size: 12px; - cursor: pointer; - background: #fff; - color: #666; - transition: all 0.2s; -} - -.alt-pill:hover { - border-color: #1677ff; - color: #1677ff; -} - -.alt-pill.active { - border-color: #1677ff; - background: #e6f4ff; - color: #1677ff; - font-weight: 500; +/* Add button row */ +.add-row { + padding: 16px; + text-align: center; } /* Footer / Total */ @@ -270,17 +256,14 @@ body { } .footer-inner { - max-width: 960px; + max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; } -.footer-label { - font-size: 14px; - color: #666; -} +.footer-label { font-size: 14px; color: #666; } .footer-total { font-size: 28px; @@ -288,9 +271,7 @@ body { color: #ff4d4f; } -.footer-total .currency { - font-size: 16px; -} +.footer-total .currency { font-size: 16px; } /* Modal */ .modal-overlay { @@ -303,14 +284,12 @@ body { align-items: center; } -.modal-overlay.active { - display: flex; -} +.modal-overlay.active { display: flex; } .modal { background: #fff; border-radius: 12px; - width: 560px; + width: 600px; max-width: 90vw; max-height: 85vh; overflow-y: auto; @@ -324,10 +303,7 @@ body { justify-content: space-between; } -.modal-header h2 { - font-size: 18px; - font-weight: 600; -} +.modal-header h2 { font-size: 18px; font-weight: 600; } .modal-close { background: none; @@ -339,13 +315,9 @@ body { } .modal-close:hover { color: #333; } -.modal-body { - padding: 20px 24px; -} +.modal-body { padding: 20px 24px; } -.form-group { - margin-bottom: 16px; -} +.form-group { margin-bottom: 16px; } .form-group label { display: block; @@ -356,8 +328,7 @@ body { } .form-group input, -.form-group select, -.form-group textarea { +.form-group select { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; @@ -368,8 +339,7 @@ body { } .form-group input:focus, -.form-group select:focus, -.form-group textarea:focus { +.form-group select:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,0.1); @@ -395,17 +365,13 @@ body { margin-bottom: 12px; } -.alt-section-header h3 { - font-size: 14px; - font-weight: 600; -} +.alt-section-header h3 { font-size: 14px; font-weight: 600; } .alt-item { background: #fafafa; border-radius: 8px; padding: 12px; margin-bottom: 8px; - position: relative; } .alt-item-header { @@ -415,11 +381,7 @@ body { margin-bottom: 8px; } -.alt-item-label { - font-size: 12px; - font-weight: 600; - color: #1677ff; -} +.alt-item-label { font-size: 12px; font-weight: 600; color: #1677ff; } .alt-item-remove { background: none; @@ -444,10 +406,7 @@ body { color: #999; } -.empty-state p { - margin-bottom: 16px; - font-size: 15px; -} +.empty-state p { margin-bottom: 16px; font-size: 15px; } /* Import Overlay */ .import-overlay { @@ -460,9 +419,7 @@ body { align-items: center; } -.import-overlay.active { - display: flex; -} +.import-overlay.active { display: flex; } .import-box { background: #fff; @@ -472,18 +429,14 @@ body { box-shadow: 0 8px 32px rgba(0,0,0,0.2); } -.import-box p { - margin-bottom: 16px; - color: #666; -} +.import-box p { margin-bottom: 16px; color: #666; } /* Responsive */ -@media (max-width: 640px) { +@media (max-width: 768px) { .container { padding: 12px; } .header { padding: 16px; } - .component-card { padding: 16px; } - .card-body { grid-template-columns: 1fr; } - .card-price { justify-self: start; } + .config-table-wrap { overflow-x: auto; } + .config-table { min-width: 700px; } .form-row { grid-template-columns: 1fr; } } @@ -491,7 +444,6 @@ body {
-

PC装机配置表

@@ -504,12 +456,11 @@ body {
- -
+
-