Files
DndGamePlayer/app/renderer/npcs/NpcsEditorApp.module.css
T
Ivan Fontosh 0f4bb76b41 feat(npcs): inspect cards, Show overlay, and optional external link
Clicking an NPC tile opens description cards (multi-select accordion); Show puts avatars on screen. Optional URL opens a webview tab. Avatar pan in the editor commits on pointer up.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 10:42:57 +08:00

492 lines
7.5 KiB
CSS

.page {
height: 100vh;
display: grid;
grid-template-rows: 56px 1fr;
background: #09090b;
color: var(--text1);
}
.topBar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
border-bottom: 1px solid var(--stroke);
background: #18181b;
}
.topTitle {
font-weight: 900;
font-size: 15px;
letter-spacing: 0.2px;
}
.body {
display: grid;
grid-template-columns: 280px 1fr 480px;
min-height: 0;
}
.col {
min-height: 0;
border-right: 1px solid var(--stroke);
}
.graphLoading {
height: 100%;
min-height: 240px;
display: flex;
align-items: center;
justify-content: center;
color: var(--text2);
font-size: 13px;
}
.col:last-child {
border-right: 0;
}
.side {
display: grid;
grid-template-rows: auto auto 1fr;
gap: 10px;
padding: 12px;
min-height: 0;
background: #0f0f12;
}
.sideActions {
display: flex;
gap: 8px;
flex-wrap: nowrap;
align-items: stretch;
}
.sideActions > * {
flex: 1 1 0;
min-width: 0;
}
.sideActions button {
width: 100%;
padding-left: 8px;
padding-right: 8px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.list {
display: grid;
gap: 8px;
align-content: start;
overflow: auto;
min-height: 0;
padding-right: 2px;
}
.tile {
display: grid;
grid-template-columns: 1fr auto;
gap: 4px;
align-items: center;
padding: 4px;
border-radius: 12px;
border: 1px solid var(--stroke);
background: #18181b;
width: 100%;
}
.tileBody {
display: grid;
grid-template-columns: 44px 1fr;
gap: 10px;
align-items: center;
padding: 4px;
border: 0;
background: transparent;
cursor: pointer;
text-align: left;
color: inherit;
min-width: 0;
}
.tileSelected {
border-color: #60a5fa;
box-shadow: 0 0 0 1px #60a5fa;
}
.tileDragging {
opacity: 0.55;
}
.tileDropBefore {
box-shadow: inset 0 2px 0 #60a5fa;
}
.tileDropAfter {
box-shadow: inset 0 -2px 0 #60a5fa;
}
.tileAvatar {
width: 44px;
height: 44px;
border-radius: 10px;
overflow: hidden;
background: #09090b;
}
.tileAvatarImg {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.tileName {
font-size: 13px;
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tileMenuBtn {
width: 28px;
height: 28px;
border: 0;
border-radius: 8px;
background: transparent;
color: var(--text2);
cursor: pointer;
}
.tileMenuBtn:hover {
background: #27272a;
color: var(--text1);
}
.inspector {
display: grid;
grid-template-rows: 1fr;
min-height: 0;
background: #0f0f12;
}
.inspectorScroll {
overflow: auto;
padding: 14px 16px 24px;
display: grid;
gap: 14px;
align-content: start;
}
.fieldLabel {
color: var(--text2);
font-size: 11px;
font-weight: 900;
letter-spacing: 0.6px;
margin-bottom: 8px;
}
.colorInput {
width: 100%;
height: 36px;
padding: 0;
border: 1px solid var(--stroke);
border-radius: 8px;
background: transparent;
}
.avatarPick {
display: grid;
gap: 10px;
justify-items: center;
width: 100%;
}
.avatarPickBusy {
opacity: 0.65;
pointer-events: none;
}
.avatarPickDrop {
position: relative;
}
.avatarPreview {
position: relative;
width: 120px;
height: 120px;
border-radius: 14px;
overflow: hidden;
border: 1px solid var(--stroke);
background: #09090b;
}
.avatarPreviewPick {
cursor: pointer;
}
.avatarPreviewDrop {
border-color: var(--accent, #a78bfa);
border-style: dashed;
background: var(--accent-fill-soft, rgba(167, 139, 250, 0.16));
}
.avatarEmptyHint {
position: absolute;
inset: 10px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 11px;
font-weight: 700;
line-height: 1.35;
color: var(--text2);
pointer-events: none;
user-select: none;
}
.avatarEdit {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.5);
opacity: 0;
transition: opacity 0.15s ease;
pointer-events: none;
z-index: 1;
}
.avatarPick [data-token-circle]:hover .avatarEdit,
.avatarPreview:hover .avatarEdit {
opacity: 1;
}
.avatarPick [data-token-circle]:active .avatarEdit {
opacity: 0;
}
.avatarEditBtn {
pointer-events: auto;
display: grid;
place-items: center;
width: 40px;
height: 40px;
border: none;
border-radius: 50%;
background: rgba(24, 24, 27, 0.88);
color: #fafafa;
cursor: pointer;
}
.avatarEditBtn:hover {
background: rgba(39, 39, 42, 0.96);
}
.avatarEditBtn:disabled {
opacity: 0.5;
cursor: default;
}
.avatarPreviewImg {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.descShell {
display: grid;
grid-template-rows: auto 1fr;
min-height: 220px;
border-radius: var(--radius-md, 10px);
border: 1px solid var(--stroke);
background: var(--color-overlay-dark-3, #0c0c0f);
overflow: hidden;
}
.descContent {
min-height: 160px;
max-height: 280px;
overflow: auto;
padding: 12px 14px;
}
.relationsTitle {
font-weight: 900;
font-size: 13px;
margin-bottom: 8px;
}
.relationsList {
display: grid;
gap: 6px;
}
.relationItem {
padding: 8px 10px;
border-radius: 10px;
border: 1px solid var(--stroke);
background: #18181b;
font-size: 13px;
font-weight: 600;
}
.emptyInspector {
color: var(--text2);
font-size: 13px;
line-height: 1.45;
}
.muted {
color: var(--text2);
font-size: 13px;
}
.menu {
position: fixed;
z-index: 80;
min-width: 160px;
padding: 6px;
border-radius: 10px;
background: #18181b;
border: 1px solid var(--stroke);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
display: grid;
gap: 2px;
}
.menuItem {
border: 0;
background: transparent;
color: var(--text1);
text-align: left;
padding: 8px 10px;
border-radius: 8px;
cursor: pointer;
font-size: 13px;
width: 100%;
}
.menuItem:hover {
background: #27272a;
}
.menuItemDanger {
border: 0;
background: transparent;
color: var(--color-danger);
text-align: left;
padding: 8px 10px;
border-radius: 8px;
cursor: pointer;
font-size: 13px;
width: 100%;
}
.menuItemDanger:hover {
background: rgba(239, 68, 68, 0.18);
}
.groupBlock {
display: grid;
gap: 4px;
}
.groupHeader {
display: grid;
grid-template-columns: auto auto 1fr auto;
align-items: center;
gap: 6px;
padding: 4px 2px;
border-bottom: 1px solid var(--stroke);
cursor: grab;
user-select: none;
}
.groupHeaderDragging {
opacity: 0.55;
}
.groupDropBefore {
box-shadow: inset 0 2px 0 #60a5fa;
}
.groupDropAfter {
box-shadow: inset 0 -2px 0 #60a5fa;
}
.groupToggle {
border: 0;
background: transparent;
color: var(--text2);
cursor: pointer;
width: 18px;
padding: 0;
font-size: 11px;
}
.groupColorDot {
width: 10px;
height: 10px;
border-radius: 999px;
flex-shrink: 0;
}
.groupTitle {
font-size: 12px;
font-weight: 800;
letter-spacing: 0.3px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.groupMenuBtn {
width: 24px;
height: 24px;
border: 0;
border-radius: 6px;
background: transparent;
color: var(--text2);
cursor: pointer;
}
.groupMenuBtn:hover {
background: #27272a;
color: var(--text1);
}
.groupBody {
display: grid;
gap: 6px;
padding: 4px 0 8px 4px;
min-height: 8px;
}
.groupBodyDrop {
background: rgba(96, 165, 250, 0.08);
border-radius: 8px;
outline: 1px dashed rgba(96, 165, 250, 0.45);
}
.ungroupedSection {
display: grid;
gap: 4px;
margin-top: 4px;
}
.ungroupedHeader {
font-size: 11px;
font-weight: 900;
letter-spacing: 0.6px;
color: var(--text2);
padding: 6px 2px 4px;
border-bottom: 1px solid var(--stroke);
}