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: prompt box as a floating card with a silk thread while you write

Gabriele Lozupone00a76b56ea1a
diff --git a/src/styles.css b/src/styles.css
index f1b8a0b..a4ca8f3 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -232,7 +232,8 @@ svg { display: block; flex: none; }
.shimmer { color: var(--text-3); background: none; }
}
.stage-meta .enhanced-mark { flex: none; display: inline-flex; color: var(--text-2); }
-.pill.toggle.on { background: var(--surface-2); }
+.pill.toggle.on, .pill.toggle.on:hover { background: var(--invert-bg); color: var(--invert-text); border-color: transparent; }
+.pill.toggle.on .lora-count { background: var(--invert-text); color: var(--invert-bg); }
.lora-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
.lora-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover .opt:disabled { opacity: 0.5; cursor: default; }
@@ -297,30 +298,39 @@ svg { display: block; flex: none; }
@media (prefers-reduced-motion: reduce) { .stage-bar .actions, .empty { animation: none; } }
/* ---------- composer ---------- */
-.composer-wrap { flex: none; padding: 0 24px 18px; display: flex; justify-content: center; }
-.composer { width: 100%; max-width: 820px; background: var(--surface); border-radius: 22px; padding: 10px 10px 8px 14px; position: relative; }
+.composer-wrap { flex: none; padding: 0 24px 20px; display: flex; justify-content: center; }
+.composer { width: 100%; max-width: 820px; background: var(--bg); border-radius: 26px; padding: 10px 10px 8px 14px; position: relative; box-shadow: var(--shadow); }
+/* while you write, a silk thread runs round the prompt box */
+@property --silk-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
+.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; }
+@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; }
/* what the prompt works on */
.target { display: flex; align-items: center; gap: 10px; padding: 2px 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); min-width: 0; }
.target .spacer { flex: 1; }
/* Edit image | New image */
-.mode-switch { display: flex; flex: none; background: var(--bg); border-radius: 12px; padding: 3px; gap: 2px; }
-.mode-switch button { height: 30px; padding: 0 10px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
+.mode-switch { display: flex; flex: none; background: var(--surface); border-radius: 13px; padding: 3px; gap: 2px; }
+.mode-switch button { height: 30px; padding: 0 11px; border-radius: 10px; transition: background 0.2s, box-shadow 0.2s, color 0.15s; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.mode-switch button:hover:not(.on) { color: var(--text); }
-.mode-switch button.on { background: var(--invert-bg); color: var(--invert-text); }
-.target-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
+.mode-switch button.on { background: var(--bg); color: var(--text); box-shadow: var(--lift); font-weight: 500; }
+.target-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface); display: grid; place-items: center; color: var(--text-2); flex: none; }
.target-text { display: flex; flex-direction: column; min-width: 0; }
.target-text .what { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-text .sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-group { display: inline-flex; align-items: center; flex: none; }
-.tool { height: 30px; padding: 0 10px; border-radius: 15px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; flex: none; }
-.tool:hover, .tool.on { background: var(--surface-2); color: var(--text); }
+.tool { height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--border-2); transition: background 0.15s, color 0.15s; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; flex: none; }
+.tool:hover { background: var(--surface); color: var(--text); }
+.tool.on { background: var(--surface-2); color: var(--text); border-color: transparent; }
.tool-group .tool.on { border-radius: 15px 0 0 15px; padding-right: 6px; }
-.tool-x { height: 30px; padding: 0 8px 0 4px; border-radius: 0 15px 15px 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
+.tool-x { height: 30px; padding: 0 9px 0 4px; border-radius: 0 15px 15px 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
.tool-x:hover { color: var(--text); }
.refs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: none; max-width: 45%; padding: 6px 6px 0 0; margin-top: -6px; }
.ref { position: relative; width: 40px; height: 40px; border-radius: 10px; overflow: visible; flex: none; cursor: grab; }
-.ref img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
+.ref img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; box-shadow: var(--lift); display: block; background: var(--surface-2); }
.ref .num { position: absolute; left: 3px; top: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--invert-bg); color: var(--invert-text); font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.ref .rm { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); color: var(--text); box-shadow: var(--shadow); display: none; place-items: center; }
.ref:hover .rm { display: grid; }
@@ -330,20 +340,25 @@ svg { display: block; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface-2); font-size: 12px; color: var(--text); }
.chip button { color: var(--text-2); }
-.prompt { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 15px; line-height: 1.5; padding: 4px 2px; max-height: 200px; min-height: 26px; }
+.prompt { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 15.5px; line-height: 1.5; padding: 4px 2px; max-height: 200px; min-height: 26px; }
.prompt::placeholder { color: var(--text-3); }
-.controls { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
+.controls { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.controls .spacer { flex: 1; }
-.plan-hint { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; }
-.pill { height: 32px; padding: 0 10px; border-radius: 16px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
-.pill:hover { background: var(--surface-2); color: var(--text); }
-.pill.on { color: var(--text); }
-.send { width: 34px; height: 34px; border-radius: 50%; background: var(--invert-bg); color: var(--invert-text); display: grid; place-items: center; }
-.send:disabled { opacity: 0.25; }
+.plan-hint { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; }
+.pill { height: 32px; padding: 0 10px; border-radius: 16px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s; }
+/* the composer's settings: outlined capsules; a switch that is on is filled with ink */
+.controls .pill { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-2); font-size: 12.5px; }
+.pill:hover { background: var(--surface); color: var(--text); }
+.pill.on { color: var(--text); background: var(--surface); }
+.send { width: 36px; height: 36px; border-radius: 50%; background: var(--invert-bg); color: var(--invert-text); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(13, 13, 13, 0.5); transition: transform 0.2s var(--ease), opacity 0.2s; }
+.send:hover:not(:disabled) { transform: translateY(-1px); }
+.send:disabled { opacity: 0.25; box-shadow: none; }
/* popovers */
-.popover { position: absolute; z-index: 40; min-width: 200px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
-.popover .opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; text-align: left; font-size: 13px; }
+.popover { position: absolute; z-index: 40; min-width: 200px; background: var(--bg); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; animation: pop-in 0.22s var(--ease) both; }
+@keyframes pop-in { from { opacity: 0; filter: blur(4px); transform: translateY(4px) scale(0.985); } to { opacity: 1; filter: none; transform: none; } }
+@media (prefers-reduced-motion: reduce) { .popover { animation: none; } }
+.popover .opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left; font-size: 13px; }
.popover .opt:hover { background: var(--surface); }
.popover .opt .sub { color: var(--text-3); font-size: 12px; margin-left: auto; padding-left: 16px; }
.popover .opt .check { width: 16px; }
@@ -364,19 +379,19 @@ svg { display: block; flex: none; }
.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; }
-.input, .select { height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); padding: 0 10px; outline: none; min-width: 0; }
-.input:focus, .select:focus { border-color: var(--text-2); }
+.input, .select { height: 32px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--bg); padding: 0 10px; outline: none; min-width: 0; }
+.input:focus, .select:focus { border-color: var(--text-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 60px; }
-.seg { display: flex; background: var(--surface); border-radius: 10px; padding: 3px; gap: 2px; }
+.seg { display: flex; background: var(--surface); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 28px; border-radius: 8px; font-size: 12px; color: var(--text-2); padding: 0 6px; white-space: nowrap; }
-.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
+.seg button.on { background: var(--bg); color: var(--text); box-shadow: var(--lift); }
input[type="range"] { width: 100%; accent-color: var(--text); }
.switch { width: 34px; height: 20px; border-radius: 10px; background: var(--surface-3); position: relative; flex: none; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: left 0.15s; }
.switch.on { background: var(--text); }
.switch.on::after { left: 17px; }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }
-.btn { height: 34px; padding: 0 14px; border-radius: 10px; background: var(--surface); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
+.btn { height: 34px; padding: 0 14px; border-radius: 11px; background: var(--surface); transition: background 0.15s, opacity 0.15s; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn.primary { background: var(--invert-bg); color: var(--invert-text); }
.btn.primary:hover:not(:disabled) { opacity: 0.88; background: var(--invert-bg); }