Compare commits

..

1 Commits

Author SHA1 Message Date
c68d1062ff style: 前端视觉与 mainPage 协调,浅色极简 + 靛蓝主色
- global.css 加设计令牌(与 mainPage variables.css 对齐:bg/surface/accent/
  border/text/success/danger/warn/radius/shadow/transition)
- App.vue 顶栏由深色(#2c3e50)改浅色(surface + border),视图切换器改分段样式
- 全部组件硬编码颜色令牌化:accent(主操作)/success(下载)/danger(删除)/
  warn(单次徽章)/surface/border/text-*
- 表单输入加 focus 描边、按钮统一 border+radius、阴影用令牌
- 月/周预览表头改浅灰、今日高亮改 accent-weak,网格边线用 border 令牌
- 事件配色 PALETTE 不变(数据可视化需高区分度)
- 独立运行 42 测试通过、build 通过
2026-07-23 04:24:04 +00:00
9 changed files with 222 additions and 148 deletions

View File

@@ -48,18 +48,21 @@ const { isLoaded, state, setViewMode } = useCalendar()
<style scoped>
/* scoped样式仅作用于本组件作为组件被嵌入时不污染宿主。
全局重置* / body已移至 src/styles/global.css,仅独立 app 加载。 */
全局重置与设计令牌在 src/styles/global.css独立 app/ 宿主 :root嵌入时。 */
.ttf-app {
display: flex;
flex-direction: column;
/* 适配嵌入:填满宿主 <main> 区域;独立 app 下 body 仍提供背景 */
/* 适配嵌入:填满宿主容器;独立 app 下 body 仍提供背景 */
min-height: 0;
height: 100%;
background: var(--bg);
color: var(--text-primary);
}
.ttf-header {
background: #2c3e50;
color: #fff;
padding: 14px 24px;
background: var(--surface);
color: var(--text-primary);
border-bottom: 1px solid var(--border);
padding: 12px 20px;
display: flex;
justify-content: space-between;
align-items: center;
@@ -68,30 +71,39 @@ const { isLoaded, state, setViewMode } = useCalendar()
.ttf-header-left {
display: flex;
align-items: center;
gap: 24px;
gap: 20px;
}
.ttf-header h1 {
font-size: 16px;
font-weight: 600;
white-space: nowrap;
color: var(--text-primary);
}
.ttf-header h1 { font-size: 18px; font-weight: 600; white-space: nowrap; }
.ttf-view-switcher {
display: flex;
background: #1a252f;
border-radius: 6px;
overflow: hidden;
gap: 2px;
background: var(--surface-2);
border-radius: var(--radius-sm);
padding: 2px;
}
.ttf-view-switcher button {
background: transparent;
color: #bdc3c7;
color: var(--text-secondary);
border: none;
padding: 6px 16px;
padding: 5px 14px;
font-size: 13px;
border-radius: 6px;
cursor: pointer;
transition: all 0.15s;
transition: all var(--transition);
}
.ttf-view-switcher button:hover { color: #fff; }
.ttf-view-switcher button:hover { color: var(--text-primary); }
.ttf-view-switcher button.active {
background: #3498db;
color: #fff;
background: var(--bg);
color: var(--accent);
font-weight: 600;
box-shadow: var(--shadow);
}
.ttf-main { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.ttf-main { flex: 1; display: flex; overflow: hidden; min-height: 0; background: var(--bg); }
.ttf-detail-area { flex: 1; overflow-y: auto; }
/* 移动端适配 */
@@ -106,8 +118,8 @@ const { isLoaded, state, setViewMode } = useCalendar()
justify-content: space-between;
gap: 12px;
}
.ttf-header h1 { font-size: 15px; }
.ttf-view-switcher button { padding: 5px 10px; font-size: 12px; }
.ttf-header h1 { font-size: 14px; }
.ttf-view-switcher button { padding: 4px 10px; font-size: 12px; }
.ttf-main { flex-direction: column; }
}
</style>

View File

@@ -55,39 +55,39 @@ function onPick(e) {
display: flex;
align-items: center;
justify-content: center;
border: 2px dashed #bdc3c7;
border-radius: 12px;
border: 2px dashed var(--border-strong);
border-radius: var(--radius);
margin: 40px;
transition: all 0.2s;
transition: all var(--transition);
}
.dropzone.active {
border-color: #3498db;
background: #eaf4fc;
border-color: var(--accent);
background: var(--accent-weak);
}
.dropzone-content {
text-align: center;
}
.hint {
color: #7f8c8d;
color: var(--text-secondary);
font-size: 14px;
margin-bottom: 16px;
}
.pick-btn {
display: inline-block;
padding: 10px 24px;
background: #3498db;
background: var(--accent);
color: #fff;
border-radius: 8px;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: background 0.15s;
transition: background var(--transition);
}
.pick-btn:hover {
background: #2980b9;
background: var(--accent-hover);
}
.error {
color: #e74c3c;
color: var(--danger);
font-size: 13px;
margin-top: 16px;
}

View File

@@ -198,22 +198,22 @@ function onToggleOcc(date) {
.empty {
text-align: center;
padding: 60px 20px;
color: #95a5a6;
color: var(--text-tertiary);
}
.section-title {
font-size: 15px;
font-weight: 700;
color: #2c3e50;
color: var(--text-primary);
margin: 20px 0 12px;
padding-bottom: 8px;
border-bottom: 2px solid #ecf0f1;
border-bottom: 2px solid var(--border);
}
.form-group { margin-bottom: 16px; }
.form-group label {
display: block;
font-size: 13px;
font-weight: 600;
color: #34495e;
color: var(--text-secondary);
margin-bottom: 5px;
}
.form-group input,
@@ -221,10 +221,19 @@ function onToggleOcc(date) {
.form-group select {
width: 100%;
padding: 8px 12px;
border: 1px solid #d5dbdb;
border-radius: 6px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
font-size: 13px;
font-family: inherit;
background: var(--bg);
color: var(--text-primary);
transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
outline: none;
border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 16px; }
@@ -234,35 +243,38 @@ function onToggleOcc(date) {
gap: 8px;
margin-top: 20px;
padding-top: 16px;
border-top: 1px solid #ecf0f1;
border-top: 1px solid var(--border);
}
.btn {
padding: 7px 16px;
border: none;
border-radius: 6px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: background 0.15s;
transition: all var(--transition);
background: var(--bg);
color: var(--text-primary);
}
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-secondary { background: #ecf0f1; color: #2c3e50; }
.btn-secondary:hover { background: #d5dbdb; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--bg); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--surface); color: var(--text-primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.split-panel {
margin-top: 16px;
padding: 16px;
background: #f8f9fa;
border-radius: 8px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.split-panel p { width: 100%; font-size: 13px; color: #7f8c8d; margin-bottom: 8px; }
.split-panel input { padding: 6px 10px; border: 1px solid #d5dbdb; border-radius: 6px; }
.split-panel p { width: 100%; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.split-panel input { padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
@media (max-width: 768px) {
.detail { padding: 16px; }

View File

@@ -42,38 +42,39 @@ function dowFor(ev) {
<style scoped>
.event-list {
width: 340px;
background: #fff;
border-right: 1px solid #e0e3e6;
background: var(--bg);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
}
.stat { font-size: 12px; color: #95a5a6; padding: 12px 16px 8px; }
.stat { font-size: 12px; color: var(--text-tertiary); padding: 12px 16px 8px; }
.add-btn {
margin: 0 16px 8px;
padding: 8px;
border: 1px dashed #3498db;
background: #eaf4fc;
color: #2980b9;
border-radius: 6px;
border: 1px dashed var(--accent);
background: var(--accent-weak);
color: var(--accent);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 13px;
transition: background var(--transition);
}
.add-btn:hover { background: #d4eaf9; }
.add-btn:hover { background: var(--surface-2); }
.list { flex: 1; overflow-y: auto; }
.event-item {
padding: 12px 16px;
border-bottom: 1px solid #eef0f2;
border-bottom: 1px solid var(--border);
cursor: pointer;
transition: background 0.12s;
transition: background var(--transition);
}
.event-item:hover { background: #f8f9fa; }
.event-item:hover { background: var(--surface); }
.event-item.active {
background: #eaf4fc;
border-left: 3px solid #3498db;
background: var(--accent-weak);
border-left: 3px solid var(--accent);
}
.title { font-weight: 600; font-size: 14px; color: #2c3e50; margin-bottom: 3px; }
.meta { font-size: 12px; color: #7f8c8d; }
.title { font-weight: 600; font-size: 14px; color: var(--text-primary); margin-bottom: 3px; }
.meta { font-size: 12px; color: var(--text-secondary); }
.badge {
display: inline-block;
padding: 1px 7px;
@@ -82,15 +83,15 @@ function dowFor(ev) {
font-weight: 600;
margin-left: 6px;
}
.badge-recur { background: #e8f5e9; color: #2e7d32; }
.badge-single { background: #fff3e0; color: #e65100; }
.badge-recur { background: var(--success-weak); color: var(--success); }
.badge-single { background: var(--warn-weak); color: var(--warn); }
@media (max-width: 768px) {
.event-list {
width: 100%;
max-height: 40vh;
border-right: none;
border-bottom: 1px solid #e0e3e6;
border-bottom: 1px solid var(--border);
}
}
</style>

View File

@@ -51,24 +51,26 @@ function onDownload() {
</template>
<style scoped>
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.btn {
padding: 7px 16px;
border: none;
border-radius: 6px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: background 0.15s;
transition: all var(--transition);
white-space: nowrap;
background: var(--bg);
color: var(--text-primary);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2980b9; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover:not(:disabled) { background: #229954; }
.btn-secondary { background: #ecf0f1; color: #2c3e50; }
.btn-secondary:hover:not(:disabled) { background: #d5dbdb; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(0.92); }
.btn-secondary { background: var(--bg); color: var(--text-secondary); }
.btn-secondary:hover:not(:disabled) { background: var(--surface); color: var(--text-primary); }
@media (max-width: 768px) {
.header-actions { gap: 6px; }

View File

@@ -135,20 +135,21 @@ function hideTooltip() {
}
.nav-btn {
padding: 5px 14px;
border: 1px solid #d5dbdb;
border-radius: 6px;
background: #fff;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
background: var(--bg);
cursor: pointer;
font-size: 13px;
color: #2c3e50;
color: var(--text-primary);
transition: background var(--transition);
}
.nav-btn:hover { background: #ecf0f1; }
.today-btn { border-color: #3498db; color: #3498db; font-weight: 600; }
.today-btn:hover { background: #eaf4fc; }
.nav-btn:hover { background: var(--surface); }
.today-btn { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.today-btn:hover { background: var(--accent-weak); }
.month-label {
font-size: 16px;
font-weight: 600;
color: #2c3e50;
color: var(--text-primary);
min-width: 140px;
text-align: center;
}
@@ -158,33 +159,33 @@ function hideTooltip() {
grid-template-columns: repeat(7, 1fr);
grid-auto-rows: 1fr;
gap: 1px;
background: #e0e3e6;
border: 1px solid #e0e3e6;
border-radius: 8px;
background: var(--border);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
overflow: hidden;
}
.grid-header {
background: #2c3e50;
color: #fff;
background: var(--surface-2);
color: var(--text-secondary);
text-align: center;
font-size: 13px;
font-weight: 600;
padding: 8px 0;
}
.grid-cell {
background: #fff;
background: var(--bg);
padding: 4px 6px;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
.grid-cell.out-of-month { background: #f8f9fa; }
.grid-cell.out-of-month .day-num { color: #bdc3c7; }
.grid-cell.is-today { background: #eaf4fc; }
.grid-cell.out-of-month { background: var(--surface); }
.grid-cell.out-of-month .day-num { color: var(--text-tertiary); }
.grid-cell.is-today { background: var(--accent-weak); }
.grid-cell.is-today .day-num {
color: #fff;
background: #3498db;
background: var(--accent);
border-radius: 50%;
width: 22px;
height: 22px;
@@ -196,7 +197,7 @@ function hideTooltip() {
.day-num {
font-size: 13px;
font-weight: 600;
color: #2c3e50;
color: var(--text-primary);
margin-bottom: 2px;
}
.event-list {
@@ -220,10 +221,10 @@ function hideTooltip() {
bottom: 16px;
right: 16px;
max-width: 320px;
background: #fff;
border: 1px solid #d5dbdb;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
background: var(--bg);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
box-shadow: var(--shadow-hover);
padding: 12px 16px;
z-index: 100;
font-size: 13px;
@@ -231,15 +232,15 @@ function hideTooltip() {
.tooltip-title {
font-size: 14px;
font-weight: 700;
color: #2c3e50;
color: var(--text-primary);
margin-bottom: 6px;
}
.tooltip-row {
color: #34495e;
color: var(--text-secondary);
margin-bottom: 3px;
}
.tooltip-desc {
color: #7f8c8d;
color: var(--text-tertiary);
margin-top: 6px;
white-space: pre-wrap;
word-break: break-all;

View File

@@ -39,7 +39,7 @@ function dowFor(dateStr) {
<style scoped>
.hint {
font-size: 12px;
color: #7f8c8d;
color: var(--text-secondary);
margin-bottom: 8px;
}
.occ-grid {
@@ -52,24 +52,26 @@ function dowFor(dateStr) {
}
.occ {
padding: 8px 10px;
border: 1px solid #d5dbdb;
border-radius: 6px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 12px;
text-align: center;
transition: all 0.12s;
transition: all var(--transition);
background: var(--bg);
color: var(--text-primary);
}
.occ:hover { border-color: #3498db; }
.occ:hover { border-color: var(--accent); }
.occ.skipped {
background: #fce4ec;
border-color: #e74c3c;
color: #c0392b;
background: var(--danger-weak);
border-color: var(--danger);
color: var(--danger);
text-decoration: line-through;
}
.occ.active {
background: #e8f5e9;
border-color: #27ae60;
color: #1e7d32;
background: var(--success-weak);
border-color: var(--success);
color: var(--success);
}
.dow { font-size: 10px; color: #95a5a6; }
.dow { font-size: 10px; color: var(--text-tertiary); }
</style>

View File

@@ -241,35 +241,36 @@ function tooltip(ev) {
}
.nav-btn {
padding: 5px 14px;
border: 1px solid #d5dbdb;
border-radius: 6px;
background: #fff;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
background: var(--bg);
cursor: pointer;
font-size: 13px;
color: #2c3e50;
color: var(--text-primary);
transition: background var(--transition);
}
.nav-btn:hover { background: #ecf0f1; }
.today-btn { border-color: #3498db; color: #3498db; font-weight: 600; }
.today-btn:hover { background: #eaf4fc; }
.collapse-btn { border-color: #9b59b6; color: #9b59b6; font-weight: 600; }
.collapse-btn:hover { background: #f4ecf7; }
.nav-btn:hover { background: var(--surface); }
.today-btn { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.today-btn:hover { background: var(--accent-weak); }
.collapse-btn { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.collapse-btn:hover { background: var(--accent-weak); }
.empty-hint {
font-size: 13px;
color: #95a5a6;
color: var(--text-tertiary);
font-style: italic;
}
.week-label {
font-size: 16px;
font-weight: 600;
color: #2c3e50;
color: var(--text-primary);
min-width: 200px;
text-align: center;
}
.week-grid-wrapper {
flex: 1;
overflow: auto;
border: 1px solid #e0e3e6;
border-radius: 8px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
}
.week-grid {
display: flex;
@@ -278,28 +279,28 @@ function tooltip(ev) {
.time-col {
width: 56px;
flex-shrink: 0;
border-right: 1px solid #e0e3e6;
border-right: 1px solid var(--border);
}
.time-spacer {
height: 40px;
border-bottom: 1px solid #e0e3e6;
border-bottom: 1px solid var(--border);
}
.time-slot {
font-size: 11px;
color: #95a5a6;
color: var(--text-tertiary);
text-align: right;
padding-right: 6px;
border-bottom: 1px solid #f0f0f0;
border-bottom: 1px solid var(--surface-2);
}
/* 非工作时段 (8:00 前 / 22:00 后) 淡灰 */
.time-slot.off-hour {
color: #c4ccd0;
background: #f7f8f9;
color: var(--text-tertiary);
background: var(--surface);
}
.day-col {
flex: 1;
min-width: 0;
border-right: 1px solid #e0e3e6;
border-right: 1px solid var(--border);
}
.day-col:last-child { border-right: none; }
.day-header {
@@ -310,13 +311,13 @@ function tooltip(ev) {
justify-content: center;
font-size: 12px;
font-weight: 600;
color: #2c3e50;
border-bottom: 1px solid #e0e3e6;
background: #f8f9fa;
color: var(--text-primary);
border-bottom: 1px solid var(--border);
background: var(--surface);
}
.day-header.is-today {
background: #eaf4fc;
color: #3498db;
background: var(--accent-weak);
color: var(--accent);
}
.day-date {
font-size: 14px;
@@ -329,10 +330,10 @@ function tooltip(ev) {
position: absolute;
left: 0;
right: 0;
border-bottom: 1px solid #f0f0f0;
border-bottom: 1px solid var(--surface-2);
}
.hour-line.off-hour {
background: #f7f8f9;
background: var(--surface);
}
.event-block {
position: absolute;

View File

@@ -1,9 +1,52 @@
/* 全局重置 -- 仅独立 appmain.js加载。
作为组件被嵌入时由宿主提供重置,本文件不参与,避免污染宿主。 */
/* 全局重置 + 设计令牌 -- 仅独立 appmain.js加载。
作为组件被嵌入时由宿主(mainPage)提供 :root 令牌,本文件的重置仍安全(与宿主一致)。
令牌值与 mainPage src/styles/variables.css 对齐,保证独立与嵌入视觉一致。 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
background: #f5f6f8;
color: #222;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Microsoft YaHei", sans-serif;
background: var(--bg, #ffffff);
color: var(--text-primary, #1f2329);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
:root {
/* 背景/表面 */
--bg: #ffffff;
--surface: #f7f8fa;
--surface-2: #f0f2f5;
/* 文字 */
--text-primary: #1f2329;
--text-secondary: #6b7280;
--text-tertiary: #9ca3af;
/* 强调色(靛蓝,与 mainPage 一致) */
--accent: #4f46e5;
--accent-weak: #eef2ff;
--accent-hover: #4338ca;
/* 线/边 */
--border: #eceef1;
--border-strong: #e0e2e6;
/* 语义色 */
--success: #2e7d32;
--success-weak: #e8f5e9;
--danger: #c62828;
--danger-weak: #fbe9e7;
--warn: #e65100;
--warn-weak: #fff3e0;
/* 圆角 */
--radius-sm: 8px;
--radius: 12px;
/* 阴影 */
--shadow: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
--shadow-hover: 0 6px 16px rgba(17, 24, 39, 0.08), 0 2px 6px rgba(17, 24, 39, 0.05);
/* 过渡 */
--transition: 0.18s ease;
}