[art] GardenerLayers: The gardener in layered parts, painted over one guide in register, checked on accept

This commit is contained in:
2026-11-17 21:53:22 +01:00
parent 0b72ae05a2
commit 229cced136
82 changed files with 1026 additions and 83 deletions
+20 -11
View File
@@ -275,7 +275,11 @@
{ type: 'layer', title: 'Scenes', note: 'The garden at four times of day, the planets (drafts until each planet is designed), and the frame for a shared sky. The sky stays transparent: the app draws the real sky, sun and stars behind it.' },
{ type: 'sprite', title: 'Single pictures', note: 'One thing on a transparent background, placed into a scene in the app.' },
{ type: 'icon', title: 'Icons', note: 'The home-screen icon, its version for phones that crop it to a shape, and the tiny mark for browser tabs. Keep the important part in the middle; phones cut the corners.' },
{ type: 'spritesheet', key: 'layers', layers: true, title: 'Gardener layers', note: 'The gardener the player dresses is stacked from these, back to front: body (skin), clothes, apron and boots, hair, hat. Make the guide (gardener-poses-sheet, in Sprite sheets) first and accept it. Then each layer: attach the guide and gardener-sheet, and paint only the part the card names over the guide, whole sheet at once, so the parts line up. The first looks come first: once their seven are in, the girl and the boy can be judged stacked.' },
];
for (const g of GROUPS) if (!g.key) g.key = g.type;
/** A layer belongs to Gardener layers only; every other card to the group of its type. */
const inGroup = (g, a) => a.type === g.type && Boolean(g.layers) === Boolean(a.over);
const FILTERS = [['all', 'All'], ['todo', 'To make'], ['uploaded', 'To review'], ['retry', 'Another try'], ['accepted', 'Accepted']];
const STATUS_TEXT = { todo: 'To make', uploaded: 'To review', retry: 'Another try', accepted: 'Accepted' };
const EMPTY_TEXT = 'Drop, paste or choose your picture';
@@ -362,10 +366,10 @@
function applyFilter() {
for (const g of GROUPS) {
const sec = document.getElementById('group-' + g.type);
const sec = document.getElementById('group-' + g.key);
if (!sec) continue;
let shown = 0;
for (const a of data.assets.filter((x) => x.type === g.type)) {
for (const a of data.assets.filter((x) => inGroup(g, x))) {
const show = filter === 'all' || cardStatus(a) === filter;
cards[a.id].el.hidden = !show;
if (show) shown++;
@@ -407,10 +411,15 @@
refs.mine.append(refs.overlay);
refs.yields = h('ol', { class: 'yields', 'aria-label': `The ${a.cells.filter(Boolean).length} pictures this sheet makes, in reading order` },
a.cells.map((c, i) => (c ? h('li', {}, h('b', { text: String(i + 1) }), c.id) : h('li', {}, h('b', { text: String(i + 1) }), '(empty)'))));
refs.oneSummary = h('summary', { text: 'One at a time' });
refs.one = h('details', { class: 'cells-one' }, refs.oneSummary,
h('p', { class: 'muted', text: 'When the whole sheet will not keep to its grid, make each picture on its own: copy its prompt, attach the same reference picture, and upload what it made into its slot. Each is accepted on its own; the sheet is done when all its pictures are in.' }),
h('div', { class: 'cellgrid' }, a.cells.map((c, i) => (c ? buildCell(a, c, i) : null))));
if (a.over) {
// A layer is painted over its guide, whole: one picture at a time would not line up (STYLE.md §3b).
refs.one = h('p', { class: 'muted', text: `A layer: attach ${a.over} as the guide and paint only this part over it, the whole sheet at once. Its pictures are never made one at a time, or the parts would not line up.` });
} else {
refs.oneSummary = h('summary', { text: 'One at a time' });
refs.one = h('details', { class: 'cells-one' }, refs.oneSummary,
h('p', { class: 'muted', text: 'When the whole sheet will not keep to its grid, make each picture on its own: copy its prompt, attach the same reference picture, and upload what it made into its slot. Each is accepted on its own; the sheet is done when all its pictures are in.' }),
h('div', { class: 'cellgrid' }, a.cells.map((c, i) => (c ? buildCell(a, c, i) : null))));
}
}
refs.auto = h('ul', { class: 'auto', 'aria-label': 'Automatic checks' });
refs.small = h('div', { class: 'small', hidden: true });
@@ -573,7 +582,7 @@
const shown = cardStatus(a);
el.dataset.status = shown;
refs.pill.className = 'pill ' + shown; refs.pill.textContent = STATUS_TEXT[shown];
if (refs.one) {
if (refs.oneSummary) {
for (const c of cellsIn(a)) updateCell(c.id);
const done = picturesDone(a);
const waiting = cellsIn(a).filter((c) => statusOf(c.id) === 'uploaded').length;
@@ -686,10 +695,10 @@
function renderAll() {
const main = $('#groups');
main.replaceChildren(...GROUPS.map((g) => {
const list = data.assets.filter((a) => a.type === g.type);
const list = data.assets.filter((a) => inGroup(g, a));
if (!list.length) return null;
return h('section', { class: 'group', id: 'group-' + g.type, 'aria-labelledby': 'gh-' + g.type },
h('h2', { id: 'gh-' + g.type, text: `${g.title} · ${list.length}` }),
return h('section', { class: 'group', id: 'group-' + g.key, 'aria-labelledby': 'gh-' + g.key },
h('h2', { id: 'gh-' + g.key, text: `${g.title} · ${list.length}` }),
h('p', { class: 'muted', text: g.note }),
h('div', { class: 'grid' }, list.map(buildCard)));
}).filter(Boolean));
@@ -718,7 +727,7 @@
const r = rows[id];
items.push({ id, target, prompt, width: w, height: hgt, background: bg, attach: attach || [], note: statusOf(id) === 'retry' && r && r.note ? r.note : '' });
};
for (const g of GROUPS) for (const a of data.assets.filter((x) => x.type === g.type)) {
for (const g of GROUPS) for (const a of data.assets.filter((x) => inGroup(g, x))) {
if (a.type !== 'spritesheet') { if (want(statusOf(a.id))) item(a.id, a, a.prompt, a.width, a.height, a.background, a.attach); continue; }
if (cardStatus(a) === 'accepted') continue;
const cells = cellsIn(a);