Skip to content

Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.

8.2 KB
Raw Blame
/* SPDX-License-Identifier: Apache-2.0 */
/* 조립 캔버스 — 큐레이터와 같은 화이트 베이스 토큰 (중립 그레이 + 블루 액센트 1개) */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f1f3f6;
  --line: #e4e7ec;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dim: #dbe5fb;
  --danger: #dc2626;
  --checker-a: #e9ebef;
  --checker-b: #f4f5f7;
}

* { box-sizing: border-box; }
/* `hidden` must win over any element's own display (.empty is display:flex,
   #add-row is display:block — both would otherwise override the attribute). */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.title { font-size: 15px; }
.muted { color: var(--muted); margin-left: 8px; font-weight: normal; font-size: 12px; }
.actions { display: flex; align-items: center; gap: 12px; }
.status { color: var(--muted); font-size: 12px; min-width: 60px; text-align: right; }
.status.ok { color: #16a34a; }
.status.err { color: var(--danger); }

/* ── buttons: one component, variants change colour only (never size) ──
   .btn is the single source for button shape — padding/height live here, so
   no two buttons can diverge. --ghost/--accent/--dashed change colour/border
   only. (This is the structural fix for the divergent-height defect.) */
button { font: inherit; cursor: pointer; }  /* reset (also covers icon buttons) */

.btn {
  padding: 7px 14px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.btn:hover { background: var(--panel-2); border-color: #d3d8e0; }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--ghost:hover { background: var(--panel-2); }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: #1d55d0; border-color: #1d55d0; }
.btn--dashed { display: block; width: 100%; border-style: dashed; color: var(--muted); background: transparent; box-shadow: none; }
.btn--dashed:hover { background: var(--panel-2); color: var(--text); }

/* ── layout ─────────────────────────────────────────────────────── */
#layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: calc(100vh - 52px - 34px);
}
#sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.panel-head {
  padding: 9px 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
}
#tree { padding: 6px 0 20px; }
#canvas { overflow-y: auto; padding: 18px 22px 40px; position: relative; }

/* ── file tree ──────────────────────────────────────────────────── */
.tree-node { user-select: none; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  cursor: default;
  font-size: 13px;
  border-radius: 6px;
  margin: 0 6px;
}
.tree-row:hover { background: var(--panel-2); }
.tree-row .twist {
  width: 12px; height: 12px; flex: none;
  color: var(--muted);
  transition: transform 0.12s;
}
.tree-row.open .twist { transform: rotate(90deg); }
.tree-row .leaf-dot { width: 12px; flex: none; }
.tree-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-children { margin-left: 14px; }

.tree-row.image { cursor: grab; }
.tree-row.image:active { cursor: grabbing; }
.tree-row.image .thumb {
  width: 22px; height: 22px; flex: none;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}
.tree-row.dragging { opacity: 0.4; }

/* ── empty state ────────────────────────────────────────────────── */
.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
.empty svg { color: #c4c9d2; }
.empty-title { font-size: 16px; color: var(--text); font-weight: 600; }
.empty-sub { font-size: 13px; max-width: 380px; line-height: 1.6; }
.empty-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

/* ── rows (composition canvas) ──────────────────────────────────── */
.row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.row-head .row-name {
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 6px;
  background: transparent;
  color: var(--text);
  min-width: 120px;
}
.row-head .row-name:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.row-head .count { color: var(--muted); font-size: 12px; }
.row-head .spacer { flex: 1; }
.row-head .row-del {
  color: var(--muted); border: none; background: transparent; box-shadow: none;
  padding: 3px 6px;
}
.row-head .row-del:hover { color: var(--danger); background: transparent; }

.row-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  min-height: 84px;
  align-content: flex-start;
}
.row-strip.drop-hot {
  background: var(--accent-dim);
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}
.row-empty-hint {
  color: var(--muted);
  font-size: 12.5px;
  align-self: center;
  padding: 0 6px;
}

.cell {
  position: relative;
  width: 72px;
}
.cell .frame {
  width: 72px; height: 72px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  display: block;
}
.cell .cap {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell .cell-del {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  padding: 0;
  display: none;
  box-shadow: 0 1px 3px rgba(16,24,40,0.12);
}
.cell:hover .cell-del { display: block; }
.cell .cell-del:hover { color: var(--danger); }

#canvas-actions { margin-top: 2px; }

#build-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.build-result { font-size: 12.5px; color: var(--muted); }
.build-result.ok { color: #16a34a; }
.build-result.err { color: var(--danger); }

.hintbar {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border-top: 1px solid var(--line);
}