Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

ui: entrances and the other screens on paper

Gabriele Lozupone4f84cb8bd25f
diff --git a/src/styles.css b/src/styles.css
index a4ca8f3..f380726 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -131,15 +131,15 @@ svg { display: block; flex: none; }
.override-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--bg); }
/* ---------- main ---------- */
-.main { flex: 1; display: flex; min-height: 0; position: relative; }
+.main { flex: 1; display: flex; min-height: 0; position: relative; overflow-x: clip; }
.stage { container: stage / inline-size; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 24px 12px; position: relative; isolation: isolate; }
/* a soft light on the paper behind the image */
-.stage::before { content: ""; position: absolute; left: 50%; top: 44%; width: min(1100px, 120%); height: 80%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 62%); pointer-events: none; z-index: -1; }
+.stage::before { content: ""; position: absolute; left: 50%; top: 44%; width: 100%; height: 80%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 62%); pointer-events: none; z-index: -1; }
.stage-frame { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.stage-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-img); background-image: conic-gradient(var(--checker) 25%, transparent 0 50%, var(--checker) 0 75%, transparent 0); background-size: 16px 16px; }
/* the line under the image: version, what made it, compare, actions */
/* under the image: what it is (one centred line), then what you can do with it */
-.stage-bar { width: 100%; max-width: 820px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
+.stage-bar { width: 100%; max-width: 820px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; position: relative; z-index: 3; }
/* the image laid on the page like a print */
.stage .image-box, .stage .compare-box { border-radius: var(--radius-img); box-shadow: var(--print); }
.stage-meta { max-width: 100%; justify-content: center; min-height: 24px; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
@@ -153,7 +153,7 @@ svg { display: block; flex: none; }
.actions { display: flex; gap: 2px; flex: none; }
.actions .sep { width: 1px; background: var(--border); margin: 6px 4px; }
/* what you can do with the image: one card under it */
-.stage-bar .actions { padding: 4px; border-radius: 16px; background: var(--bg); box-shadow: var(--lift); animation: rise 0.6s var(--ease) both; }
+.stage-bar .actions { padding: 4px; border-radius: 16px; background: var(--bg); box-shadow: var(--lift); animation: rise 0.6s var(--ease) backwards; }
.stage-bar .actions .icon-btn { width: 32px; height: 32px; }
/* main actions: icon + word */
.act { height: 32px; padding: 0 11px; border-radius: 11px; transition: background 0.15s, color 0.15s; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
@@ -305,7 +305,7 @@ svg { display: block; flex: none; }
.composer::before { content: ""; position: absolute; inset: -1px; border-radius: 27px; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity 0.5s var(--ease);
background: conic-gradient(from var(--silk-a), transparent 0deg 220deg, color-mix(in srgb, var(--text) 22%, transparent) 290deg, var(--text) 332deg, transparent 360deg);
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: silk-run 4.5s linear infinite; }
-.composer:focus-within::before { opacity: 1; }
+.composer:has(.prompt:focus)::before { opacity: 1; }
@keyframes silk-run { to { --silk-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .composer::before { animation: none; background: color-mix(in srgb, var(--text) 30%, transparent); } }
.composer.drag { outline: 2px dashed var(--text-2); outline-offset: 3px; }
@@ -375,7 +375,7 @@ svg { display: block; flex: none; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* buttons beside a setting keep one line and one width, with room from the text */
.field-row > .btn { flex: none; min-width: 84px; justify-content: center; white-space: nowrap; margin-left: 12px; }
-.setting-card { display: flex; align-items: center; gap: 20px; padding: 16px 18px; border-radius: 14px; background: var(--surface); }
+.setting-card { display: flex; align-items: center; gap: 20px; padding: 16px 18px; border-radius: 14px; background: var(--ground); box-shadow: inset 0 0 0 1px var(--border); }
.setting-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.setting-card-text strong { font-size: 13.5px; font-weight: 600; }
.setting-card .btn { flex: none; white-space: nowrap; }
@@ -398,15 +398,16 @@ input[type="range"] { width: 100%; accent-color: var(--text); }
.muted { color: var(--text-3); font-size: 12px; }
/* ---------- overlays ---------- */
-.overlay { position: absolute; inset: 0; z-index: 30; background: var(--ground); display: flex; flex-direction: column; }
+.overlay { position: absolute; inset: 0; z-index: 30; background: var(--ground); display: flex; flex-direction: column; animation: fade 0.3s ease-out both; }
.overlay-head { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; flex: none; }
.overlay-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.overlay-head .spacer { flex: 1; }
-.modal-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; }
-.modal { width: min(760px, 92vw); height: min(640px, 88vh); background: var(--bg); border-radius: 18px; box-shadow: var(--shadow); display: flex; overflow: hidden; }
-.modal-nav { width: 190px; padding: 14px 8px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
-.modal-nav button { text-align: left; padding: 8px 12px; border-radius: 9px; color: var(--text-2); display: flex; gap: 10px; align-items: center; }
-.modal-nav button.on { background: var(--surface-2); color: var(--text); }
+.modal-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(13, 13, 12, 0.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; animation: fade 0.25s ease-out both; }
+.modal { width: min(760px, 92vw); height: min(640px, 88vh); background: var(--bg); border-radius: 22px; animation: welcome-in 0.35s var(--ease) both; box-shadow: var(--shadow); display: flex; overflow: hidden; }
+.modal-nav { width: 190px; padding: 14px 8px; background: var(--ground); display: flex; flex-direction: column; gap: 2px; }
+.modal-nav button { text-align: left; padding: 8px 12px; border-radius: 11px; transition: background 0.15s, box-shadow 0.2s, color 0.15s; color: var(--text-2); display: flex; gap: 10px; align-items: center; }
+.modal-nav button:hover:not(.on) { background: var(--surface); color: var(--text); }
+.modal-nav button.on { background: var(--bg); color: var(--text); box-shadow: var(--lift); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-body h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.path-row { display: flex; gap: 6px; }
@@ -419,13 +420,14 @@ pre.diag { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font
/* gallery */
.gallery-bar { display: flex; gap: 8px; align-items: center; padding: 0 16px 12px; }
-.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 10px; padding: 0 10px; height: 34px; color: var(--text-3); }
+.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--bg); box-shadow: var(--lift); border-radius: 12px; padding: 0 10px; height: 34px; color: var(--text-3); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--text); }
-.grid { flex: 1; overflow-y: auto; padding: 0 16px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; align-content: start;
+.grid { flex: 1; overflow-y: auto; padding: 4px 16px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-content: start;
/* Without this, Chromium/WebView2 squeezes the implicit rows to fit the scroll box when the
window is short (e.g. 150% display scaling) and the square cards overlap the next row. */
grid-auto-rows: max-content; }
-.card { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); aspect-ratio: 1; cursor: pointer; }
+.card { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg); box-shadow: var(--lift); aspect-ratio: 1; cursor: pointer; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); animation: rise 0.5s var(--ease) backwards; }
+.card:hover { transform: translateY(-2px); box-shadow: var(--print); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .card-actions { position: absolute; right: 6px; top: 6px; display: none; gap: 4px; }
.card:hover .card-actions, .card .card-actions.fav { display: flex; }
@@ -436,7 +438,7 @@ pre.diag { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font
/* editors */
.editor-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px 24px; position: relative; overflow: hidden; }
.editor-tools { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px 18px; flex-wrap: wrap; }
-.editor-tools .group { display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 12px; padding: 4px; }
+.editor-tools .group { display: flex; align-items: center; gap: 4px; background: var(--bg); box-shadow: var(--lift); border-radius: 14px; padding: 4px; }
.editor-tools .slider { display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 12px; color: var(--text-2); }
.editor-tools .slider input { width: 110px; }
.mask-wrap { position: relative; touch-action: none; }
@@ -457,12 +459,12 @@ pre.diag { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font
/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
-.toast { background: var(--invert-bg); color: var(--invert-text); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
+.toast { animation: toast-in 0.35s var(--ease) both; background: var(--invert-bg); color: var(--invert-text); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.toast .body { flex: 1; min-width: 0; }
.toast .sugg { opacity: 0.75; margin-top: 2px; }
.toast pre { white-space: pre-wrap; word-break: break-all; font-size: 11px; max-height: 160px; overflow: auto; opacity: 0.8; margin: 8px 0 0; user-select: text; }
.toast button { color: inherit; opacity: 0.7; font-size: 12px; }
-.star-prompt { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 12px 16px; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
+.star-prompt { animation: toast-in 0.35s var(--ease) both; background: var(--bg); color: var(--text); border: 0; border-radius: 14px; padding: 14px 14px 12px 16px; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.star-prompt .body { flex: 1; min-width: 0; }
.star-prompt .sugg { color: var(--text-2); margin-top: 2px; }
.star-prompt > button { color: var(--text-3); }
@@ -481,7 +483,7 @@ pre.diag { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font
.setup-inner { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 20px; padding-bottom: 72px; height: fit-content; }
.setup h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 6px; }
.setup-lead { font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.5; }
-.setup-card { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: var(--surface); border-radius: 12px; }
+.setup-card { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: var(--bg); box-shadow: var(--lift); border-radius: 14px; }
.setup-gpu { flex-direction: column; align-items: flex-start; gap: 2px; }
.setup-note { font-size: 13px; color: var(--text-2); padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; line-height: 1.45; }
.setup-failure { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); font-size: 12px; word-break: break-word; }
@@ -721,7 +723,7 @@ pre.diag { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font
/* Upscalers: separator in the Advanced menu and the comparison dialog. */
.menu-sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
-.upscaler-compare { width: min(880px, 94vw); max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
+.upscaler-compare { width: min(880px, 94vw); max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 22px; animation: welcome-in 0.35s var(--ease) both; box-shadow: var(--shadow); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.upscaler-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.upscaler-grid figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.upscaler-grid img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; border-radius: 10px; background: var(--surface); }
@@ -840,3 +842,11 @@ kbd { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; display
.lora-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--text-2); }
.lora-warn svg { flex: none; margin-top: 2px; }
.lora-meta { font-size: 12px; word-break: break-all; }
+
+/* shared entrances (the cocoon's curve); none under reduced motion */
+@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
+@keyframes toast-in { from { opacity: 0; filter: blur(6px); transform: translateY(10px) scale(0.98); } to { opacity: 1; filter: none; transform: none; } }
+@media (prefers-reduced-motion: reduce) {
+ .overlay, .modal-scrim, .modal, .upscaler-compare, .toast, .star-prompt, .card { animation: none; }
+ .card:hover { transform: none; }
+}