UI fixes
This commit is contained in:
parent
eaa79c6c49
commit
c939ab13c5
|
|
@ -59,7 +59,7 @@ Bun.serve<ClientData>({
|
||||||
clients.delete(ws);
|
clients.delete(ws);
|
||||||
if (clients.size === 0) wsClients.delete(game);
|
if (clients.size === 0) wsClients.delete(game);
|
||||||
}
|
}
|
||||||
console.log(`[css-hot] ${game} disconnected (${wsClients.get(game)!.size} clients)`);
|
console.log(`[css-hot] ${game} disconnected (${wsClients.get(game)?.size ?? 0} clients)`);
|
||||||
},
|
},
|
||||||
message() { },
|
message() { },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,8 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 28px;
|
width: 36px;
|
||||||
height: 28px;
|
height: 36px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
|
|
|
||||||
|
|
@ -85,10 +85,10 @@
|
||||||
|
|
||||||
.deleteButton {
|
.deleteButton {
|
||||||
composes: deleteButton from '@common/assets/ui.module.css';
|
composes: deleteButton from '@common/assets/ui.module.css';
|
||||||
width: 32px;
|
height: 36px;
|
||||||
height: 32px;
|
min-width: 36px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
font-size: 20px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.field {
|
.field {
|
||||||
|
|
|
||||||
|
|
@ -85,10 +85,10 @@
|
||||||
|
|
||||||
.deleteButton {
|
.deleteButton {
|
||||||
composes: deleteButton from '@common/assets/ui.module.css';
|
composes: deleteButton from '@common/assets/ui.module.css';
|
||||||
width: 32px;
|
height: 36px;
|
||||||
height: 32px;
|
min-width: 36px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
font-size: 20px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.field {
|
.field {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,23 @@
|
||||||
composes: editorHeader from '@common/assets/ui.module.css';
|
composes: editorHeader from '@common/assets/ui.module.css';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1000px) {
|
||||||
|
.header {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addEntry {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleInput {
|
||||||
|
flex: 1;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.header h2 {
|
.header h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
|
|
@ -119,6 +136,30 @@
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.deleteConfirm {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
background: var(--bg-panel);
|
||||||
|
border: 1px solid var(--accent);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
& span {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirmButton {
|
||||||
|
composes: confirmButton from '@common/assets/ui.module.css';
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancelButton {
|
||||||
|
composes: cancelButton from '@common/assets/ui.module.css';
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ import styles from '../../assets/character-editor.module.css';
|
||||||
import { CharacterRole, useAppState, type Character } from "../../contexts/state";
|
import { CharacterRole, useAppState, type Character } from "../../contexts/state";
|
||||||
import LLM from "../../utils/llm";
|
import LLM from "../../utils/llm";
|
||||||
|
|
||||||
// TODO fix delete button size
|
|
||||||
|
|
||||||
export const CharacterEditor = ({ visible }: { visible: boolean }) => {
|
export const CharacterEditor = ({ visible }: { visible: boolean }) => {
|
||||||
const { currentWorld, currentStory, mergedCharacters, dispatch, connection, model } = useAppState();
|
const { currentWorld, currentStory, mergedCharacters, dispatch, connection, model } = useAppState();
|
||||||
const [newNickname, setNewNickname] = useState<Record<string, string>>({});
|
const [newNickname, setNewNickname] = useState<Record<string, string>>({});
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ import styles from '../../assets/location-editor.module.css';
|
||||||
import { LocationScale, useAppState, type Location } from "../../contexts/state";
|
import { LocationScale, useAppState, type Location } from "../../contexts/state";
|
||||||
import LLM from "../../utils/llm";
|
import LLM from "../../utils/llm";
|
||||||
|
|
||||||
// TODO fix delete button size
|
|
||||||
|
|
||||||
export const LocationEditor = ({ visible }: { visible: boolean }) => {
|
export const LocationEditor = ({ visible }: { visible: boolean }) => {
|
||||||
const { currentWorld, currentStory, dispatch, connection, model } = useAppState();
|
const { currentWorld, currentStory, dispatch, connection, model } = useAppState();
|
||||||
const [showDeleteConfirm, setShowDeleteConfirm] = useState<string | null>(null);
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState<string | null>(null);
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,11 @@ import { useState } from "preact/hooks";
|
||||||
import styles from '../../assets/lore-editor.module.css';
|
import styles from '../../assets/lore-editor.module.css';
|
||||||
import { useAppState, type LoreEntry } from "../../contexts/state";
|
import { useAppState, type LoreEntry } from "../../contexts/state";
|
||||||
|
|
||||||
// TODO move adding ui below title on mobile
|
|
||||||
// TODO add confirm to delete
|
|
||||||
|
|
||||||
export const LoreEditor = ({ visible }: { visible: boolean }) => {
|
export const LoreEditor = ({ visible }: { visible: boolean }) => {
|
||||||
const { currentWorld, currentStory, dispatch } = useAppState();
|
const { currentWorld, currentStory, dispatch } = useAppState();
|
||||||
const [editingId, setEditingId] = useState<string | null>(null);
|
const [editingId, setEditingId] = useState<string | null>(null);
|
||||||
const [newTitle, setNewTitle] = useState('');
|
const [newTitle, setNewTitle] = useState('');
|
||||||
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState<string | null>(null);
|
||||||
|
|
||||||
if (!currentWorld || !visible) {
|
if (!currentWorld || !visible) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -157,13 +155,34 @@ export const LoreEditor = ({ visible }: { visible: boolean }) => {
|
||||||
>
|
>
|
||||||
↓
|
↓
|
||||||
</button>
|
</button>
|
||||||
|
{showDeleteConfirm === entry.id ? (
|
||||||
|
<div class={styles.deleteConfirm}>
|
||||||
|
<span>Delete?</span>
|
||||||
|
<button
|
||||||
|
class={styles.confirmButton}
|
||||||
|
onClick={() => {
|
||||||
|
handleDeleteEntry(entry.id);
|
||||||
|
setShowDeleteConfirm(null);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Yes
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class={styles.cancelButton}
|
||||||
|
onClick={() => setShowDeleteConfirm(null)}
|
||||||
|
>
|
||||||
|
No
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<button
|
<button
|
||||||
class={styles.deleteButton}
|
class={styles.deleteButton}
|
||||||
onClick={() => handleDeleteEntry(entry.id)}
|
onClick={() => setShowDeleteConfirm(entry.id)}
|
||||||
title="Delete"
|
title="Delete"
|
||||||
>
|
>
|
||||||
×
|
×
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue