mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
267 lines
9.1 KiB
CSS
267 lines
9.1 KiB
CSS
/* The Notebook: the top bar button, the dialog, the tab bar and the pictures.
|
|
The editor's own look is notepad-editor.css, inside its shadow root. */
|
|
|
|
/* The top bar's Notebook button: drawn and lit like the Subagents button. */
|
|
.notepad-btn { border-color: var(--rule-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
|
|
.btn.notepad-btn { padding: 0 8px; align-self: stretch; }
|
|
.notepad-btn .notepad-label { font-size: 13px; line-height: 1; }
|
|
.notepad-btn .np-band { fill: var(--ink-2); stroke: none; }
|
|
.notepad-btn:hover:not(:disabled) .np-band { fill: var(--accent); }
|
|
.notepad-btn:disabled .np-band { fill: var(--ink-3); }
|
|
.notepad-btn svg { width: 16px; height: 16px; display: block; }
|
|
.notepad-btn .np-page,
|
|
.notepad-btn .np-ring,
|
|
.notepad-btn .np-line { fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-linecap: round; }
|
|
.notepad-btn .np-page { stroke-width: 1.3; }
|
|
.notepad-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-line); }
|
|
.notepad-btn:hover:not(:disabled) .np-page,
|
|
.notepad-btn:hover:not(:disabled) .np-ring,
|
|
.notepad-btn:hover:not(:disabled) .np-line { stroke: var(--accent); }
|
|
.notepad-btn:disabled .np-page,
|
|
.notepad-btn:disabled .np-ring,
|
|
.notepad-btn:disabled .np-line { stroke: var(--ink-3); }
|
|
|
|
/* The Notebook dialog: large, with the editor taking whatever height the
|
|
title, the pictures and the actions leave. Only the editor scrolls. */
|
|
.modal.notepad {
|
|
width: min(1200px, 90vw);
|
|
height: min(900px, 85vh);
|
|
max-width: none;
|
|
max-height: none;
|
|
flex-direction: column;
|
|
}
|
|
.modal.notepad[open] { display: flex; }
|
|
.modal.notepad h2 { flex: none; }
|
|
.modal.notepad .modal-blurb { flex: none; margin-bottom: 12px; }
|
|
.modal.notepad .modal-blurb .private-note { font-weight: 700; color: var(--accent); }
|
|
.notepad-editor {
|
|
flex: 1 1 auto;
|
|
min-height: 0;
|
|
border: 1px solid var(--rule-2);
|
|
border-radius: 0;
|
|
overflow: hidden;
|
|
background: var(--panel);
|
|
}
|
|
.notepad-editor:focus-within { border-color: var(--accent-line); }
|
|
/* The pictures under the editor: the Add image button, then the thumbnails,
|
|
wrapping. Capped at two rows, so 200 pictures never squeeze the editor
|
|
away; the strip scrolls instead. The whole region lights while pictures are
|
|
dragged over the dialog. */
|
|
.notepad-images {
|
|
flex: none;
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 10px;
|
|
margin-top: 12px;
|
|
padding: 6px;
|
|
border: 1px dashed transparent;
|
|
border-radius: 8px;
|
|
}
|
|
.notepad-add { flex: none; }
|
|
.notepad-strip {
|
|
flex: 1 1 auto;
|
|
min-width: 0;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
max-height: 176px;
|
|
overflow-y: auto;
|
|
margin: 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
}
|
|
.modal.notepad.is-drop .notepad-images {
|
|
border-color: var(--accent);
|
|
background: var(--accent-soft);
|
|
}
|
|
|
|
/* One thumbnail: the picture is a button that opens the preview, with the
|
|
tray's round X in its corner, and the inline delete question or the upload
|
|
state laid over it. */
|
|
.notepad-thumb.attach-thumb { width: 88px; height: 88px; }
|
|
.notepad-thumb-open {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: 0;
|
|
border: 0;
|
|
background: none;
|
|
cursor: zoom-in;
|
|
}
|
|
.notepad-thumb-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
|
.notepad-thumb.is-uploading .notepad-thumb-open,
|
|
.notepad-thumb.is-failed .notepad-thumb-open { cursor: default; }
|
|
.notepad-thumb .attach-overlay p { margin: 0; padding: 0 4px; }
|
|
.notepad-thumb .attach-overlay .btn.tiny { margin: 0; padding: 1px 6px; font-size: 10.5px; }
|
|
.notepad-ask {
|
|
background: color-mix(in srgb, var(--panel) 92%, transparent);
|
|
color: var(--ink); font-size: 10.5px; font-weight: 600; text-align: center;
|
|
}
|
|
.notepad-ask-row { display: flex; gap: 4px; }
|
|
|
|
/* The full-screen preview: the whole viewport, the picture contained in it,
|
|
on a near-black backdrop in both themes (a picture is judged against dark,
|
|
whatever the page's theme), so its colors are fixed, not tokens. */
|
|
.modal.notepad-preview {
|
|
inset: 0;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
max-width: none;
|
|
max-height: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 0;
|
|
background: transparent;
|
|
box-shadow: none;
|
|
color: #f4f1ec;
|
|
}
|
|
.modal.notepad-preview[open] {
|
|
display: grid;
|
|
grid-template-columns: 72px minmax(0, 1fr) 72px;
|
|
grid-template-rows: minmax(0, 1fr) auto;
|
|
}
|
|
.modal.notepad-preview::backdrop { background: rgba(8, 8, 8, 0.92); }
|
|
.notepad-preview-img {
|
|
grid-column: 2;
|
|
grid-row: 1;
|
|
place-self: center;
|
|
max-width: 100%;
|
|
max-height: 100%;
|
|
object-fit: contain;
|
|
padding-top: 24px;
|
|
}
|
|
.notepad-preview-step {
|
|
grid-row: 1;
|
|
place-self: center;
|
|
width: 44px;
|
|
height: 44px;
|
|
padding: 0;
|
|
border: 1px solid rgba(255, 255, 255, 0.35);
|
|
border-radius: 50%;
|
|
background: rgba(0, 0, 0, 0.45);
|
|
color: #fff;
|
|
font: 600 28px/1 var(--sans);
|
|
cursor: pointer;
|
|
}
|
|
.notepad-preview-step.is-prev { grid-column: 1; }
|
|
.notepad-preview-step.is-next { grid-column: 3; }
|
|
.notepad-preview-step:hover,
|
|
.notepad-preview-step:focus-visible { border-color: #fff; background: rgba(255, 255, 255, 0.14); }
|
|
.notepad-preview-step[hidden] { display: none; }
|
|
.notepad-preview-bar {
|
|
grid-column: 1 / -1;
|
|
grid-row: 2;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 16px;
|
|
padding: 12px 16px 20px;
|
|
}
|
|
.notepad-preview-count { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, 0.8); }
|
|
.btn.notepad-preview-close { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
|
|
.btn.notepad-preview-close:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
|
|
.modal.notepad .modal-actions { flex: none; align-items: center; margin-top: 14px; }
|
|
.notepad-status { margin: 0 auto 0 0; min-height: 1.4em; font-size: 12.5px; color: var(--ink-3); }
|
|
.notepad-status.is-problem { color: var(--warn); }
|
|
|
|
/* The tab bar: a scrolling row of tabs, each its name and an x, with the
|
|
current one marked, then New tab. A double-click renames, the x deletes and
|
|
a drag moves; the questions open in the small dialogs below. */
|
|
.notepad-tabbar { flex: none; display: flex; align-items: flex-end; gap: 8px; margin-bottom: -1px; position: relative; z-index: 1; }
|
|
.notepad-tabs { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 0; }
|
|
.notepad-tabwrap {
|
|
flex: none;
|
|
max-width: 240px;
|
|
display: flex;
|
|
align-items: center;
|
|
border: 1px solid var(--rule-2);
|
|
border-radius: 8px 8px 0 0;
|
|
background: var(--panel-2);
|
|
color: var(--ink-2);
|
|
}
|
|
.notepad-tabwrap:hover { color: var(--accent); border-color: var(--accent-line); }
|
|
.notepad-tabwrap:has(.notepad-tab[aria-selected="true"]) {
|
|
background: var(--accent-soft);
|
|
border-color: var(--accent);
|
|
border-bottom-color: var(--panel);
|
|
color: var(--ink);
|
|
}
|
|
.notepad-tab {
|
|
flex: 0 1 auto;
|
|
min-width: 0;
|
|
padding: 6px 4px 6px 12px;
|
|
border: 0;
|
|
background: none;
|
|
color: inherit;
|
|
font: inherit;
|
|
font-size: 13px;
|
|
line-height: 1.2;
|
|
cursor: pointer;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.notepad-tab[aria-selected="true"] { font-weight: 600; }
|
|
.notepad-tab-x {
|
|
flex: none;
|
|
width: 20px;
|
|
height: 20px;
|
|
margin-right: 6px;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 4px;
|
|
background: none;
|
|
color: inherit;
|
|
font: inherit;
|
|
font-size: 16px;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
opacity: 0.6;
|
|
}
|
|
.notepad-tabwrap:hover .notepad-tab-x,
|
|
.notepad-tabwrap:has(.notepad-tab[aria-selected="true"]) .notepad-tab-x,
|
|
.notepad-tab-x:focus-visible { opacity: 1; }
|
|
.notepad-tab-x:hover { background: var(--panel); color: var(--warn); }
|
|
.notepad-tab:focus-visible,
|
|
.notepad-tab-x:focus-visible,
|
|
.notepad-tab-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
.notepad-tabwrap:has(.is-dragging) { opacity: 0.5; }
|
|
.notepad-tabwrap:has(.is-drop-before) { box-shadow: -3px 0 0 0 var(--accent); }
|
|
.notepad-tabs.is-drop-end { box-shadow: inset -3px 0 0 0 var(--accent); }
|
|
.notepad-tab-new { flex: none; margin-bottom: 4px; }
|
|
|
|
/* The name and delete questions: small dialogs over the Notebook, never a
|
|
browser prompt. The empty state sits where the editor would. */
|
|
.notepad-empty {
|
|
flex: none;
|
|
margin: 0 0 10px;
|
|
padding: 10px 12px;
|
|
border: 1px solid var(--rule-2);
|
|
border-radius: 8px;
|
|
background: var(--panel-2);
|
|
}
|
|
.notepad-empty[hidden] { display: none; }
|
|
.modal.notepad-sub { width: min(420px, calc(100vw - 32px)); }
|
|
.modal.notepad-sub h2 { margin: 0 0 10px; }
|
|
.notepad-name-form input {
|
|
display: block;
|
|
width: 100%;
|
|
padding: 6px 8px;
|
|
border: 1px solid var(--rule-2);
|
|
border-radius: 6px;
|
|
background: var(--panel);
|
|
color: var(--ink);
|
|
font: inherit;
|
|
}
|
|
.notepad-name-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
|
|
.notepad-name-error { min-height: 1.2em; margin: 6px 0 0; }
|
|
.notepad-name-error:not(:empty) { color: var(--warn); }
|
|
.modal.notepad-delete { border-color: var(--warn); }
|
|
.notepad-delete p { margin: 0 0 8px; }
|
|
.notepad-empty { text-align: center; padding: 28px 12px; }
|
|
.notepad-empty p { margin: 0 0 12px; color: var(--ink-2); }
|
|
/* Editor and pictures together, so the empty state hides both at once. */
|
|
.notepad-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
|
.notepad-body[hidden] { display: none; }
|