Add settings page with synced appearance and password change
- Store app settings as one JSON document on the server, merged per key and pushed to other devices; cache locally to avoid a flash on load - Settings page groups appearance, account, shortcuts, shares, API tokens and trash; full screen with a section list on phones - Font size and content width settings - Change the login password, signing out other sessions - Settings writes and password changes only accept a login session
This commit is contained in:
1 parent
5b326a70bf
commit
eb63b14c8e
25 files changed
+915
-290
No files matched your search
@@ -378,6 +378,32 @@ button {
|
||||
.rm-token-created p { margin: 0 0 6px; }
|
||||
.rm-token-value { display: flex; align-items: center; gap: 8px; }
|
||||
.rm-token-value code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--rm-font-mono); font-size: 12px; user-select: all; }
|
||||
/* ---- 设置 ---- */
|
||||
.rm-settings { flex-direction: row; max-width: 820px; height: min(640px, 85vh); max-height: none; overflow: hidden; }
|
||||
.rm-settings-nav { flex: none; width: 190px; display: flex; flex-direction: column; gap: 2px; padding: 0 8px 12px; border-right: 1px solid var(--rm-divider); overflow-y: auto; }
|
||||
.rm-settings-nav .rm-dialog-head { padding-left: 12px; }
|
||||
.rm-settings-close-list,
|
||||
.rm-settings-back { display: none; }
|
||||
.rm-settings-tab { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--rm-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
|
||||
.rm-settings-tab:hover { background: var(--rm-hover); }
|
||||
.rm-settings-tab.on { background: var(--rm-selection); color: var(--rm-accent-strong); font-weight: 600; }
|
||||
.rm-settings-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
||||
.rm-settings-content { flex: 1; overflow-y: auto; padding-bottom: 16px; }
|
||||
.rm-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 6px 20px; }
|
||||
.rm-setting-label { font-size: 14px; }
|
||||
.rm-setting select { height: 34px; padding: 0 8px; border: 1px solid var(--rm-divider); border-radius: 6px; background: var(--rm-bg); color: var(--rm-text); font-size: 14px; }
|
||||
.rm-segmented { display: inline-flex; border: 1px solid var(--rm-divider); border-radius: 8px; overflow: hidden; }
|
||||
.rm-segmented button { height: 32px; padding: 0 14px; border: 0; border-left: 1px solid var(--rm-divider); background: none; color: var(--rm-text); font: inherit; font-size: 13px; cursor: pointer; }
|
||||
.rm-segmented button:first-child { border-left: 0; }
|
||||
.rm-segmented button.on { background: var(--rm-accent); color: #fff; }
|
||||
.rm-settings-form { max-width: 360px; padding: 4px 20px 16px; }
|
||||
.rm-settings-form h3 { margin: 0; font-size: 15px; }
|
||||
.rm-shortcuts { width: calc(100% - 40px); margin: 0 20px; border-collapse: collapse; font-size: 14px; }
|
||||
.rm-shortcuts td { padding: 8px 0; border-bottom: 1px solid var(--rm-divider); }
|
||||
.rm-shortcuts td:last-child { text-align: right; }
|
||||
.rm-shortcuts kbd { font-family: var(--rm-font-mono); font-size: 12px; padding: 2px 6px; border: 1px solid var(--rm-divider); border-radius: 4px; background: var(--rm-inline-code-bg); }
|
||||
.flip { transform: rotate(180deg); }
|
||||
|
||||
.rm-trash-list { list-style: none; margin: 0; padding: 0 12px 12px; overflow: auto; }
|
||||
.rm-trash-list li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--rm-text-muted); }
|
||||
.rm-trash-list li:hover { background: var(--rm-hover); }
|
||||
@@ -403,6 +429,16 @@ button {
|
||||
|
||||
/* ---- 移动端 ---- */
|
||||
@media (max-width: 768px) {
|
||||
/* 设置在手机上全屏,一次只显示分组列表或分组内容 */
|
||||
.rm-dialog-backdrop:has(.rm-settings) { padding: 0; }
|
||||
.rm-settings { max-width: none; height: 100%; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
|
||||
.rm-settings-nav { width: auto; flex: 1; border-right: 0; display: none; }
|
||||
.rm-settings.show-list .rm-settings-nav { display: flex; }
|
||||
.rm-settings.show-list .rm-settings-body { display: none; }
|
||||
.rm-settings-tab { height: 48px; font-size: 16px; }
|
||||
.rm-settings-close-list,
|
||||
.rm-settings-back { display: inline-flex; width: 40px; height: 40px; }
|
||||
.rm-setting { flex-wrap: wrap; }
|
||||
.rm-sidebar {
|
||||
position: fixed;
|
||||
inset: 0 auto 0 0;
|
||||
@@ -434,6 +470,11 @@ button {
|
||||
.rm-sidebar-head .rm-icon-btn { width: 40px; height: 40px; }
|
||||
/* 小于 16px 时 iOS Safari 聚焦输入框会自动放大页面 */
|
||||
.rm-search-input { height: 40px; font-size: 16px; }
|
||||
.rm-auth-card input,
|
||||
.rm-share-form input,
|
||||
.rm-share-form select,
|
||||
.rm-setting select { font-size: 16px; }
|
||||
.rm-share-form { flex-wrap: wrap; }
|
||||
.rm-search-item { padding: 10px 8px; }
|
||||
/* 手机上从顶部弹出,给软键盘留出空间 */
|
||||
.rm-switcher-backdrop { padding-top: calc(8px + env(safe-area-inset-top)); }
|
||||
|
||||
Reference in new issue
Block a user