Дерево истории, удаление версий, мультизагрузка, редактирование с референсом и областью, подсказки промптов
This commit is contained in:
988
public/app.js
988
public/app.js
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
rel="icon"
|
||||
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23202321'/%3E%3Ctext x='32' y='45' font-size='38' font-weight='bold' text-anchor='middle' fill='%23ffffff' font-family='sans-serif'%3E%D0%9A%3C/text%3E%3C/svg%3E"
|
||||
>
|
||||
<link rel="stylesheet" href="/style.css?v=10">
|
||||
<link rel="stylesheet" href="/style.css?v=11">
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
@@ -66,6 +66,7 @@
|
||||
id="photo-input"
|
||||
type="file"
|
||||
accept="image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif"
|
||||
multiple
|
||||
hidden
|
||||
>
|
||||
|
||||
@@ -82,6 +83,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-group">
|
||||
<span class="field-label">Референс <span class="field-label-hint">(необязательно)</span></span>
|
||||
<div class="reference-actions">
|
||||
<button id="reference-upload-button" class="button button-secondary button-small" type="button">Загрузить файл</button>
|
||||
<select id="reference-history-select" class="reference-select" aria-label="Выбрать референс из истории">
|
||||
<option value="">— из истории —</option>
|
||||
</select>
|
||||
<button id="reference-clear-button" class="button button-secondary button-small" type="button">Очистить</button>
|
||||
</div>
|
||||
<input id="reference-file-input" type="file" accept="image/jpeg,image/png,image/webp" hidden>
|
||||
<div id="reference-preview" class="reference-preview" hidden>
|
||||
<canvas id="reference-canvas" class="reference-canvas"></canvas>
|
||||
<div class="reference-preview-foot">
|
||||
<span id="reference-region-info">Область не выбрана — потяните по превью</span>
|
||||
<button id="reference-region-reset" class="button button-secondary button-small" type="button">Сбросить область</button>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reference-note" class="reference-note" hidden></p>
|
||||
</div>
|
||||
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="prompt">Промпт</label>
|
||||
<textarea
|
||||
@@ -96,6 +117,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button id="suggest-button" class="button button-secondary button-suggest" type="button" disabled>💡 Предложить промпт</button>
|
||||
<div id="suggest-panel" class="suggest-panel" hidden>
|
||||
<p class="suggest-section-title">Из истории</p>
|
||||
<div id="suggest-history-chips" class="suggest-chips"></div>
|
||||
<div class="suggest-actions">
|
||||
<button id="suggest-codex-button" class="button button-secondary button-small" type="button" disabled>Спросить Codex</button>
|
||||
<span id="suggest-codex-status" class="suggest-status" role="status" aria-live="polite"></span>
|
||||
</div>
|
||||
<p class="suggest-section-title">Варианты от Codex</p>
|
||||
<div id="suggest-codex-chips" class="suggest-chips"></div>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<button
|
||||
id="edit-button"
|
||||
@@ -261,6 +294,6 @@
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<script src="/app.js?v=10" defer></script>
|
||||
<script src="/app.js?v=11" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
366
public/style.css
366
public/style.css
@@ -186,6 +186,7 @@ h1 {
|
||||
|
||||
.control-stack {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
gap: 23px;
|
||||
}
|
||||
|
||||
@@ -916,71 +917,193 @@ textarea:disabled {
|
||||
}
|
||||
|
||||
.history-list {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
overflow-x: auto;
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
overflow-y: auto;
|
||||
padding: 4px 4px 10px;
|
||||
}
|
||||
|
||||
.history-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 7px;
|
||||
flex: 0 0 150px;
|
||||
width: 150px;
|
||||
padding: 9px;
|
||||
border: 1.5px solid var(--line);
|
||||
.history-group {
|
||||
padding: 10px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-small);
|
||||
background: var(--panel);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
|
||||
}
|
||||
|
||||
.history-item:hover {
|
||||
border-color: var(--accent);
|
||||
transform: translateY(-1px);
|
||||
.history-group-count {
|
||||
display: block;
|
||||
margin: 7px 2px 2px;
|
||||
color: var(--muted);
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.history-item.is-current {
|
||||
.history-node {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-left: calc(var(--depth, 0) * 18px);
|
||||
padding: 5px 6px;
|
||||
border: 1.5px solid transparent;
|
||||
border-radius: var(--radius-small);
|
||||
transition:
|
||||
border-color 0.15s ease,
|
||||
box-shadow 0.15s ease,
|
||||
background 0.15s ease;
|
||||
}
|
||||
|
||||
.history-node:hover {
|
||||
background: rgba(108, 92, 231, 0.05);
|
||||
}
|
||||
|
||||
.history-node.is-current {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 3px var(--accent-soft);
|
||||
}
|
||||
|
||||
.history-item img {
|
||||
width: 100%;
|
||||
height: 92px;
|
||||
.history-node-toggle {
|
||||
flex: 0 0 auto;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 7px;
|
||||
color: var(--muted);
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.history-node-toggle:hover {
|
||||
color: var(--ink);
|
||||
background: #ecebe5;
|
||||
}
|
||||
|
||||
.history-node-main {
|
||||
display: grid;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 2px;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
color: inherit;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.history-node-main:hover {
|
||||
background: rgba(108, 92, 231, 0.07);
|
||||
}
|
||||
|
||||
.history-node-thumb {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
background: #ecece6;
|
||||
}
|
||||
|
||||
.history-item-meta strong {
|
||||
display: block;
|
||||
.history-node-meta {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.history-node-title {
|
||||
font-size: 12.5px;
|
||||
line-height: 1.3;
|
||||
font-weight: 750;
|
||||
color: var(--ink);
|
||||
line-height: 1.3;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.history-item-meta span {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.history-item-badge {
|
||||
align-self: flex-start;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: uppercase;
|
||||
.history-node-badge {
|
||||
justify-self: start;
|
||||
padding: 2px 7px;
|
||||
border-radius: 999px;
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent-dark);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.history-node-date {
|
||||
font-size: 11px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.history-node-prompt {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
font-size: 11.5px;
|
||||
color: var(--muted);
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.history-node-children {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.history-node-actions {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 8px;
|
||||
transform: translateY(-50%);
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.history-node:hover .history-node-actions,
|
||||
.history-node:focus-within .history-node-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.history-node-action {
|
||||
padding: 5px 9px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
color: var(--muted);
|
||||
background: var(--panel);
|
||||
cursor: pointer;
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
transition:
|
||||
border-color 0.15s ease,
|
||||
color 0.15s ease,
|
||||
background 0.15s ease;
|
||||
}
|
||||
|
||||
.history-node-action:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent-dark);
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
|
||||
.history-node-action.history-delete {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.history-node-action.history-delete:hover {
|
||||
border-color: var(--danger);
|
||||
color: var(--danger);
|
||||
background: rgba(184, 67, 67, 0.07);
|
||||
}
|
||||
|
||||
.history-empty {
|
||||
@@ -989,6 +1112,173 @@ textarea:disabled {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* -- Референс ---------------------------------------------------- */
|
||||
|
||||
.reference-actions {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.button-small {
|
||||
min-height: 36px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
color: var(--ink);
|
||||
background: var(--panel);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
font-weight: 720;
|
||||
transition:
|
||||
border-color 150ms ease,
|
||||
background 150ms ease,
|
||||
transform 150ms ease,
|
||||
opacity 150ms ease;
|
||||
}
|
||||
|
||||
.button-small:not(:disabled):hover {
|
||||
border-color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.button-small:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.43;
|
||||
}
|
||||
|
||||
.reference-select {
|
||||
min-height: 36px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
color: var(--ink);
|
||||
background: var(--panel);
|
||||
font-size: 12px;
|
||||
outline: none;
|
||||
transition:
|
||||
border-color 160ms ease,
|
||||
box-shadow 160ms ease;
|
||||
}
|
||||
|
||||
.reference-select:focus {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
|
||||
}
|
||||
|
||||
.reference-select:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.43;
|
||||
}
|
||||
|
||||
.reference-preview {
|
||||
margin-top: 10px;
|
||||
padding: 8px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-small);
|
||||
background: var(--paper);
|
||||
}
|
||||
|
||||
.reference-canvas {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 260px;
|
||||
object-fit: contain;
|
||||
border-radius: 8px;
|
||||
background: #ecece6;
|
||||
cursor: crosshair;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.reference-preview-foot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin-top: 8px;
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.reference-note {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* -- Подсказки промптов ------------------------------------------- */
|
||||
|
||||
.button-suggest {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.suggest-panel {
|
||||
margin-top: 10px;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-small);
|
||||
background: rgba(251, 250, 246, 0.7);
|
||||
}
|
||||
|
||||
.suggest-section-title {
|
||||
margin: 0 0 8px;
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.suggest-chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.suggest-chip {
|
||||
max-width: 100%;
|
||||
padding: 6px 12px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
color: var(--ink);
|
||||
background: var(--panel);
|
||||
cursor: pointer;
|
||||
font-size: 11.5px;
|
||||
line-height: 1.4;
|
||||
text-align: left;
|
||||
transition:
|
||||
border-color 150ms ease,
|
||||
background 150ms ease,
|
||||
color 150ms ease;
|
||||
}
|
||||
|
||||
.suggest-chip:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent-dark);
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
|
||||
.suggest-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.suggest-status {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* -- Авторизация -------------------------------------------------- */
|
||||
|
||||
.topbar-right {
|
||||
|
||||
Reference in New Issue
Block a user