mirror of
https://github.com/hansjone/mind-map.git
synced 2026-10-08 23:33:24 +08:00
Replace raw JSON on card faces with key-value lists, simulate frosted glass on canvas, and use a list editor plus real backdrop blur for the selected overlay. Co-authored-by: Cursor <cursoragent@cursor.com>
529 lines
9.7 KiB
CSS
529 lines
9.7 KiB
CSS
/* Node property system — frosted glass card / inspector shell */
|
|
.ns-editor {
|
|
--ns-bg: color-mix(
|
|
in srgb,
|
|
var(--dsw-alias-bg-layer-1, #1b1e28) 72%,
|
|
transparent
|
|
);
|
|
--ns-border: rgba(255, 255, 255, 0.14);
|
|
--ns-label: var(--dsw-alias-label-secondary, #a5adb8);
|
|
--ns-text: var(--dsw-alias-label-primary, #f4f5f7);
|
|
--ns-brand: var(--dsw-alias-brand-primary, #5e6ad2);
|
|
--ns-input: rgba(255, 255, 255, 0.06);
|
|
--ns-font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
|
|
"Noto Sans SC", system-ui, sans-serif;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0;
|
|
background: var(--ns-bg);
|
|
border: 1px solid var(--ns-border);
|
|
border-radius: 16px;
|
|
overflow: visible;
|
|
backdrop-filter: blur(16px) saturate(1.2);
|
|
-webkit-backdrop-filter: blur(16px) saturate(1.2);
|
|
box-shadow:
|
|
0 1px 0 rgba(255, 255, 255, 0.1) inset,
|
|
0 12px 40px rgba(0, 0, 0, 0.42);
|
|
color: var(--ns-text);
|
|
font-family: var(--ns-font);
|
|
font-size: 12.5px;
|
|
line-height: 1.45;
|
|
min-width: 248px;
|
|
max-width: 320px;
|
|
}
|
|
|
|
.ns-editor--panel {
|
|
box-shadow: none;
|
|
max-width: none;
|
|
width: 100%;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: 0;
|
|
backdrop-filter: none;
|
|
-webkit-backdrop-filter: none;
|
|
}
|
|
|
|
.ns-editor__header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 12px 14px;
|
|
background: linear-gradient(
|
|
180deg,
|
|
rgba(255, 255, 255, 0.08) 0%,
|
|
rgba(255, 255, 255, 0.02) 100%
|
|
);
|
|
border-bottom: 1px solid var(--ns-border);
|
|
border-radius: 16px 16px 0 0;
|
|
cursor: grab;
|
|
user-select: none;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.ns-editor--panel .ns-editor__header {
|
|
border-radius: 0;
|
|
background: transparent;
|
|
}
|
|
|
|
.ns-editor__header:active {
|
|
cursor: grabbing;
|
|
}
|
|
|
|
.ns-editor__dot {
|
|
width: 9px;
|
|
height: 9px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
background: var(--ns-brand);
|
|
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ns-brand) 28%, transparent);
|
|
}
|
|
|
|
.ns-editor__title {
|
|
flex: 1;
|
|
min-width: 0;
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--ns-text);
|
|
font-family: inherit;
|
|
font-weight: 600;
|
|
font-size: 13.5px;
|
|
letter-spacing: 0.01em;
|
|
padding: 2px 0;
|
|
outline: none;
|
|
}
|
|
|
|
.ns-editor__title:focus {
|
|
box-shadow: inset 0 -1.5px 0 var(--ns-brand);
|
|
}
|
|
|
|
.ns-editor__body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
padding: 8px 10px 10px;
|
|
}
|
|
|
|
.ns-meta-chips {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 6px;
|
|
padding: 4px 4px 10px;
|
|
}
|
|
|
|
.ns-chip {
|
|
display: inline-flex;
|
|
align-items: baseline;
|
|
gap: 6px;
|
|
max-width: 100%;
|
|
padding: 4px 8px;
|
|
border-radius: 999px;
|
|
background: rgba(255, 255, 255, 0.06);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
font-size: 11px;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.ns-chip__k {
|
|
color: var(--ns-label);
|
|
font-weight: 500;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.ns-chip__v {
|
|
color: var(--ns-text);
|
|
font-weight: 500;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
min-width: 0;
|
|
}
|
|
|
|
.ns-kv {
|
|
margin: 4px 2px 6px;
|
|
padding: 8px 8px 10px;
|
|
border-radius: 12px;
|
|
background: rgba(255, 255, 255, 0.03);
|
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
}
|
|
|
|
.ns-kv__title {
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
letter-spacing: 0.03em;
|
|
color: var(--ns-label);
|
|
margin: 0 2px 8px;
|
|
}
|
|
|
|
.ns-kv__list {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0;
|
|
}
|
|
|
|
.ns-kv__row {
|
|
display: grid;
|
|
grid-template-columns: minmax(64px, 0.34fr) 1fr auto;
|
|
gap: 6px;
|
|
align-items: center;
|
|
padding: 6px 2px;
|
|
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
|
}
|
|
|
|
.ns-kv__row:first-child {
|
|
border-top: none;
|
|
padding-top: 0;
|
|
}
|
|
|
|
.ns-kv__key,
|
|
.ns-kv__val {
|
|
width: 100%;
|
|
min-width: 0;
|
|
border: 1px solid transparent;
|
|
background: var(--ns-input);
|
|
color: var(--ns-text);
|
|
font-family: inherit;
|
|
font-size: 12px;
|
|
border-radius: 8px;
|
|
padding: 6px 8px;
|
|
outline: none;
|
|
}
|
|
|
|
.ns-kv__key {
|
|
color: var(--ns-label);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.ns-kv__key:focus,
|
|
.ns-kv__val:focus {
|
|
border-color: color-mix(in srgb, var(--ns-brand) 70%, transparent);
|
|
background: rgba(255, 255, 255, 0.055);
|
|
}
|
|
|
|
.ns-kv__del {
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--ns-label);
|
|
padding: 4px 6px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.ns-kv__del:hover {
|
|
opacity: 1;
|
|
color: var(--ns-text);
|
|
background: rgba(255, 255, 255, 0.06);
|
|
}
|
|
|
|
.ns-kv__add,
|
|
.ns-kv__reveal {
|
|
width: 100%;
|
|
margin-top: 8px;
|
|
border: 1px dashed rgba(255, 255, 255, 0.14);
|
|
background: transparent;
|
|
color: var(--ns-label);
|
|
border-radius: 8px;
|
|
padding: 7px 10px;
|
|
font-family: inherit;
|
|
font-size: 11.5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ns-kv__reveal {
|
|
margin: 6px 2px;
|
|
}
|
|
|
|
.ns-kv__add:hover,
|
|
.ns-kv__reveal:hover {
|
|
border-color: var(--ns-brand);
|
|
color: var(--ns-text);
|
|
}
|
|
|
|
.ns-advanced {
|
|
margin: 6px 2px 2px;
|
|
border-radius: 10px;
|
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
background: rgba(0, 0, 0, 0.12);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.ns-advanced > summary {
|
|
list-style: none;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
padding: 8px 10px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
letter-spacing: 0.02em;
|
|
color: var(--ns-label);
|
|
}
|
|
|
|
.ns-advanced > summary::-webkit-details-marker {
|
|
display: none;
|
|
}
|
|
|
|
.ns-advanced > summary::before {
|
|
content: "▸";
|
|
display: inline-block;
|
|
margin-right: 6px;
|
|
transition: transform 0.12s ease;
|
|
}
|
|
|
|
.ns-advanced[open] > summary::before {
|
|
transform: rotate(90deg);
|
|
}
|
|
|
|
.ns-advanced[open] > summary {
|
|
color: var(--ns-text);
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
|
}
|
|
|
|
.ns-advanced__body {
|
|
padding: 4px 6px 8px;
|
|
}
|
|
|
|
.ns-advanced__add {
|
|
width: 100%;
|
|
border: 1px dashed rgba(255, 255, 255, 0.12);
|
|
background: transparent;
|
|
color: var(--ns-label);
|
|
border-radius: 8px;
|
|
padding: 8px 10px;
|
|
font-family: inherit;
|
|
font-size: 11.5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ns-advanced__add:hover {
|
|
border-color: var(--ns-brand);
|
|
color: var(--ns-text);
|
|
}
|
|
|
|
.ns-row {
|
|
display: grid;
|
|
grid-template-columns: 1fr;
|
|
gap: 4px;
|
|
align-items: start;
|
|
padding: 8px 6px;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.ns-row:hover {
|
|
background: rgba(255, 255, 255, 0.035);
|
|
}
|
|
|
|
.ns-row__label {
|
|
color: var(--ns-label);
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
letter-spacing: 0.02em;
|
|
line-height: 1.2;
|
|
user-select: none;
|
|
}
|
|
|
|
.ns-row__ctrl {
|
|
min-width: 0;
|
|
display: flex;
|
|
gap: 6px;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.ns-row__ctrl input,
|
|
.ns-row__ctrl textarea,
|
|
.ns-row__ctrl select {
|
|
flex: 1;
|
|
width: 100%;
|
|
border: 1px solid transparent;
|
|
background: var(--ns-input);
|
|
color: var(--ns-text);
|
|
font-family: inherit;
|
|
font-size: 12.5px;
|
|
border-radius: 8px;
|
|
padding: 7px 10px;
|
|
outline: none;
|
|
resize: vertical;
|
|
transition: border-color 0.12s ease, background 0.12s ease;
|
|
color-scheme: dark;
|
|
}
|
|
|
|
.ns-row__ctrl select option {
|
|
color: #f4f5f7;
|
|
background: #1b1e28;
|
|
}
|
|
|
|
.ns-row__ctrl input:focus,
|
|
.ns-row__ctrl textarea:focus,
|
|
.ns-row__ctrl select:focus {
|
|
border-color: color-mix(in srgb, var(--ns-brand) 70%, transparent);
|
|
background: rgba(255, 255, 255, 0.055);
|
|
}
|
|
|
|
.ns-row__clear {
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--ns-label);
|
|
padding: 6px 6px;
|
|
font-size: 11px;
|
|
line-height: 1;
|
|
opacity: 0.65;
|
|
border-radius: 6px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.ns-row__clear:hover {
|
|
opacity: 1;
|
|
color: var(--ns-text);
|
|
background: rgba(255, 255, 255, 0.06);
|
|
}
|
|
|
|
.ns-thumb {
|
|
width: 100%;
|
|
max-height: 140px;
|
|
height: auto;
|
|
object-fit: contain;
|
|
object-position: center;
|
|
border-radius: 8px;
|
|
background: rgba(0, 0, 0, 0.22);
|
|
display: block;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.ns-row__ctrl--image {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
gap: 6px;
|
|
}
|
|
|
|
.ns-image-actions {
|
|
display: flex;
|
|
gap: 6px;
|
|
align-items: center;
|
|
width: 100%;
|
|
}
|
|
|
|
.ns-image-pick {
|
|
flex-shrink: 0;
|
|
border: 1px solid var(--ns-border);
|
|
background: rgba(255, 255, 255, 0.06);
|
|
color: var(--ns-text);
|
|
border-radius: 8px;
|
|
padding: 7px 10px;
|
|
font-family: inherit;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ns-image-pick:hover:not(:disabled) {
|
|
border-color: var(--ns-brand);
|
|
}
|
|
|
|
.ns-image-pick:disabled {
|
|
opacity: 0.6;
|
|
cursor: wait;
|
|
}
|
|
|
|
.ns-image-url {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.ns-image-hint {
|
|
font-size: 10.5px;
|
|
color: var(--ns-label);
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.ns-image-err {
|
|
font-size: 11px;
|
|
color: #f87171;
|
|
}
|
|
|
|
.ns-add {
|
|
margin: 2px 10px 10px;
|
|
position: relative;
|
|
z-index: 6;
|
|
}
|
|
|
|
.ns-add__btn {
|
|
width: 100%;
|
|
border: 1px dashed color-mix(in srgb, var(--ns-border) 80%, transparent);
|
|
background: transparent;
|
|
color: var(--ns-label);
|
|
border-radius: 10px;
|
|
padding: 8px 10px;
|
|
font-family: inherit;
|
|
font-size: 11.5px;
|
|
cursor: pointer;
|
|
transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
|
|
}
|
|
|
|
.ns-add__btn:hover {
|
|
border-color: var(--ns-brand);
|
|
color: var(--ns-text);
|
|
background: rgba(255, 255, 255, 0.03);
|
|
}
|
|
|
|
.ns-add__menu {
|
|
position: absolute;
|
|
left: 0;
|
|
right: 0;
|
|
/* Open downward so it isn't clipped by siblings / host */
|
|
top: calc(100% + 6px);
|
|
bottom: auto;
|
|
background: color-mix(
|
|
in srgb,
|
|
var(--dsw-alias-bg-layer-1, #1b1e28) 88%,
|
|
transparent
|
|
);
|
|
backdrop-filter: blur(12px);
|
|
-webkit-backdrop-filter: blur(12px);
|
|
border: 1px solid var(--ns-border);
|
|
border-radius: 10px;
|
|
padding: 4px;
|
|
z-index: 20;
|
|
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
|
|
max-height: 220px;
|
|
overflow: auto;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.ns-add__item {
|
|
display: block;
|
|
width: 100%;
|
|
text-align: left;
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--ns-text);
|
|
font-family: inherit;
|
|
padding: 8px 10px;
|
|
border-radius: 8px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.ns-add__item:hover {
|
|
background: rgba(255, 255, 255, 0.07);
|
|
}
|
|
|
|
.ns-overlay {
|
|
position: absolute;
|
|
z-index: 8;
|
|
pointer-events: none;
|
|
transform-origin: center center;
|
|
}
|
|
|
|
.ns-editor {
|
|
pointer-events: none;
|
|
}
|
|
|
|
.ns-editor--panel {
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.ns-editor__title,
|
|
.ns-editor__body,
|
|
.ns-add {
|
|
pointer-events: auto;
|
|
}
|