feat: 新增作息报时器功能并替换短链接前缀为/to/
- 新增作息报时器独立模块,包含完整的日程管理、语音播报和待机功能 - 短链接正式前缀由/l/改为/to/,解决手机小屏下与I、i、1字形混淆问题 - 保留旧前缀/l/、/L/、/I/、/i/兼容已分发的旧短链 - 新增短码大小写兜底匹配,仅唯一匹配时生效避免歧义 - 新增防爆紧急替换功能,可轮换首页鉴权并替换短链接 - 新增多个调试和集成测试脚本,保障数据安全和功能回归
This commit is contained in:
@@ -65,7 +65,9 @@ input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
|
||||
/* ============================================================
|
||||
视图骨架
|
||||
============================================================ */
|
||||
.view { min-height: 100dvh; display: flex; flex-direction: column; }
|
||||
/* 老浏览器(如老版 iOS Safari)不支持 dvh / inset 简写,会整条丢弃该声明。
|
||||
凡是用到这些新特性处,先写一份等效的传统写法兜底,再写新写法做渐进增强。 */
|
||||
.view { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
|
||||
.page { animation: fadeUp 0.25s ease both; }
|
||||
|
||||
/* ============================================================
|
||||
@@ -218,9 +220,12 @@ input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
|
||||
/* ============================================================
|
||||
Modal(底部抽屉 / 全屏)
|
||||
============================================================ */
|
||||
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.58); z-index: 100; display: flex; flex-direction: column; justify-content: flex-end; animation: fadeIn 0.2s ease both; }
|
||||
/* 关键:inset: 0 在老 iOS(<14.1)不被支持,会被整条丢弃,
|
||||
遮罩将失去定位而跑到文档静态位置(视口外)→ 全屏弹窗和按钮都看不见。
|
||||
因此这里改写成四条独立定位,任何浏览器都认。 */
|
||||
.modal-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,0.58); z-index: 100; display: flex; flex-direction: column; justify-content: flex-end; animation: fadeIn 0.2s ease both; }
|
||||
.modal-fullscreen { justify-content: stretch; align-items: stretch; }
|
||||
.modal-sheet { width: 100%; background: var(--bg); border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92dvh; display: flex; flex-direction: column; animation: slideUp 0.3s ease-out both; border-top: 1px solid var(--border); }
|
||||
.modal-sheet { width: 100%; background: var(--bg); border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; animation: slideUp 0.3s ease-out both; border-top: 1px solid var(--border); }
|
||||
.sheet-header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
|
||||
.sheet-title { font-size: 18px; font-weight: 600; }
|
||||
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; }
|
||||
@@ -232,14 +237,14 @@ input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
|
||||
/* ============================================================
|
||||
通用弹窗 / 交互详情弹窗
|
||||
============================================================ */
|
||||
.dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease both; }
|
||||
.dialog-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease both; }
|
||||
.dialog-box { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; max-width: 340px; width: calc(100% - 48px); animation: scaleIn 0.2s ease both; border: 1px solid var(--border); box-shadow: 0 16px 48px rgba(0,0,0,0.5); }
|
||||
.dialog-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
|
||||
.dialog-body { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; white-space: pre-wrap; word-break: break-word; }
|
||||
.dialog-actions { display: flex; flex-direction: row; gap: 8px; justify-content: flex-end; }
|
||||
.dialog-header-row { display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 12px; }
|
||||
.dialog-header-row .dialog-title { margin-bottom: 0; }
|
||||
.dialog-interaction { max-width: 420px; max-height: 80dvh; display: flex; flex-direction: column; }
|
||||
.dialog-interaction { max-width: 420px; max-height: 80vh; max-height: 80dvh; display: flex; flex-direction: column; }
|
||||
.interaction-content { flex: 1; overflow-y: auto; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 12px; font-size: 12px; line-height: 1.5; color: var(--text-secondary); white-space: pre-wrap; word-break: break-all; margin-bottom: 16px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
|
||||
.btn-copy { color: var(--text-secondary); }
|
||||
.btn-copy:hover { color: var(--primary); }
|
||||
@@ -361,7 +366,7 @@ input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
|
||||
执行器(全屏)— 匹配 JS 实际 class 名
|
||||
============================================================ */
|
||||
.runner-container {
|
||||
width: 100%; height: 100dvh; background: var(--bg);
|
||||
width: 100%; height: 100vh; height: 100dvh; background: var(--bg);
|
||||
display: flex; flex-direction: column; padding: 20px;
|
||||
padding-top: calc(20px + env(safe-area-inset-top));
|
||||
overflow-y: auto; animation: fadeIn 0.25s ease both;
|
||||
@@ -438,11 +443,12 @@ input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
|
||||
}
|
||||
.runner-col-left .runner-next-card { margin-bottom: 0; }
|
||||
.runner-timer {
|
||||
font-size: 90px; /* 老浏览器兜底:不认识 clamp 时用这个 */
|
||||
font-size: clamp(72px, 14vw, 128px);
|
||||
margin: 8px 0 16px;
|
||||
}
|
||||
.runner-current { font-size: clamp(28px, 4.2vw, 46px); }
|
||||
.runner-next { font-size: clamp(22px, 3vw, 34px); }
|
||||
.runner-current { font-size: 34px; font-size: clamp(28px, 4.2vw, 46px); }
|
||||
.runner-next { font-size: 26px; font-size: clamp(22px, 3vw, 34px); }
|
||||
}
|
||||
|
||||
/* 当前动作名 — JS 用 .runner-current */
|
||||
@@ -497,3 +503,107 @@ input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
|
||||
.runner-global-stats { font-size: 13px; color: var(--text-secondary); text-align: center; font-variant-numeric: tabular-nums; display: flex; flex-direction: row; justify-content: center; gap: 4px; flex-wrap: wrap; }
|
||||
.runner-global-divider { color: var(--text-disabled); }
|
||||
.runner-global-remaining { color: var(--text-secondary); }
|
||||
|
||||
/* ============================================================
|
||||
作息报时器 — 待机大屏
|
||||
============================================================ */
|
||||
.standby-panel {
|
||||
margin-top: 8px; margin-bottom: 16px; padding: 24px 16px;
|
||||
background: var(--surface); border: 1px solid var(--border);
|
||||
border-radius: var(--radius-xl); text-align: center;
|
||||
animation: fadeUp 0.3s ease both;
|
||||
}
|
||||
.standby-panel.is-live { border-color: rgba(74,222,128,0.35); }
|
||||
.standby-clock {
|
||||
/* 先给 vw 兜底(老浏览器不认识 clamp,会丢下一条,但认得 vw,取值一致);
|
||||
再用 clamp 做上限控制,避免大屏上无限变大 */
|
||||
font-size: 17vw; font-size: clamp(56px, 17vw, 104px);
|
||||
font-weight: 700; color: var(--primary);
|
||||
line-height: 1; letter-spacing: 2px; font-variant-numeric: tabular-nums;
|
||||
text-shadow: 0 0 36px rgba(240,179,95,0.28);
|
||||
}
|
||||
.standby-date { font-size: 15px; color: var(--text-secondary); margin-top: 10px; }
|
||||
.standby-next { font-size: 18px; font-weight: 600; margin-top: 16px; line-height: 1.4; word-break: break-word; }
|
||||
.standby-status { font-size: 13px; color: var(--text-disabled); margin-top: 6px; }
|
||||
.standby-panel.is-live .standby-status { color: var(--success); }
|
||||
.standby-actions { margin-top: 18px; display: flex; justify-content: center; }
|
||||
.standby-btn { padding: 12px 32px; font-size: 16px; }
|
||||
|
||||
/* 错过显示条:复用 stale-warning 结构,橙色警示 */
|
||||
.missed-warning { background: rgba(251,191,36,0.05); }
|
||||
.missed-line { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
|
||||
|
||||
/* ============================================================
|
||||
作息报时器 — 日程卡片与时刻预览
|
||||
============================================================ */
|
||||
.sched-item-preview { margin-top: 8px; }
|
||||
.sched-preview-line { font-size: 13px; color: var(--text-secondary); line-height: 1.6; font-variant-numeric: tabular-nums; }
|
||||
.sched-preview-line .sched-preview-time { color: var(--primary); font-weight: 600; margin-right: 6px; }
|
||||
.sched-preview-more { font-size: 13px; color: var(--text-disabled); font-style: italic; line-height: 1.6; }
|
||||
.sched-active-tag {
|
||||
display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
|
||||
background: rgba(74,222,128,0.15); color: var(--success); margin-left: 8px;
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
作息报时器 — 编辑器
|
||||
============================================================ */
|
||||
.weekday-row { display: flex; flex-direction: row; gap: 6px; flex-wrap: wrap; }
|
||||
.weekday-chip {
|
||||
flex: 1; min-width: 0; padding: 10px 2px; text-align: center;
|
||||
background: var(--surface-strong); border-radius: var(--radius-sm);
|
||||
color: var(--text-secondary); font-size: 13px; white-space: nowrap;
|
||||
transition: background 0.2s, color 0.2s, transform 0.15s;
|
||||
}
|
||||
.weekday-chip:hover { color: var(--text); }
|
||||
.weekday-chip:active { transform: scale(0.94); }
|
||||
.weekday-chip.active { background: var(--primary); color: #081018; font-weight: 600; }
|
||||
|
||||
.sched-item-editor {
|
||||
background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
|
||||
border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px;
|
||||
animation: fadeUp 0.25s ease both;
|
||||
}
|
||||
.sched-time-input {
|
||||
width: 130px; font-size: 16px; padding: 10px 12px; background: var(--bg);
|
||||
font-variant-numeric: tabular-nums; color-scheme: dark; margin-bottom: 8px;
|
||||
}
|
||||
.sched-item-editor .step-badge { background: var(--primary); color: #081018; }
|
||||
.sched-item-editor .step-index { font-variant-numeric: tabular-nums; }
|
||||
.sched-item-row-2 { display: flex; flex-direction: row; gap: 10px; margin-top: 8px; }
|
||||
.sched-item-row-2 .sched-field { flex: 1; min-width: 0; }
|
||||
.sched-field-label { display: block; font-size: 12px; color: var(--text-disabled); margin-bottom: 4px; }
|
||||
.sched-number-input { width: 100%; font-size: 14px; padding: 10px 12px; background: var(--bg); }
|
||||
.sched-item-hint { font-size: 12px; color: var(--text-disabled); margin-top: 8px; line-height: 1.5; }
|
||||
|
||||
/* ============================================================
|
||||
作息报时器 — 播报全屏
|
||||
============================================================ */
|
||||
.sched-alert-container {
|
||||
width: 100%; height: 100vh; height: 100dvh; background: var(--bg);
|
||||
display: flex; flex-direction: column; align-items: center; justify-content: center;
|
||||
gap: 14px; padding: 24px; padding-top: calc(24px + env(safe-area-inset-top));
|
||||
text-align: center; animation: fadeIn 0.25s ease both;
|
||||
}
|
||||
.sched-alert-badge {
|
||||
padding: 4px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
|
||||
border: 1px solid var(--primary); color: var(--primary); background: var(--primary-soft);
|
||||
}
|
||||
.sched-alert-time {
|
||||
font-size: 20vw; font-size: clamp(64px, 20vw, 128px);
|
||||
font-weight: 700; color: var(--primary);
|
||||
line-height: 1; letter-spacing: 2px; font-variant-numeric: tabular-nums;
|
||||
text-shadow: 0 0 48px rgba(240,179,95,0.4);
|
||||
}
|
||||
.sched-alert-name { font-size: 34px; font-weight: 700; line-height: 1.25; word-break: break-word; }
|
||||
.sched-alert-repeat { font-size: 15px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
|
||||
.sched-alert-ack {
|
||||
margin-top: 24px; width: 100%; max-width: 360px; justify-content: center;
|
||||
padding: 18px; font-size: 20px;
|
||||
}
|
||||
|
||||
/* 记录页条目 */
|
||||
.sched-log-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
|
||||
.sched-log-badge.badge-fired { background: rgba(240,179,95,0.15); color: var(--primary); }
|
||||
.sched-log-badge.badge-acked { background: rgba(74,222,128,0.15); color: var(--success); }
|
||||
.sched-log-badge.badge-missed { background: rgba(239,68,68,0.15); color: var(--error); }
|
||||
|
||||
Reference in New Issue
Block a user