Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a8ef8222c8 | |||
| 374ab1c606 | |||
| 5adb6eaec3 |
+331
-86
@@ -35,6 +35,7 @@ import {
|
||||
RefreshCw,
|
||||
Download,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
} from "lucide-react";
|
||||
import {
|
||||
digital,
|
||||
@@ -130,6 +131,14 @@ export function DigitalHome({
|
||||
const [profileDraft, setProfileDraft] = useState<Profile | null>(
|
||||
initial.profile,
|
||||
);
|
||||
const [selectionSheet, setSelectionSheet] = useState<
|
||||
"style" | "books" | null
|
||||
>(null);
|
||||
const [choiceDraft, setChoiceDraft] = useState<{
|
||||
presetId?: string;
|
||||
bookIds: string[];
|
||||
}>({ bookIds: [] });
|
||||
const selectionTrigger = useRef<HTMLElement | null>(null);
|
||||
const favoritePending = useRef(false);
|
||||
const [activeMessage, setActiveMessage] = useState<string | null>(null),
|
||||
[showJump, setShowJump] = useState(false),
|
||||
@@ -258,13 +267,20 @@ export function DigitalHome({
|
||||
);
|
||||
const controls = () =>
|
||||
Array.from(
|
||||
dialog?.querySelectorAll<HTMLElement>(
|
||||
(
|
||||
document.querySelector<HTMLElement>(".dh-selection-sheet") ?? dialog
|
||||
)?.querySelectorAll<HTMLElement>(
|
||||
'button:not([disabled]),input,textarea,select,[tabindex="0"]',
|
||||
) ?? [],
|
||||
);
|
||||
const frame = requestAnimationFrame(() => controls()[0]?.focus());
|
||||
const onKey = (event: globalThis.KeyboardEvent) => {
|
||||
if (event.key === "Escape") {
|
||||
event.preventDefault();
|
||||
if (document.querySelector(".dh-selection-sheet")) {
|
||||
setSelectionSheet(null);
|
||||
return;
|
||||
}
|
||||
setDetail(null);
|
||||
setShowSettings(false);
|
||||
}
|
||||
@@ -288,6 +304,35 @@ export function DigitalHome({
|
||||
previous?.focus();
|
||||
};
|
||||
}, [detail, showSettings]);
|
||||
/** 抽屉聚焦当前选项并限制滚动;取消、确认及切回桌面后恢复入口焦点。 */
|
||||
useEffect(() => {
|
||||
if (!selectionSheet) return;
|
||||
const previous = selectionTrigger.current;
|
||||
const media = window.matchMedia("(max-width: 600px)");
|
||||
const resize = () => {
|
||||
if (!media.matches) setSelectionSheet(null);
|
||||
};
|
||||
resize();
|
||||
media.addEventListener("change", resize);
|
||||
const frame = requestAnimationFrame(() => {
|
||||
const panel = document.querySelector<HTMLElement>(".dh-selection-sheet");
|
||||
(
|
||||
panel?.querySelector<HTMLElement>("input:checked") ??
|
||||
panel?.querySelector<HTMLElement>("input") ??
|
||||
panel?.querySelector<HTMLElement>("button")
|
||||
)?.focus();
|
||||
});
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
media.removeEventListener("change", resize);
|
||||
if (previous?.isConnected && previous.getClientRects().length)
|
||||
previous.focus();
|
||||
else
|
||||
document
|
||||
.querySelector<HTMLElement>(".dh-desktop-choices input:checked")
|
||||
?.focus();
|
||||
};
|
||||
}, [selectionSheet]);
|
||||
useEffect(() => {
|
||||
const id = boot?.decision.decisionId;
|
||||
if (!id || document.hidden) return;
|
||||
@@ -586,6 +631,26 @@ export function DigitalHome({
|
||||
reportError(e);
|
||||
}
|
||||
}
|
||||
/** 抽屉仅编辑临时值;确认后回填设定,取消不改动已有选择。 */
|
||||
function openSelection(kind: "style" | "books") {
|
||||
if (!settings) return;
|
||||
selectionTrigger.current = document.activeElement as HTMLElement;
|
||||
setChoiceDraft({
|
||||
presetId: settings.presetId,
|
||||
bookIds: [...settings.bookIds],
|
||||
});
|
||||
setSelectionSheet(kind);
|
||||
}
|
||||
function confirmSelection() {
|
||||
if (settings)
|
||||
setSettings({
|
||||
...settings,
|
||||
...(selectionSheet === "style"
|
||||
? { presetId: choiceDraft.presetId }
|
||||
: { bookIds: choiceDraft.bookIds }),
|
||||
});
|
||||
setSelectionSheet(null);
|
||||
}
|
||||
async function saveSettings(event: FormEvent) {
|
||||
event.preventDefault();
|
||||
if (!conversation || !settings) return;
|
||||
@@ -662,6 +727,97 @@ export function DigitalHome({
|
||||
(tag === "全部" || c.tags.includes(tag)) &&
|
||||
(!onlyFavorites || profile?.favorites.includes(c.id)),
|
||||
);
|
||||
const styleChoices = (
|
||||
value: string | undefined,
|
||||
onChange: (value: string | undefined) => void,
|
||||
inSheet = false,
|
||||
) => (
|
||||
<fieldset className="dh-style-picker">
|
||||
<legend className={inSheet ? "dh-visually-hidden" : undefined}>
|
||||
叙事风格
|
||||
</legend>
|
||||
<p className="dh-style-help">为这段故事选一种氛围</p>
|
||||
<div className="dh-style-options">
|
||||
{[
|
||||
{
|
||||
id: "",
|
||||
name: "角色默认风格",
|
||||
description: "沿用角色原有的语气与叙事节奏。",
|
||||
},
|
||||
...presets,
|
||||
...(value && !presets.some((p) => p.id === value)
|
||||
? [
|
||||
{
|
||||
id: value,
|
||||
name: "当前会话风格",
|
||||
description:
|
||||
"此风格暂不在可选列表中,可以保留或选择其他风格。",
|
||||
},
|
||||
]
|
||||
: []),
|
||||
].map((p) => (
|
||||
<label className="dh-style-option" key={p.id}>
|
||||
<input
|
||||
type="radio"
|
||||
name={
|
||||
inSheet
|
||||
? "conversation-preset-sheet"
|
||||
: "conversation-preset-inline"
|
||||
}
|
||||
value={p.id}
|
||||
checked={(value ?? "") === p.id}
|
||||
onChange={() => onChange(p.id || undefined)}
|
||||
/>
|
||||
<span className="dh-style-card">
|
||||
<span className="dh-style-symbol" aria-hidden="true">
|
||||
{p.id ? <WandSparkles /> : <Sparkles />}
|
||||
</span>
|
||||
<span className="dh-style-copy">
|
||||
<strong>{p.name}</strong>
|
||||
<small>{p.description || "以这套风格继续你们的故事。"}</small>
|
||||
</span>
|
||||
<span className="dh-style-check" aria-hidden="true">
|
||||
<Check />
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
);
|
||||
const bookChoices = (
|
||||
value: string[],
|
||||
onChange: (value: string[]) => void,
|
||||
inSheet = false,
|
||||
) => (
|
||||
<fieldset className="dh-book-picker">
|
||||
<legend className={inSheet ? "dh-visually-hidden" : undefined}>
|
||||
加入世界书
|
||||
</legend>
|
||||
{books.map((b) => (
|
||||
<label
|
||||
className={`dh-checkbox ${value.includes(b.id) ? "is-selected" : ""}`}
|
||||
key={b.id}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={value.includes(b.id)}
|
||||
onChange={(e) =>
|
||||
onChange(
|
||||
e.target.checked
|
||||
? [...value, b.id]
|
||||
: value.filter((v) => v !== b.id),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<span>
|
||||
{b.name}
|
||||
<small>{b.description}</small>
|
||||
</span>
|
||||
</label>
|
||||
))}
|
||||
</fieldset>
|
||||
);
|
||||
const modern = boot?.decision.variant === "B";
|
||||
return (
|
||||
<div
|
||||
@@ -1384,12 +1540,14 @@ export function DigitalHome({
|
||||
</div>
|
||||
)}
|
||||
{showSettings && settings && (
|
||||
<div className="dh-overlay">
|
||||
<div className={`dh-overlay ${selectionSheet ? "dh-sheet-open" : ""}`}>
|
||||
<form
|
||||
className="dh-settings"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="对话设定"
|
||||
aria-hidden={selectionSheet ? true : undefined}
|
||||
inert={selectionSheet ? true : undefined}
|
||||
onSubmit={saveSettings}
|
||||
>
|
||||
<header>
|
||||
@@ -1406,101 +1564,188 @@ export function DigitalHome({
|
||||
<X />
|
||||
</button>
|
||||
</header>
|
||||
<label>
|
||||
你的称呼
|
||||
<input
|
||||
maxLength={60}
|
||||
value={settings.userName}
|
||||
onChange={(e) =>
|
||||
setSettings({ ...settings, userName: e.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
本次身份
|
||||
<textarea
|
||||
rows={3}
|
||||
maxLength={2000}
|
||||
value={settings.persona}
|
||||
onChange={(e) =>
|
||||
setSettings({ ...settings, persona: e.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
className="dh-text-button"
|
||||
type="button"
|
||||
onClick={() =>
|
||||
setSettings({
|
||||
...settings,
|
||||
userName: profile?.userName ?? "旅人",
|
||||
persona: profile?.persona ?? "",
|
||||
})
|
||||
}
|
||||
>
|
||||
使用我的身份资料
|
||||
</button>
|
||||
<label>
|
||||
固定记忆
|
||||
<textarea
|
||||
rows={3}
|
||||
maxLength={3000}
|
||||
value={settings.memory}
|
||||
placeholder="记录你们共同经历的重要事实…"
|
||||
onChange={(e) =>
|
||||
setSettings({ ...settings, memory: e.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
叙事风格
|
||||
<select
|
||||
value={settings.presetId ?? ""}
|
||||
onChange={(e) =>
|
||||
<div className="dh-settings-body">
|
||||
<label>
|
||||
你的称呼
|
||||
<input
|
||||
maxLength={60}
|
||||
value={settings.userName}
|
||||
onChange={(e) =>
|
||||
setSettings({ ...settings, userName: e.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
本次身份
|
||||
<textarea
|
||||
rows={3}
|
||||
maxLength={2000}
|
||||
value={settings.persona}
|
||||
onChange={(e) =>
|
||||
setSettings({ ...settings, persona: e.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
className="dh-text-button"
|
||||
type="button"
|
||||
onClick={() =>
|
||||
setSettings({
|
||||
...settings,
|
||||
presetId: e.target.value || undefined,
|
||||
userName: profile?.userName ?? "旅人",
|
||||
persona: profile?.persona ?? "",
|
||||
})
|
||||
}
|
||||
>
|
||||
<option value="">角色默认风格</option>
|
||||
{presets.map((p) => (
|
||||
<option key={p.id} value={p.id}>
|
||||
{p.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<fieldset>
|
||||
<legend>加入世界书</legend>
|
||||
{books.map((b) => (
|
||||
<label className="dh-checkbox" key={b.id}>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={settings.bookIds.includes(b.id)}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
...settings,
|
||||
bookIds: e.target.checked
|
||||
? [...settings.bookIds, b.id]
|
||||
: settings.bookIds.filter((v) => v !== b.id),
|
||||
})
|
||||
}
|
||||
/>
|
||||
使用我的身份资料
|
||||
</button>
|
||||
<label>
|
||||
固定记忆
|
||||
<textarea
|
||||
rows={3}
|
||||
maxLength={3000}
|
||||
value={settings.memory}
|
||||
placeholder="记录你们共同经历的重要事实…"
|
||||
onChange={(e) =>
|
||||
setSettings({ ...settings, memory: e.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<div className="dh-mobile-choices">
|
||||
<button
|
||||
type="button"
|
||||
className="dh-choice-trigger"
|
||||
aria-label="选择叙事风格"
|
||||
onClick={() => openSelection("style")}
|
||||
>
|
||||
<WandSparkles aria-hidden="true" />
|
||||
<span>
|
||||
{b.name}
|
||||
<small>{b.description}</small>
|
||||
<strong>叙事风格</strong>
|
||||
<small>
|
||||
{presets.find((p) => p.id === settings.presetId)?.name ??
|
||||
(settings.presetId ? "当前会话风格" : "角色默认风格")}
|
||||
</small>
|
||||
</span>
|
||||
</label>
|
||||
))}
|
||||
</fieldset>
|
||||
<p className="dh-form-note">
|
||||
保存后从下一次回复生效。可以固定单条消息,将它加入对话记忆。
|
||||
</p>
|
||||
<ChevronRight aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="dh-choice-trigger"
|
||||
aria-label="选择世界书"
|
||||
onClick={() => openSelection("books")}
|
||||
>
|
||||
<BookOpen aria-hidden="true" />
|
||||
<span>
|
||||
<strong>加入世界书</strong>
|
||||
<small>
|
||||
{settings.bookIds.length
|
||||
? `已选 ${settings.bookIds.length} 本 · ${books
|
||||
.filter((b) => settings.bookIds.includes(b.id))
|
||||
.map((b) => b.name)
|
||||
.join("、")}`
|
||||
: "未加入世界书"}
|
||||
</small>
|
||||
</span>
|
||||
<ChevronRight aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
<div className="dh-desktop-choices">
|
||||
{styleChoices(settings.presetId, (value) =>
|
||||
setSettings({ ...settings, presetId: value }),
|
||||
)}
|
||||
{bookChoices(settings.bookIds, (value) =>
|
||||
setSettings({ ...settings, bookIds: value }),
|
||||
)}
|
||||
</div>
|
||||
<p className="dh-form-note">
|
||||
保存后从下一次回复生效。可以固定单条消息,将它加入对话记忆。
|
||||
</p>
|
||||
</div>
|
||||
<button className="dh-primary" type="submit">
|
||||
保存设定
|
||||
</button>
|
||||
</form>
|
||||
{selectionSheet && (
|
||||
<div className="dh-selection-layer">
|
||||
<button
|
||||
type="button"
|
||||
className="dh-selection-backdrop"
|
||||
aria-label="取消选择"
|
||||
tabIndex={-1}
|
||||
onClick={() => setSelectionSheet(null)}
|
||||
/>
|
||||
<section
|
||||
className="dh-selection-sheet"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={
|
||||
selectionSheet === "style" ? "选择叙事风格" : "选择世界书"
|
||||
}
|
||||
>
|
||||
<div className="dh-sheet-handle" aria-hidden="true" />
|
||||
<header>
|
||||
<div>
|
||||
<h2>
|
||||
{selectionSheet === "style" ? "叙事风格" : "加入世界书"}
|
||||
</h2>
|
||||
<p>
|
||||
{selectionSheet === "style"
|
||||
? "选择你喜欢的故事氛围"
|
||||
: "可选择多本,丰富角色的故事背景"}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="dh-icon"
|
||||
aria-label="关闭选择抽屉"
|
||||
onClick={() => setSelectionSheet(null)}
|
||||
>
|
||||
<X />
|
||||
</button>
|
||||
</header>
|
||||
<div className="dh-selection-body">
|
||||
{selectionSheet === "style"
|
||||
? styleChoices(
|
||||
choiceDraft.presetId,
|
||||
(value) =>
|
||||
setChoiceDraft({ ...choiceDraft, presetId: value }),
|
||||
true,
|
||||
)
|
||||
: bookChoices(
|
||||
choiceDraft.bookIds,
|
||||
(value) =>
|
||||
setChoiceDraft({ ...choiceDraft, bookIds: value }),
|
||||
true,
|
||||
)}
|
||||
</div>
|
||||
<footer>
|
||||
<button
|
||||
type="button"
|
||||
className="dh-sheet-reset"
|
||||
onClick={() =>
|
||||
setChoiceDraft(
|
||||
selectionSheet === "style"
|
||||
? { ...choiceDraft, presetId: undefined }
|
||||
: { ...choiceDraft, bookIds: [] },
|
||||
)
|
||||
}
|
||||
>
|
||||
{selectionSheet === "style" ? "恢复默认" : "清空选择"}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="dh-primary"
|
||||
onClick={confirmSelection}
|
||||
>
|
||||
确认选择
|
||||
{selectionSheet === "books"
|
||||
? `(${choiceDraft.bookIds.length})`
|
||||
: ""}
|
||||
</button>
|
||||
</footer>
|
||||
</section>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
+331
-2
@@ -699,7 +699,7 @@
|
||||
margin-top: 6px;
|
||||
}
|
||||
.dh-profile-form > label,
|
||||
.dh-settings > label {
|
||||
.dh-settings-body > label {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 9px;
|
||||
@@ -858,9 +858,11 @@
|
||||
background: #ffffff0b;
|
||||
}
|
||||
.dh-settings {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: min(520px, 100%);
|
||||
max-height: 90dvh;
|
||||
overflow: auto;
|
||||
overflow: hidden;
|
||||
padding: 28px;
|
||||
background: var(--dh-panel);
|
||||
border: 1px solid #ffffff1a;
|
||||
@@ -868,6 +870,7 @@
|
||||
}
|
||||
.dh-settings > header {
|
||||
display: flex;
|
||||
flex: none;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 26px;
|
||||
}
|
||||
@@ -886,6 +889,323 @@
|
||||
color: var(--dh-muted);
|
||||
padding: 0 6px;
|
||||
}
|
||||
/* 保留原生单选的键盘与读屏语义,整张风格卡可点击且随双主题变色。 */
|
||||
.dh-settings .dh-style-picker {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0 0 22px;
|
||||
border: 0;
|
||||
}
|
||||
.dh-style-picker legend {
|
||||
padding: 0;
|
||||
color: #d4cbd5;
|
||||
}
|
||||
.dh-style-help {
|
||||
margin: 5px 0 12px !important;
|
||||
color: var(--dh-muted);
|
||||
font-size: 11px;
|
||||
}
|
||||
.dh-style-options {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
.dh-style-option {
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
cursor: pointer;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.dh-style-option:first-child,
|
||||
.dh-style-option:last-child:nth-child(even) {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
.dh-style-option > input {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
clip-path: inset(50%);
|
||||
}
|
||||
.dh-style-card {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
height: 100%;
|
||||
min-height: 88px;
|
||||
padding: 15px 13px;
|
||||
border: 1px solid #ffffff17;
|
||||
border-radius: 13px;
|
||||
background: color-mix(in srgb, var(--dh-soft) 60%, var(--dh-panel));
|
||||
transition:
|
||||
border-color 160ms,
|
||||
background 160ms;
|
||||
}
|
||||
.dh-style-option:hover .dh-style-card {
|
||||
border-color: color-mix(in srgb, var(--dh-accent) 55%, transparent);
|
||||
}
|
||||
.dh-style-option > input:checked + .dh-style-card {
|
||||
border-color: var(--dh-accent);
|
||||
background: color-mix(in srgb, var(--dh-accent) 9%, var(--dh-panel));
|
||||
}
|
||||
.dh-style-option > input:focus-visible + .dh-style-card {
|
||||
outline: 2px solid var(--dh-accent);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
.dh-style-symbol {
|
||||
display: grid;
|
||||
flex: none;
|
||||
place-items: center;
|
||||
width: 29px;
|
||||
height: 29px;
|
||||
color: var(--dh-accent);
|
||||
background: color-mix(in srgb, var(--dh-accent) 10%, transparent);
|
||||
border-radius: 9px;
|
||||
}
|
||||
.dh-style-symbol svg {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
.dh-style-copy {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.dh-style-copy strong {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.dh-style-copy small {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
color: var(--dh-muted);
|
||||
font-size: 11px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
.dh-style-check {
|
||||
display: grid;
|
||||
flex: none;
|
||||
place-items: center;
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
margin-top: 2px;
|
||||
color: transparent;
|
||||
border: 1px solid #ffffff30;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.dh-style-check svg {
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
stroke-width: 3;
|
||||
}
|
||||
.dh-style-option > input:checked + .dh-style-card .dh-style-check {
|
||||
color: var(--dh-accent-ink);
|
||||
background: var(--dh-accent);
|
||||
border-color: var(--dh-accent);
|
||||
}
|
||||
@media (width <= 600px) {
|
||||
.dh-style-options {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
.dh-style-card {
|
||||
min-height: 76px;
|
||||
}
|
||||
}
|
||||
/* H5 选择项以底部抽屉编辑草稿,确认后才回填到对话设定。 */
|
||||
.dh-mobile-choices {
|
||||
display: none;
|
||||
}
|
||||
.dh-overlay.dh-sheet-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
.dh-app .dh-selection-backdrop {
|
||||
touch-action: none;
|
||||
}
|
||||
.dh-selection-layer {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.dh-selection-backdrop {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #0009 !important;
|
||||
}
|
||||
.dh-selection-sheet {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
max-height: 86dvh;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
background: var(--dh-panel);
|
||||
border: 1px solid #ffffff1c;
|
||||
border-bottom: 0;
|
||||
border-radius: 24px 24px 0 0;
|
||||
box-shadow: 0 -16px 60px #0005;
|
||||
animation: dh-sheet-enter 180ms ease-out;
|
||||
}
|
||||
.dh-sheet-handle {
|
||||
flex: none;
|
||||
width: 34px;
|
||||
height: 4px;
|
||||
margin: 10px auto 7px;
|
||||
background: #ffffff35;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.dh-selection-sheet > header {
|
||||
display: flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px 20px 18px;
|
||||
}
|
||||
.dh-selection-sheet h2 {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.dh-selection-sheet header p {
|
||||
margin-top: 4px;
|
||||
color: var(--dh-muted);
|
||||
font-size: 11px;
|
||||
}
|
||||
.dh-selection-body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 0 20px 20px;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.dh-selection-sheet .dh-style-picker,
|
||||
.dh-selection-sheet .dh-book-picker {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
.dh-selection-sheet .dh-checkbox {
|
||||
min-height: 74px;
|
||||
padding: 14px;
|
||||
margin: 0 0 10px;
|
||||
border: 1px solid #ffffff17;
|
||||
border-radius: 13px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dh-selection-sheet .dh-checkbox.is-selected {
|
||||
background: color-mix(in srgb, var(--dh-accent) 9%, var(--dh-panel));
|
||||
border-color: var(--dh-accent);
|
||||
}
|
||||
.dh-selection-sheet .dh-checkbox:focus-within {
|
||||
outline: 2px solid var(--dh-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.dh-selection-sheet .dh-checkbox small {
|
||||
font-size: 11px;
|
||||
}
|
||||
.dh-selection-sheet > footer {
|
||||
display: flex;
|
||||
flex: none;
|
||||
gap: 12px;
|
||||
padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
|
||||
border-top: 1px solid var(--dh-line);
|
||||
}
|
||||
.dh-selection-sheet footer > button {
|
||||
min-height: 46px;
|
||||
}
|
||||
.dh-selection-sheet footer > .dh-primary {
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
.dh-sheet-reset {
|
||||
min-width: 84px;
|
||||
color: var(--dh-muted) !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
.dh-visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0 !important;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
clip-path: inset(50%);
|
||||
}
|
||||
@keyframes dh-sheet-enter {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@media (width > 600px) {
|
||||
.dh-selection-layer {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (width <= 600px) {
|
||||
.dh-desktop-choices {
|
||||
display: none;
|
||||
}
|
||||
.dh-mobile-choices {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
margin: 0 0 22px;
|
||||
}
|
||||
.dh-choice-trigger {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 78px;
|
||||
padding: 15px 14px !important;
|
||||
text-align: left;
|
||||
border: 1px solid #ffffff17 !important;
|
||||
border-radius: 13px;
|
||||
background: var(--dh-soft) !important;
|
||||
}
|
||||
.dh-choice-trigger > svg {
|
||||
flex: none;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
color: var(--dh-accent);
|
||||
}
|
||||
.dh-choice-trigger > svg:last-child {
|
||||
width: 16px;
|
||||
color: var(--dh-muted);
|
||||
}
|
||||
.dh-choice-trigger > span {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.dh-choice-trigger strong {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.dh-choice-trigger small {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
overflow: hidden;
|
||||
color: var(--dh-muted);
|
||||
font-size: 11px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.dh-checkbox {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
@@ -910,7 +1230,16 @@
|
||||
padding: 0 !important;
|
||||
margin: -6px 0 22px;
|
||||
}
|
||||
.dh-settings-body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 4px;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.dh-settings > .dh-primary {
|
||||
flex: none;
|
||||
margin-top: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
/* 聊天固定在动态视口内;消息区独立滚动,输入框不会盖住底部消息。 */
|
||||
|
||||
Reference in New Issue
Block a user