Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5adb6eaec3 |
@@ -1452,25 +1452,60 @@ export function DigitalHome({
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
叙事风格
|
||||
<select
|
||||
value={settings.presetId ?? ""}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
...settings,
|
||||
presetId: e.target.value || undefined,
|
||||
})
|
||||
}
|
||||
>
|
||||
<option value="">角色默认风格</option>
|
||||
{presets.map((p) => (
|
||||
<option key={p.id} value={p.id}>
|
||||
{p.name}
|
||||
</option>
|
||||
<fieldset className="dh-style-picker">
|
||||
<legend>叙事风格</legend>
|
||||
<p className="dh-style-help">为这段故事选一种氛围</p>
|
||||
<div className="dh-style-options">
|
||||
{[
|
||||
{
|
||||
id: "",
|
||||
name: "角色默认风格",
|
||||
description: "沿用角色原有的语气与叙事节奏。",
|
||||
},
|
||||
...presets,
|
||||
...(settings.presetId &&
|
||||
!presets.some((p) => p.id === settings.presetId)
|
||||
? [
|
||||
{
|
||||
id: settings.presetId,
|
||||
name: "当前会话风格",
|
||||
description:
|
||||
"此风格暂不在可选列表中,可以保留或选择其他风格。",
|
||||
},
|
||||
]
|
||||
: []),
|
||||
].map((p) => (
|
||||
<label className="dh-style-option" key={p.id}>
|
||||
<input
|
||||
type="radio"
|
||||
name="conversation-preset"
|
||||
value={p.id}
|
||||
checked={(settings.presetId ?? "") === p.id}
|
||||
onChange={() =>
|
||||
setSettings({
|
||||
...settings,
|
||||
presetId: 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>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>加入世界书</legend>
|
||||
{books.map((b) => (
|
||||
|
||||
@@ -886,6 +886,132 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
.dh-checkbox {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
|
||||
Reference in New Issue
Block a user