lcccluck's picture
Add QuickDraw diffusion model and app code
9894238 verified
Raw
History Blame Contribute Delete
6.19 kB
:root {
color-scheme: light;
--bg: #f6f7f4;
--surface: #ffffff;
--surface-soft: #eef1ea;
--ink: #18201d;
--muted: #66726d;
--line: #d8ded6;
--primary: #16615a;
--primary-strong: #0d443f;
--accent: #b7472a;
--shadow: 0 18px 50px rgba(31, 43, 37, 0.12);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100dvh;
background: var(--bg);
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
letter-spacing: 0;
}
button,
input,
select {
font: inherit;
}
.app-shell {
min-height: 100dvh;
padding: 28px;
}
.workspace {
max-width: 1180px;
margin: 0 auto;
}
.toolbar {
display: flex;
align-items: end;
justify-content: space-between;
gap: 20px;
margin-bottom: 20px;
}
.eyebrow {
margin: 0 0 6px;
color: var(--accent);
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
}
h1,
h2 {
margin: 0;
line-height: 1.1;
}
h1 {
font-size: clamp(32px, 5vw, 56px);
}
h2 {
font-size: 24px;
}
.status {
min-height: 38px;
padding: 9px 13px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface);
color: var(--muted);
font-size: 14px;
}
.layout {
display: grid;
grid-template-columns: 340px minmax(0, 1fr);
gap: 18px;
align-items: start;
}
.panel {
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface);
box-shadow: var(--shadow);
}
.controls {
display: grid;
gap: 18px;
padding: 18px;
}
.field {
display: grid;
gap: 8px;
color: var(--muted);
font-size: 14px;
font-weight: 700;
}
select,
input[type="number"] {
width: 100%;
min-height: 46px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface);
color: var(--ink);
padding: 0 12px;
}
select:focus,
input:focus,
button:focus-visible,
a:focus-visible {
outline: 3px solid rgba(22, 97, 90, 0.22);
outline-offset: 2px;
}
.segmented {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 6px;
padding: 4px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface-soft);
}
.segmented label {
min-height: 40px;
display: grid;
place-items: center;
border-radius: 6px;
color: var(--muted);
cursor: pointer;
}
.segmented input {
position: absolute;
opacity: 0;
}
.segmented label:has(input:checked) {
background: var(--surface);
color: var(--ink);
box-shadow: 0 1px 6px rgba(31, 43, 37, 0.12);
}
.range-row {
display: grid;
grid-template-columns: minmax(0, 1fr) 58px;
gap: 10px;
align-items: center;
}
input[type="range"] {
width: 100%;
accent-color: var(--primary);
}
output {
color: var(--ink);
font-variant-numeric: tabular-nums;
}
.generate-button {
min-height: 48px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
border: 0;
border-radius: 8px;
background: var(--primary);
color: white;
font-weight: 800;
cursor: pointer;
transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}
.generate-button:hover {
background: var(--primary-strong);
}
.generate-button:active {
transform: scale(0.98);
}
.generate-button:disabled {
cursor: wait;
opacity: 0.64;
}
.recognize-button {
min-height: 40px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface);
color: var(--primary);
padding: 0 14px;
font-weight: 800;
cursor: pointer;
}
.recognize-button:disabled {
cursor: not-allowed;
color: var(--muted);
opacity: 0.55;
}
.button-icon {
width: 16px;
height: 16px;
border: 2px solid currentColor;
border-left-color: transparent;
border-radius: 50%;
}
.generate-button:not(:disabled) .button-icon {
border-left-color: currentColor;
border-radius: 4px;
}
.generate-button:disabled .button-icon {
animation: spin 800ms linear infinite;
}
.preview {
min-height: 650px;
padding: 18px;
}
.preview-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 16px;
}
.download-link {
min-height: 40px;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 14px;
border: 1px solid var(--line);
border-radius: 8px;
color: var(--primary);
text-decoration: none;
font-weight: 800;
}
.download-link[aria-disabled="true"] {
pointer-events: none;
color: var(--muted);
opacity: 0.5;
}
.image-stage {
min-height: 540px;
display: grid;
place-items: center;
border: 1px solid #151916;
border-radius: 8px;
background: #050706;
overflow: hidden;
}
.image-stage img {
max-width: 100%;
height: auto;
image-rendering: pixelated;
}
.empty-state {
color: #b9c5bf;
font-weight: 700;
}
.message {
min-height: 24px;
margin: 12px 0 0;
color: var(--muted);
font-size: 14px;
}
.recognition {
display: grid;
gap: 10px;
margin-top: 14px;
}
.recognition-actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
color: var(--muted);
font-size: 14px;
}
.recognition-list {
display: grid;
gap: 8px;
}
.recognition-item {
display: grid;
grid-template-columns: 110px minmax(0, 1fr) 56px;
align-items: center;
gap: 10px;
min-height: 36px;
color: var(--ink);
font-size: 14px;
}
.confidence-track {
height: 8px;
border-radius: 999px;
background: var(--surface-soft);
overflow: hidden;
}
.confidence-fill {
height: 100%;
border-radius: inherit;
background: var(--primary);
}
.confidence-value {
color: var(--muted);
font-variant-numeric: tabular-nums;
text-align: right;
}
.message.error {
color: #a12a22;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@media (max-width: 820px) {
.app-shell {
padding: 16px;
}
.toolbar,
.preview-header,
.recognition-actions {
align-items: stretch;
flex-direction: column;
}
.recognition-item {
grid-template-columns: 88px minmax(0, 1fr) 50px;
}
.layout {
grid-template-columns: 1fr;
}
.preview,
.image-stage {
min-height: 420px;
}
}