Skip to content

💃 Free CC0 mannequin pose reference library for AI image tools (Nano Banana, ChatGPT, ComfyUI, Midjourney) — 250+ poses × 5 angles in line art, names in ja/zh/en/ko

feat(web): six libraries, a site menu and a tray that holds one pick per library

wquguru8372f7e134c0
diff --git a/.gitignore b/.gitignore
index 3bf379ab..87baa4ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@
/build/
/.wrangler/
__pycache__/
+site-media/
diff --git a/tools/build_site.py b/tools/build_site.py
index 513f2b0c..897adcf6 100755
--- a/tools/build_site.py
+++ b/tools/build_site.py
@@ -59,26 +59,83 @@ def library_stats(catalog, ver, updated):
"photos": sum(len(p.get("photos") or {}) for p in shown), "languages": 4, "series": series}
-def costume_data():
- """The costume library as the costume page reads it (docs/DESIGN.md, 服装与搭配): items with at least one view that
- passed QC (data/costume-qc.json decides what is in data/costumes.json), trimmed to what the page shows. Lingerie is
- public and blurred like the suggestive poses (D-06, D-11)."""
- src = json.loads((ROOT / "data/costumes.json").read_text())
- cats = json.loads((ROOT / "data/costume-src/_categories.json").read_text())
+# The libraries that attach to a pose (docs/DESIGN.md, 素材库与搭配), in menu and tray order. dir: the image folder
+# under images/; kind: how a tile shows it (grey product shot, photo, or line art multiplied on a tint like the poses);
+# group: the menu group; views: the library's own angles, in the order its files are listed.
+LIBS = {
+ "costume": {"data": "costumes", "src": "costume", "dir": "costume/grey", "kind": "grey", "group": "wear",
+ "views": ("front", "diag", "side", "back")},
+ "prop": {"data": "props", "src": "prop", "dir": "prop/grey", "kind": "grey", "group": "wear",
+ "views": ("front", "diag", "side", "back")},
+ "furniture": {"data": "furniture", "src": "furniture", "dir": "furniture/grey", "kind": "grey", "group": "near",
+ "views": ("front", "diag", "side", "back", "above")},
+ "animal": {"data": "animals", "src": "animal", "dir": "animal/plain", "kind": "line", "group": "near",
+ "views": ("front", "diag", "side", "above", "below")},
+ "scene": {"data": "scenes", "src": "scene", "dir": "scene/plain", "kind": "photo", "group": "env",
+ "views": ("eye", "above", "below")},
+ "light": {"data": "lights", "src": "light", "dir": "light/plain", "kind": "photo", "group": "env",
+ "views": ("front", "diag", "side")},
+}
+
+
+def first_clause(s):
+ return re.split(r"[,;:]", s or "", 1)[0].strip()
+
+
+def clause(lib, c):
+ """How the item joins the pose's prompt in the tray: pose desc_en, then these, in LIBS order."""
+ if lib == "costume":
+ return "wearing " + c.get("keep_en", "")
+ if lib == "prop":
+ return "holding " + first_clause(c.get("desc_en"))
+ if lib == "furniture":
+ return "with " + first_clause(c.get("desc_en"))
+ if lib == "animal":
+ return "with a " + first_clause(c.get("species") or c.get("group_en", "animal")) + " " + first_clause(c.get("desc_en"))
+ if lib == "scene":
+ return "in " + first_clause(c.get("desc_en"))
+ return "lit by " + first_clause(c.get("keep_en"))
+
+
+def library_data(lib):
+ """One library as its page reads it: items with at least one view that passed QC (the library's qc.json decides
+ what is in its data file), trimmed to what the page shows. Lingerie is public and blurred like the suggestive
+ poses (D-06, D-11)."""
+ L = LIBS[lib]
+ src = json.loads((ROOT / f"data/{L['data']}.json").read_text())
+ cats = json.loads((ROOT / f"data/{L['src']}-src/_categories.json").read_text())
items = []
for c in src["items"]:
- v = [c["views"].get(k) for k in C_VIEWS]
+ v = [(c.get("views") or {}).get(k) for k in L["views"]]
if not any(v):
continue
- items.append({"id": c["id"], "cat": c["cat"], "g": c.get("gender", "U"), "r": c.get("rating", "general"),
- "n": {l: c["name_" + l] for l in LOCS},
- "era": {l: c.get("era_" + l) or c.get("era_en") or "" for l in LOCS} if c.get("era_en") else None,
- "desc": c.get("desc_en", ""), "keep": c.get("keep_en", ""), "v": v})
+ sub = "era" if lib == "costume" else "group"
+ main = L["views"].index(c["main"]) if c.get("main") in L["views"] else 0
+ item = {"id": c["id"], "cat": c["cat"], "r": c.get("rating", "general"), "n": {l: c["name_" + l] for l in LOCS},
+ "sub": {l: c.get(f"{sub}_{l}") or c.get(f"{sub}_en") or "" for l in LOCS} if c.get(f"{sub}_en") else None,
+ "desc": c.get("desc_en", ""), "clause": clause(lib, c), "v": v, "m": main if v[main] else v.index(next(f for f in v if f))}
+ if lib == "costume":
+ item["g"] = c.get("gender", "U")
+ items.append(item)
order = sorted(cats, key=lambda k: cats[k]["order"])
- return {"cats": [{"key": k, "name": cats[k]["name"]} for k in order if any(i["cat"] == k for i in items)],
+ return {"lib": lib, "views": list(L["views"]), "dir": L["dir"], "kind": L["kind"],
+ "cats": [{"key": k, "name": cats[k]["name"]} for k in order if any(i["cat"] == k for i in items)],
"items": items}
+def nav_data(libs, catalog):
+ """What every page's menu and tray need, inlined per page: counts, a thumbnail per library, each library's views."""
+ shown = [p for p in catalog if any(p["views"].values())]
+ series = [[k, sum(1 for p in shown if p.get("series", "std") == k)] for k in ("std", "upper", "sexy", "duo")]
+ out = []
+ for lib, D in libs.items():
+ gen = [i for i in D["items"] if i["r"] == "general"]
+ thumb = gen[0]["v"][gen[0]["m"]] if gen else None
+ out.append({"key": lib, "n": len(D["items"]), "views": D["views"], "dir": D["dir"], "kind": D["kind"],
+ "group": LIBS[lib]["group"], "thumb": thumb, "imgs": sum(1 for i in D["items"] for f in i["v"] if f)})
+ return {"poses": len(shown), "series": [s for s in series if s[1]], "libs": out}
+
+
def git_day(path):
try:
out = subprocess.run(["git", "log", "-1", "--format=%cs", "--", path], cwd=ROOT, capture_output=True, text=True)
@@ -151,9 +208,9 @@ def audit_changelog(entries, pose_ids):
bad.append(f"{at}: {k}{sfx} uses internal term {hit[0]!r}")
link = e.get("link", "")
path = re.split(r"[?#]", link, 1)[0]
- ok = path in ("/", "/changelog/", "/costume/") or (re.fullmatch(r"/pose/(P\d{3})/", path) and path[6:10] in pose_ids)
+ ok = path in ("/", "/changelog/") or path.strip("/") in LIBS or (re.fullmatch(r"/pose/(P\d{3})/", path) and path[6:10] in pose_ids)
if link and not ok:
- bad.append(f"{at}: link {link} is not a site page (/, /changelog/, /costume/ or /pose/<id>/ of a catalog pose)")
+ bad.append(f"{at}: link {link} is not a site page (/, /changelog/, a library page or /pose/<id>/ of a catalog pose)")
return bad
@@ -230,8 +287,12 @@ HEADERS = """/assets/*
/og/*
Cache-Control: public, max-age=86400, stale-while-revalidate=86400
"""
-STAMPED = ("app.css", "app.js", "common.js", "i18n.js", "tray.js", "costume.js")
-C_VIEWS = ("front", "diag", "side", "back")
+STAMPED = ("app.css", "app.js", "common.js", "i18n.js", "tray.js", "library.js")
+# The image host (a second Pages project) answers the tray's fetch() for the phone share sheet, so it allows any origin.
+MEDIA_HEADERS = """/images/*
+ Access-Control-Allow-Origin: *
+ Cache-Control: public, max-age=604800, stale-while-revalidate=86400
+"""
def stamp_assets(out, ver):
@@ -258,6 +319,8 @@ def main() -> None:
ap.add_argument("--link-images", action="store_true")
ap.add_argument("--no-og", action="store_true")
ap.add_argument("--public", action="store_true")
+ ap.add_argument("--media", default="", help="absolute URL of the image host for the libraries (DESIGN.md)")
+ ap.add_argument("--media-out", default="site-media")
args = ap.parse_args()
site_url = args.site.rstrip("/")
@@ -326,13 +389,9 @@ def main() -> None:
packs = json.loads(packs_file.read_text()) if packs_file.exists() else None
if packs and packs["version"] != ver:
print(f"warning: data/packs.json is for v{packs['version']}, the site is v{ver}", file=sys.stderr)
- costumes = costume_data()
- # The home band shows three general fronts; the same three in every language.
- pick = [c for c in costumes["items"] if c["r"] == "general" and c["v"][0]]
- want = [c for c in pick if c["id"] in ("C061", "C195", "C003")] or pick[:3]
- teaser = json.dumps({"n": len(costumes["items"]), "files": [c["v"][0] for c in want[:3]]}, separators=(",", ":"))
- ctpl = (ROOT / "web/costume.html").read_text()
- ccompact = json.dumps(costumes, ensure_ascii=False, separators=(",", ":")).replace("</", "<\\/")
+ libs = {lib: library_data(lib) for lib in LIBS}
+ nav = nav_data(libs, catalog)
+ ltpl = (ROOT / "web/library.html").read_text()
for loc in LOCS:
T = S[loc]
rel = Site.rel(PREFIX[loc])
@@ -354,22 +413,26 @@ def main() -> None:
.replace("__SKIP__", esc(T["skip"])).replace("__NOSCRIPT__", noscript)
.replace("__CHANGELOG__", f"{rel}{PREFIX[loc]}changelog/").replace("__BASE__", rel)
.replace("__CATALOG__", compact).replace("__REPO__", site.repo).replace("__VERSION__", ver)
- .replace("__PACKS__", json.dumps(packs, separators=(",", ":"))).replace("__COSTUME_TEASER__", teaser))
+ .replace("__PACKS__", json.dumps(packs, separators=(",", ":"))))
write(PREFIX[loc], doc)
- # The costume library page, one per language like the gallery.
- crel = Site.rel(PREFIX[loc] + "costume/")
- n = len(costumes["items"])
- chead = site.head(loc, "costume/", fill(T["costumeTitle"], n=n), fill(T["costumeDesc"], n=n),
- site.og_image(loc, "home"), T["ogAlt"], None)
- cnoscript = "<noscript><ul class=\"wrap\">" + "".join(
- f'<li>{c["id"]} {esc(c["n"][loc])}</li>' for c in costumes["items"]) + "</ul></noscript>"
- cdoc = (ctpl.replace("__HEAD__", chead).replace("__HTMLLANG__", HTML_LANG[loc]).replace("__LOC__", loc)
- .replace("__SKIP__", esc(T["skip"])).replace("__NOSCRIPT__", cnoscript)
- .replace("__HOME__", crel + PREFIX[loc] or "./").replace("__CHANGELOG__", f"{crel}{PREFIX[loc]}changelog/")
- .replace("__BASE__", crel).replace("__COSTUMES__", ccompact).replace("__REPO__", site.repo)
- .replace("__VERSION__", ver))
- write(PREFIX[loc] + "costume/", cdoc)
+ # One page per library and language, like the gallery.
+ for lib, D in libs.items():
+ key = lib + "/"
+ lrel = Site.rel(PREFIX[loc] + key)
+ n, L = len(D["items"]), T["libs"][lib]
+ meta = dict(name=L["name"], n=n, unit=L["unit"], sub=L["sub"])
+ lhead = site.head(loc, key, fill(T["libTitle"], **meta), fill(T["libDesc"], **meta),
+ site.og_image(loc, "home"), T["ogAlt"], None)
+ lnoscript = "<noscript><ul class=\"wrap\">" + "".join(
+ f'<li>{c["id"]} {esc(c["n"][loc])}</li>' for c in D["items"]) + "</ul></noscript>"
+ ldoc = (ltpl.replace("__HEAD__", lhead).replace("__HTMLLANG__", HTML_LANG[loc]).replace("__LOC__", loc)
+ .replace("__SKIP__", esc(T["skip"])).replace("__NOSCRIPT__", lnoscript)
+ .replace("__HOME__", lrel + PREFIX[loc] or "./").replace("__CHANGELOG__", f"{lrel}{PREFIX[loc]}changelog/")
+ .replace("__BASE__", lrel).replace("__DATAFILE__", f"{lrel}{LIBS[lib]['data']}.json")
+ .replace("__LIBDATA__", json.dumps(D, ensure_ascii=False, separators=(",", ":")).replace("</", "<\\/"))
+ .replace("__REPO__", site.repo).replace("__VERSION__", ver))
+ write(PREFIX[loc] + key, ldoc)
for i in range(len(poses)):
write(*site.pose_page(loc, i))
@@ -380,12 +443,13 @@ def main() -> None:
# Static files
for f in (ROOT / "web").iterdir():
- if f.is_file() and f.name not in ("index.html", "costume.html", "changelog.yaml"):
+ if f.is_file() and f.name not in ("index.html", "library.html", "changelog.yaml"):
shutil.copy2(f, out / f.name)
# Self-hosted Latin font subsets and their OFL licences (docs/LICENSING.md).
shutil.copytree(ROOT / "web/fonts", out / "fonts")
(out / "catalog.json").write_text(json.dumps(catalog, ensure_ascii=False, indent=1) + "\n")
- (out / "costumes.json").write_text(json.dumps(costumes, ensure_ascii=False, indent=1) + "\n")
+ for lib, D in libs.items():
+ (out / f"{LIBS[lib]['data']}.json").write_text(json.dumps(D, ensure_ascii=False, indent=1) + "\n")
(out / "stats.json").write_text(json.dumps(stats, ensure_ascii=False, indent=1) + "\n")
if args.link_images:
(out / "images").symlink_to(ROOT / "images", target_is_directory=True)
@@ -396,15 +460,35 @@ def main() -> None:
(out / "images" / kind / tier).mkdir(parents=True)
for f in sorted(files):
shutil.copy2(ROOT / "images" / kind / tier / f, out / "images" / kind / tier / f)
- # Costumes: the grey tiers only. The transparent versions ship in the download packs, not on the site
- # (a Pages deployment holds 20,000 files).
- cfiles = sorted({f for c in costumes["items"] for f in c["v"] if f})
- for tier in ("w300", "w600", "w900"):
- (out / "images/costume/grey" / tier).mkdir(parents=True)
- for f in cfiles:
- shutil.copy2(ROOT / "images/costume/grey" / tier / f, out / "images/costume/grey" / tier / f)
else:
shutil.copytree(ROOT / "images", out / "images", ignore=shutil.ignore_patterns("full"))
+ # Library images: on the media host when there is one (a Pages deployment holds 20,000 files, and the libraries
+ # would take the site past that), else beside the pages. Costumes and props ship their grey tiers only; the
+ # transparent versions stay in the download packs.
+ if args.public:
+ mout = ROOT / args.media_out if args.media else out
+ if args.media:
+ shutil.rmtree(mout, ignore_errors=True)
+ mout.mkdir()
+ (mout / "_headers").write_text(MEDIA_HEADERS)
+ (mout / "index.html").write_text(f'<!doctype html><meta charset="utf-8"><title>Shisei media</title><a href="{site_url}/">Shisei</a>\n')
+ for lib, D in libs.items():
+ for tier in ("w300", "w600", "w900"):
+ d = mout / "images" / D["dir"] / tier
+ d.mkdir(parents=True, exist_ok=True)
+ for f in sorted({f for i in D["items"] for f in i["v"] if f}):
+ shutil.copy2(ROOT / "images" / D["dir"] / tier / f, d / f)
+ # Every page gets the menu and tray data, and where library images live, before its scripts run.
+ media = args.media.rstrip("/") + "/" if args.media else None
+ for f in out.rglob("*.html"):
+ doc = f.read_text()
+ m = re.search(r'<script src="([./]*)i18n\.js', doc)
+ if not m:
+ continue
+ rel = m.group(1)
+ data = dict(nav, root=rel, media=media or rel)
+ tag = "<script>window.SHISEI_NAV = " + json.dumps(data, ensure_ascii=False, separators=(",", ":")) + ";</script>\n"
+ f.write_text(doc[:m.start()] + tag + doc[m.start():])
icons = [{"src": "favicon.svg", "sizes": "any", "type": "image/svg+xml"}]
if chrome:
icons += [{"src": "apple-touch-icon.png", "sizes": "180x180", "type": "image/png"},
@@ -419,7 +503,8 @@ def main() -> None:
# sitemap.xml with hreflang alternates and the line art as image entries; robots.txt
cat_day, cl_day = git_day("data/catalog.json"), entries[0]["date"]
rows = []
- for key, day, imgs in ([("", cat_day, []), ("costume/", git_day("data/costumes.json"), []), ("changelog/", cl_day, [])] +
+ for key, day, imgs in ([("", cat_day, []), ("changelog/", cl_day, [])] +
+ [(lib + "/", git_day(f"data/{LIBS[lib]['data']}.json"), []) for lib in LIBS] +
[(f"pose/{p['id']}/", cat_day, [f for f in p["line"] if f]) for p in poses]):
alts = "".join(f'<xhtml:link rel="alternate" hreflang="{HTML_LANG[l]}" href="{esc(site.abs(PREFIX[l] + key))}"/>'
for l in LOCS) + f'<xhtml:link rel="alternate" hreflang="x-default" href="{esc(site.abs(key))}"/>'
diff --git a/tools/site_pages.py b/tools/site_pages.py
index 776f9047..b842a278 100644
--- a/tools/site_pages.py
+++ b/tools/site_pages.py
@@ -148,7 +148,6 @@ class Site:
<a class="brand" href="{home}">{LOGO.format(s=40)}<span>Shisei</span></a>
<div class="nav-links">
<a href="{home}#all">{esc(T["navPoses"])}</a>
- <a href="{rel}{PREFIX[loc]}costume/">{esc(T["navCostumes"])}</a>
<a href="{rel}{PREFIX[loc]}changelog/">{esc(T["navChangelog"])}</a>
</div>
<div class="nav-tools">
diff --git a/web/app.css b/web/app.css
index af76c7ba..3d9742cb 100644
--- a/web/app.css
+++ b/web/app.css
@@ -749,11 +749,6 @@ button.lb-tile:hover img, button.lb-tile:focus-visible img { outline: 2px solid
.c-band-t { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.c-band-t h2 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.c-band-t p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink2); }
-.c-band-card { display: flex; align-items: center; gap: 22px; padding: 14px 26px 14px 14px; border-radius: 28px; background: var(--bg2); text-decoration: none; color: var(--ink); }
-.c-band-imgs { display: flex; gap: 8px; }
-.c-band-imgs img { width: 96px; height: 128px; object-fit: cover; border-radius: 16px; background: var(--cos); }
-.c-band-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
-@media (hover: hover) { .c-band-card:hover { box-shadow: 0 18px 32px -18px rgba(24,24,27,0.35); transform: translateY(-2px); transition: transform .2s, box-shadow .2s; } }
/* the pose lightbox's way into costumes */
.lb-pairbtn { height: 48px; font-size: 15px; gap: 8px; }
@@ -833,9 +828,6 @@ body.has-tray .toast, body.has-tray .nudge { bottom: 112px; }
.c-filters .filter-row .count { display: none; }
.c-band { padding-top: 28px; padding-bottom: 48px; }
.c-band-t h2 { font-size: 24px; }
- .c-band-card { width: 100%; gap: 14px; padding: 10px 16px 10px 10px; border-radius: 22px; }
- .c-band-imgs img { width: 54px; height: 72px; border-radius: 12px; }
- .c-band-cta { flex: 1; justify-content: space-between; font-size: 15px; font-weight: 600; }
/* The tray spans the phone's width; its label and the coming-soon slot give way first. */
.tray { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; align-items: stretch; }
.tray-bar { gap: 4px; padding: 6px; border-radius: 22px; }
@@ -874,3 +866,149 @@ body.has-tray .toast, body.has-tray .nudge { bottom: 112px; }
}
@media (max-width: 860px) { .clb .clb-desc { display: flex; } }
@media (min-width: 721px) { .c-filters .cats { flex-wrap: wrap; overflow: visible; } }
+
+/* ---- v2: six libraries (docs/DESIGN.md, 素材库与搭配) ---- */
+/* Line-art libraries (animals) sit on the pose tile colour, multiplied like the poses. */
+body[data-kind="line"] .ctile, body[data-kind="line"] .clb-stage, body[data-kind="line"] .clb-chips .cchip { background: var(--tile); }
+body[data-kind="line"] .ctile img, body[data-kind="line"] .clb-stage > img, body[data-kind="line"] .cchip img { object-fit: contain; mix-blend-mode: multiply; }
+@media (hover: hover) { body[data-kind="line"] .ccard:hover .ctile { background: #C7DCD6; } }
+
+/* nav: the library dropdown */
+.libnav { position: relative; display: inline-flex; }
+.libnav-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
+.libnav-btn[aria-current="page"], .libnav-btn[aria-expanded="true"] { color: var(--ink); font-weight: 600; }
+.libnav-pop { position: absolute; top: calc(100% + 6px); left: -12px; z-index: 60; width: 440px; padding: 8px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 16px 40px -12px rgba(24,24,27,0.3); display: flex; flex-direction: column; gap: 2px; }
+.libnav-pop[hidden] { display: none; }
+.libnav-g { padding: 8px 12px 2px; font-size: 12px; color: var(--ink4); }
+.libnav-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
+.lk { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 12px 6px 6px; border-radius: 14px; text-decoration: none; color: var(--ink); }
+.lk:hover, .lk[aria-current] { background: var(--bg2); }
+.lk-img { display: block; width: 36px; height: 48px; flex: 0 0 auto; border-radius: 9px; overflow: hidden; background: var(--cos); }
+.lk-img img { width: 100%; height: 100%; object-fit: cover; }
+.line .lk-img { background: var(--tile); }
+.line .lk-img img { object-fit: contain; mix-blend-mode: multiply; }
+.lk-t { display: flex; flex-direction: column; gap: 1px; }
+.lk-t b { font-size: 15px; font-weight: 600; }
+.lk-t span { font-size: 12px; color: var(--ink3); }
+
+/* the phone menu: the whole site on one screen */
+.menu-btn { display: none; }
+@media (max-width: 1100px) { .menu-btn { display: inline-flex; } }
+@media (max-width: 720px) { .nav-tools > .gh { display: none; } .static .nav-links { display: none; } }
+.site-menu { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
+.site-menu[open] { display: flex; flex-direction: column; }
+.site-menu::backdrop { background: var(--bg); }
+.sm-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
+.sm-h .brand { font-size: 18px; }
+.sm-h .circle { width: 44px; height: 44px; }
+.sm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
+.sm-poses { display: flex; align-items: baseline; justify-content: space-between; text-decoration: none; color: var(--ink); }
+.sm-poses span:first-child { font-size: 36px; font-weight: 800; letter-spacing: -0.04em; text-shadow: 2px 3px 0 var(--shadow); }
+.sm-poses .mono { font-size: 13px; color: var(--ink3); }
+.sm-series { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
+.sm-series a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 14px; background: var(--bg2); color: var(--ink); text-decoration: none; font-size: 15px; }
+.sm-series i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
+.sm-series span:nth-child(2) { flex: 1; }
+.sm-series .mono { font-size: 12px; color: var(--ink3); }
+.sm-label { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink3); }
+.sm-libs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
+.sm-lib { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 18px; background: var(--bg2); color: var(--ink); text-decoration: none; }
+.sm-lib[aria-current] { box-shadow: inset 0 0 0 2px var(--ink); }
+.sm-lib .lk-img { width: 100%; height: 92px; border-radius: 13px; }
+.sm-lib .lk-t { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 0 4px 2px; }
+.sm-links { display: flex; gap: 22px; padding-top: 6px; border-top: 1px solid var(--line); }
+.sm-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-size: 16px; }
+.sm-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
+.sm-langs { flex: 1; display: flex; gap: 4px; overflow-x: auto; }
+.sm-langs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--ink2); text-decoration: none; font-size: 14px; white-space: nowrap; }
+.sm-langs a[aria-current] { background: var(--btn); color: var(--btn-ink); font-weight: 600; }
+.sm-foot .circle { width: 44px; height: 44px; }
+
+/* the home band: one card per library */
+.c-band { display: block; }
+.c-band-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
+.c-band-libs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
+.c-lib { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 26px; background: var(--bg2); color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s; }
+.c-lib-img { display: block; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--cos); }
+.c-lib-img img { width: 100%; height: 100%; object-fit: cover; }
+.c-lib.line .c-lib-img { background: #C7DCD6; }
+.c-lib.line .c-lib-img img { object-fit: contain; mix-blend-mode: multiply; }
+.c-lib-t { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 4px; }
+.c-lib-t b { font-size: 18px; }
+.c-lib-t span { font-size: 13px; color: var(--ink3); }
+.c-lib-t .mono { margin-top: 4px; font-size: 12px; color: var(--ink4); }
+@media (hover: hover) { .c-lib:hover { transform: translateY(-3px); box-shadow: 0 18px 32px -18px rgba(24,24,27,0.35); } }
+@media (max-width: 1000px) { .c-band-libs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
+@media (max-width: 720px) {
+ .c-band-libs { gap: 8px; }
+ .c-lib { padding: 6px; gap: 6px; border-radius: 18px; }
+ .c-lib-img { border-radius: 13px; }
+ .c-lib-t b { font-size: 15px; }
+ .c-lib-t span:not(.mono) { display: none; }
+}
+
+/* the tray, many slots */
+.tray-items { display: contents; }
+.tray-stack, .tray-here { display: none; }
+.tray-th.line { background: var(--tile); }
+.tray-th.line img { object-fit: contain; mix-blend-mode: multiply; }
+.tray-th:not(.line) { background: var(--cos); }
+.tray-slot.pose .tray-th, .tray-th[style*="--tint"] { background: var(--tint); }
+.tray-soon { cursor: pointer; background: transparent; color: #F5F2ED; }
+.tray-soon[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
+.tray-add { width: 320px; max-width: 100%; box-sizing: border-box; padding: 8px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 20px 48px -12px rgba(24,24,27,0.35); display: flex; flex-direction: column; }
+.tray-add-h { padding: 8px 12px 4px; font-size: 12px; color: var(--ink4); }
+.tray-add a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 12px 4px 4px; border-radius: 14px; color: var(--ink); text-decoration: none; }
+.tray-add a:hover { background: var(--bg2); }
+.tray-add .tray-th { width: 30px; height: 40px; border-radius: 8px; }
+.tray-add-n { flex: 1; font-size: 15px; }
+.tray-add .mono { font-size: 12px; color: var(--ink4); }
+.tray-panel { width: 600px; }
+.tp-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
+.tp-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
+.tp-card .tp-img { aspect-ratio: 3 / 4; }
+.tp-img:not(.pose) { background: var(--cos); }
+.tp-img.line { background: var(--tint, var(--tile)); }
+.tp-img.line img { object-fit: contain; mix-blend-mode: multiply; }
+.tp-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
+.tp-meta small { font-size: 11px; color: var(--ink4); }
+.tp-meta b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+.tp-meta .mono { font-size: 11px; color: var(--ink3); }
+.tp-acts { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
+.tp-ic { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--ink2); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
+.tp-ic:hover { background: var(--bg2); }
+.tp-change { text-decoration: underline; text-underline-offset: 3px; }
+.tp-more { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
+.tp-more span { font-size: 12px; color: var(--ink4); margin-right: 2px; }
+.tp-more a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1.5px dashed var(--line); border-radius: 999px; color: var(--ink2); text-decoration: none; font-size: 13px; }
+.tp-save { width: 100%; height: 48px; font-size: 15px; }
+@media (max-width: 720px) {
+ /* Phones: the pose slot, one slot of stacked thumbnails for everything else, Done, ×. */
+ .tray-items, .tray-chev, .tray-soon { display: none; }
+ .tray-stack, .tray-here { display: flex; }
+ .tray-here:empty { display: none; }
+ .tray-stack { align-items: center; gap: 6px; min-height: 52px; padding: 3px 10px 3px 3px; border: 0; border-radius: 16px; background: #2A2A2E; color: #F5F2ED; font: inherit; cursor: pointer; flex: 1 1 0; min-width: 0; text-align: left; }
+ .tray-stack.cur { box-shadow: inset 0 0 0 2px var(--accent); }
+ .tray-stack.cur small { color: var(--accent); }
+ .tray-stack-th { display: flex; flex: 0 0 auto; }
+ .tray-stack-th .tray-th { border: 2px solid #2A2A2E; box-sizing: content-box; }
+ .tray-stack-th .tray-th + .tray-th { margin-left: -16px; }
+ .tray-here .tray-slot { flex: 1 1 0; }
+ .tray-add { width: auto; }
+ .tray-panel { width: auto; }
+ .tp-cards { grid-template-columns: 1fr; gap: 6px; }
+ .tp-card { flex-direction: row; align-items: center; gap: 10px; padding: 4px; border-radius: 14px; background: var(--bg2); }
+ .tp-card .tp-img { width: 48px; height: 64px; flex: 0 0 auto; aspect-ratio: auto; border-radius: 10px; }
+ .tp-meta { flex: 1; }
+ .tp-acts { margin-left: 0; }
+}
+@media (max-width: 720px) {
+ /* Nothing picked yet: keep "+" on the phone bar, the only way back to the library list. */
+ .tray-bar.solo .tray-soon { display: inline-flex; width: 48px; height: 52px; margin-left: auto; }
+ .tray-bar.solo .tray-slot { flex: 0 1 auto; }
+}
+@media (min-width: 721px) {
+ .tray-panel { width: 680px; }
+ .tp-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
+}
+.tray-st small { overflow: hidden; text-overflow: ellipsis; }
diff --git a/web/app.js b/web/app.js
index f89d6e41..c2c2fead 100644
--- a/web/app.js
+++ b/web/app.js
@@ -171,18 +171,24 @@
$('termsList').innerHTML = T.termsItems.map((s) => '<li>' + esc(s) + '</li>').join('');
}
- /* costumes: a band after the grid and the pairing tray (web/tray.js); poses stay the anchor (docs/DESIGN.md) */
+ /* libraries: a band after the grid and the tray (web/tray.js); poses stay the anchor (docs/DESIGN.md) */
const TRAY = window.ShiseiTray;
- const TC = () => window.I18N_COSTUME[S.lang];
+ const NAV = window.SHISEI_NAV;
+ const TC = () => window.I18N_LIB[S.lang];
function renderBand() {
- const C = window.SHISEI.costumes;
- $('cBand').hidden = !C;
- if (!C) return;
+ $('cBand').hidden = !NAV || !NAV.libs.length;
+ if ($('cBand').hidden) return;
+ const T = t();
$('cBandEyebrow').textContent = TC().bandEyebrow;
$('cBandT').textContent = TC().bandTitle;
$('cBandSub').textContent = TC().bandSub;
- $('cBandCta').textContent = TC().bandCta(C.n);
- $('cBandImgs').innerHTML = C.files.map((f) => '<img src="' + src('costume/grey', 'w300', f) + '" alt="" width="108" height="144" loading="lazy" decoding="async">').join('');
+ $('cBandCount').textContent = TC().bandCount(NAV.libs.reduce((a, l) => a + l.n, 0), NAV.libs.reduce((a, l) => a + l.imgs, 0).toLocaleString('en-US'));
+ $('cBandLibs').innerHTML = NAV.libs.map((l) => {
+ const L = T.libs[l.key];
+ return '<a class="c-lib ' + l.kind + '" href="' + l.key + '/"><span class="c-lib-img">' +
+ (l.thumb ? '<img src="' + esc(NAV.media + 'images/' + l.dir + '/w300/' + l.thumb) + '" alt="" width="200" height="267" loading="lazy" decoding="async">' : '') + '</span>' +
+ '<span class="c-lib-t"><b>' + esc(L.name) + '</b><span>' + esc(L.role) + '</span><span class="mono">' + l.n + ' ' + esc(L.unit) + '</span></span></a>';
+ }).join('');
}
TRAY.setPage('pose');
// The tray's pose slot opens that pose here rather than reloading the page.
@@ -195,11 +201,10 @@
function pairPose() {
const p = byId.get(LB.id);
const v = p.line[LB.v] ? LB.v : firstView(p.line);
- TRAY.set('pose', { id: p.id, v, file: p.line[v], tint: p.tint, desc: p.desc_en || '', names: TRAY.names(p, 'pose') });
- // With a costume waiting, closing the lightbox shows the tray's opened pair.
- if (TRAY.get().costume) $('lb').close();
- // No costume yet: off to the library to pick one; the tray keeps the pose.
- else location.href = BASE + PREFIX[S.lang] + 'costume/';
+ TRAY.set('pose', { id: p.id, v, file: p.line[v], tint: p.tint, desc: p.desc_en || '', names: TRAY.names(p) });
+ $('lb').close();
+ // Nothing picked yet: the tray lists the libraries to go to next.
+ if (!TRAY.count()) TRAY.showAdd();
}
$('lbPairBtn').addEventListener('click', pairPose);
@@ -791,8 +796,7 @@
if (veil) [$('lbDl'), dl2].forEach((a) => { a.removeAttribute('href'); a.setAttribute('aria-disabled', 'true'); });
- const cos = TRAY.get().costume;
- $('lbPairText').textContent = cos ? TC().pairCostume(cos.id) : TC().startPose;
+ $('lbPairText').textContent = TRAY.count() ? TC().pairItems(TRAY.count()) : TC().startPose;
$('lbPairBtn').disabled = veil || !p.line.some(Boolean);
clearTimeout(lbTip.timer);
$('lbTip').hidden = true;
diff --git a/web/changelog.yaml b/web/changelog.yaml
index c1c22216..27cd9bfd 100644
--- a/web/changelog.yaml
+++ b/web/changelog.yaml
@@ -4,6 +4,22 @@
# tag: new | improve | announce | removed. link: an in-site path without language prefix (/, /changelog/, /pose/P001/),
# optionally with ?query and #hash; the build prefixes the reader's language. Newest first.
entries:
+ - date: 2026-11-01
+ tag: new
+ title: Props, furniture, animals, scenes and light
+ desc: Five more libraries to build around a pose, 287 items in all, and a menu on phones. The tray keeps a pose with one pick from each library.
+ link: /scene/
+ cta: Browse scenes
+ title_zh: 新增道具、家具、动物、场景、光线
+ desc_zh: 又多五个素材库,共 287 件,都能配到姿势上;手机上多了菜单。托盘里一个姿势,每个库各配一件。
+ cta_zh: 浏览场景
+ title_ja: 小物・家具・動物・背景・ライティング
+ desc_ja: ポーズに合わせる素材ライブラリが 5 つ増え、計 287 点。スマホにメニューも。トレイにポーズ 1 つと各ライブラリから 1 点ずつ。
+ cta_ja: 背景を見る
+ title_ko: 소품·가구·동물·배경·조명 추가
+ desc_ko: 포즈에 맞추는 소재 라이브러리 다섯 개, 모두 287개. 휴대폰 메뉴도 생겼습니다. 트레이에 포즈 하나와 라이브러리별 하나씩.
+ cta_ko: 배경 보기
+
- date: 2026-11-01
tag: new
title: Costumes to pair with your pose
diff --git a/web/common.js b/web/common.js
index d9dd3235..c9a24427 100644
--- a/web/common.js
+++ b/web/common.js
@@ -91,6 +91,82 @@
if (l) { try { localStorage.setItem('shisei.lang', l.dataset.langLink); } catch (err) { /* private mode */ } }
});
+
+ /* Site menu (docs/DESIGN.md, 素材库与搭配): a "Library" dropdown in the desktop nav and, below 1100 px where the nav
+ links are hidden, a menu button that opens the whole site on one screen. Built here so the gallery, the library
+ pages and the generated pages share one menu; the data is window.SHISEI_NAV (tools/build_site.py). */
+ const NAV = window.SHISEI_NAV;
+ const TL = (window.I18N_LIB || {})[loc];
+ if (NAV && TL && NAV.libs.length) {
+ const PREFIX = { zh: '', ja: 'ja/', en: 'en/', ko: 'ko/' };
+ const LANGS = ['zh', 'ja', 'en', 'ko'];
+ const home = NAV.root + PREFIX[loc];
+ const here = (location.pathname.match(/\/(costume|prop|furniture|animal|scene|light)\/$/) || [])[1];
+ const thumb = (l) => (l.thumb ? '<img src="' + esc(NAV.media + 'images/' + l.dir + '/w300/' + l.thumb) + '" alt="" loading="lazy">' : '');
+ const libLink = (l, cls) => '<a class="' + cls + ' ' + l.kind + '" href="' + esc(home + l.key + '/') + '"' + (l.key === here ? ' aria-current="page"' : '') + '>' +
+ '<span class="lk-img">' + thumb(l) + '</span><span class="lk-t"><b>' + esc(T.libs[l.key].name) + '</b><span class="mono">' + l.n + '</span></span></a>';
+ const groups = ['wear', 'near', 'env'].map((g) => [g, NAV.libs.filter((l) => l.group === g)]).filter((x) => x[1].length);
+ const links = document.querySelector('.nav-links');
+ if (links) {
+ const box = document.createElement('div');
+ box.className = 'libnav';
+ box.innerHTML = '<button type="button" class="libnav-btn" aria-expanded="false" aria-controls="libnavPop"' + (here ? ' aria-current="page"' : '') + '>' + esc(T.navLibrary) +
+ '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></button>' +
+ '<div class="libnav-pop" id="libnavPop" hidden>' + groups.map(([g, ls]) => '<span class="libnav-g">' + esc(TL.groups[g]) + '</span><div class="libnav-row">' + ls.map((l) => libLink(l, 'lk')).join('') + '</div>').join('') + '</div>';
+ const first = links.querySelector('a');
+ links.insertBefore(box, first ? first.nextSibling : links.firstChild);
+ const btn = box.querySelector('button'), pop = box.querySelector('.libnav-pop');
+ const setOpen = (o) => { btn.setAttribute('aria-expanded', String(o)); pop.hidden = !o; };
+ btn.addEventListener('click', () => setOpen(pop.hidden));
+ document.addEventListener('click', (e) => { if (!e.target.closest('.libnav')) setOpen(false); });
+ box.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !pop.hidden) { setOpen(false); btn.focus(); } });
+ }
+ const tools = document.querySelector('.nav-tools');
+ if (tools) {
+ const mb = document.createElement('button');
+ mb.type = 'button';
+ mb.className = 'circle menu-btn';
+ mb.setAttribute('aria-label', TL.menu);
+ mb.setAttribute('aria-haspopup', 'dialog');
+ mb.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16"/></svg>';
+ tools.appendChild(mb);
+ let menu = null;
+ mb.addEventListener('click', () => {
+ if (!menu) {
+ // The same page in each language: the path after the language prefix, plus query and hash.
+ const root = new URL(NAV.root || './', location.href).pathname;
+ const key = location.pathname.slice(root.length).replace(/^(ja|en|ko)\//, '');
+ const langs = LANGS.map((l) => '<a href="' + esc(NAV.root + PREFIX[l] + key + location.search) + '" data-lang-link="' + l + '" lang="' + ((window.I18N || {})[l] || {}).htmlLang + '"' + (l === loc ? ' aria-current="true"' : '') + '>' + esc(((window.I18N || {})[l] || {}).langName || l) + '</a>').join('');
+ const ser = (window.I18N[loc] || {}).series || {};
+ const tint = { std: '#AFC3E0', upper: '#D3D1E6', sexy: '#EBC0BC', duo: '#BCD3C6' };
+ const repo = (document.querySelector('a.gh') || {}).href || 'https://github.com/wquguru/shisei';
+ menu = document.createElement('dialog');
+ menu.className = 'site-menu';
+ menu.setAttribute('aria-label', TL.menu);
+ menu.innerHTML = '<div class="sm-h"><a class="brand" href="' + esc(home || './') + '"><svg class="logo" width="36" height="36" viewBox="0 0 100 100" aria-hidden="true"><rect width="100" height="100" rx="24" fill="#18181B"/><circle cx="60" cy="23" r="8" fill="none" stroke="#F5F2ED" stroke-width="6"/><path d="M57 37C38 52 42 68 64 82" fill="none" stroke="#E07A52" stroke-width="11" stroke-linecap="round"/></svg><span>Shisei</span></a>' +
+ '<button type="button" class="circle" data-menu-close aria-label="' + esc(T.close || '×') + '"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div>' +
+ '<nav class="sm-body" aria-label="' + esc(TL.menu) + '">' +
+ '<a class="sm-poses" href="' + esc(home + '#all') + '"><span>' + esc(T.navPoses) + '</span><span class="mono">' + esc(TL.poseSets(NAV.poses)) + ' →</span></a>' +
+ '<div class="sm-series">' + NAV.series.map(([k, n]) => '<a href="' + esc(home + '?series=' + k + '#all') + '"><i style="background:' + tint[k] + '"></i><span>' + esc(ser[k] || k) + '</span><span class="mono">' + n + '</span></a>').join('') + '</div>' +
+ '<span class="sm-label">' + esc(TL.libsLabel) + '</span><div class="sm-libs">' + NAV.libs.map((l) => libLink(l, 'sm-lib')).join('') + '</div>' +
+ '<div class="sm-links"><a href="' + esc(home + 'changelog/') + '">' + esc(T.navChangelog) + '</a><a href="' + esc(repo) + '">GitHub</a></div></nav>' +
+ '<div class="sm-foot"><div class="sm-langs">' + langs + '</div><button type="button" class="circle" data-menu-theme aria-label="' + esc(T.theme || '') + '"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg></button></div>';
+ menu.addEventListener('click', (e) => {
+ if (e.target === menu || e.target.closest('[data-menu-close]')) menu.close();
+ else if (e.target.closest('[data-menu-theme]')) {
+ const r = document.documentElement;
+ const dark = r.dataset.theme ? r.dataset.theme === 'dark' : matchMedia('(prefers-color-scheme: dark)').matches;
+ r.dataset.theme = dark ? 'light' : 'dark';
+ try { localStorage.setItem('shisei.theme', r.dataset.theme); } catch (err) { /* private mode */ }
+ } else if (e.target.closest('a')) setTimeout(() => menu.close(), 0); // same-page links (#all) still land
+ });
+ document.body.appendChild(menu);
+ }
+ menu.showModal();
+ });
+ }
+ }
+
// Changelog: filter by tag. Without JS the buttons stay hidden and every entry shows.
const g = document.querySelector('[data-filter-group]');
if (g) {
diff --git a/web/i18n.js b/web/i18n.js
index 171b8f3e..149a171e 100644
--- a/web/i18n.js
+++ b/web/i18n.js
@@ -147,72 +147,76 @@ window.I18N = {
}
};
-// The costume library and the pairing tray (docs/DESIGN.md, 服装与搭配). Category names come from
-// data/costume-src/_categories.json, item names from data/costumes.json.
-window.I18N_COSTUME = {
+// The libraries that attach to a pose (docs/DESIGN.md, 素材库与搭配): costume, prop, furniture, animal, scene, light.
+// Library names, units and page meta live in I18N_PAGES.libs (the build needs them); item names come from data/.
+window.I18N_LIB = {
zh: {
- nav: '服装', crumb: '素材库 / 服装',
- title: (n) => '服装 · ' + n + ' 件', sub: '隐形人台商品照,正面、斜侧、侧面、背面四个视角。挑一件配到任意姿势上,两张图一起交给 AI 换装或角色设定。',
- gender: { all: '全部', F: '女装', M: '男装', U: '中性' }, genderLabel: '性别', cat: '大类', all: '全部',
- views: ['正面', '斜侧', '侧面', '背面'], viewLabel: '视角', count: (n, all) => n + ' / ' + all + ' 件', empty: '没有找到匹配的服装',
- open: (id) => '打开 ' + id + ' 大图', gap: '这个视角暂缺', download: '下载这张 · 900', save: '保存到相册',
- descLabel: '英文服装描述,可直接放进提示词', adultOn: '性感内衣:显示', adultOff: '性感内衣:模糊', adultHint: '性感内衣默认模糊;点单张可单独查看,点这里全部显示', veilTitle: '性感内衣,已模糊',
- pairWith: (id) => '配上 ' + id, startWith: '用这件搭配姿势', pairCostume: (id) => '配上 ' + id, startPose: '给这个姿势配服装',
- paired: (id) => '已配上 ' + id,
- tray: '搭配', slotPose: '姿势', slotCostume: '服装', pickPose: '选姿势', pickCostume: '挑服装', picking: '在挑',
- soon: '道具 · 制作中', done: '完成', hide: '收起', end: '结束搭配',
- group: '这一组', prompt: '合成描述', dlPose: '下载姿势', dlCostume: '下载服装', saveGroup: '保存这一组', holdGroup: '长按每张图,选「保存图片」',
- viewNote: (v) => '服装视角跟随姿势:' + v,
- bandEyebrow: '素材库', bandTitle: '给姿势配上服装', bandSub: '在任意姿势的大图里点「给这个姿势配服装」,或者先来这里挑。', bandCta: (n) => '浏览 ' + n + ' 件服装',
+ groups: { wear: '穿戴与手持', near: '身边', env: '环境' },
+ views: { front: '正面', diag: '斜侧', side: '侧面', back: '背面', above: '俯视', below: '仰视', eye: '平视' },
+ title: (name, n, unit) => name + ' · ' + n + ' ' + unit, count: (n, all) => n + ' / ' + all,
+ gender: { all: '全部', F: '女装', M: '男装', U: '中性' }, genderLabel: '性别', cat: '大类', all: '全部', viewLabel: '视角', mainView: '主视角',
+ empty: '没有找到匹配的素材', open: (id) => '打开 ' + id + ' 大图', gap: '这个视角暂缺', download: '下载这张 · 900', save: '保存到相册',
+ descLabel: '英文描述,可直接放进提示词', veilTitle: '性感内衣,已模糊',
+ adultOn: '性感内衣:显示', adultOff: '性感内衣:模糊', adultHint: '性感内衣默认模糊;点单张可单独查看,点这里全部显示',
+ pairWith: (id) => '配上 ' + id, startWith: '用这件搭配姿势', startPose: '用这个姿势搭配', pairItems: (n) => '配上已选的 ' + n + ' 件',
+ tray: '搭配', slotPose: '姿势', pickPose: '选姿势', picking: '在挑', add: '再加一种素材', addFor: (id) => '给 ' + id + ' 再加',
+ done: '完成', hide: '收起', end: '结束搭配', group: (n) => '这一组 · ' + n + ' 件', prompt: '合成描述', change: '换', remove: (x) => '移除' + x,
+ dl: '下载', saveGroup: (n) => '保存这一组 · ' + n + ' 张', holdGroup: '长按每张图,选「保存图片」',
+ bandEyebrow: '素材库', bandTitle: '给姿势配上衣服、道具和场景', bandSub: '六个素材库都挂在姿势上:在姿势大图里点「用这个姿势搭配」,或者先来这里挑。',
+ bandCount: (n, v) => n + ' 件 · ' + v + ' 张',
+ menu: '菜单', poseSets: (n) => n + ' 套', libsLabel: '素材库 · 配到姿势上用', libsCrumb: '素材库',
keys: '← → 换视角 ↑ ↓ 换一件 Esc 关闭'
},
ja: {
- nav: '衣装', crumb: '素材ライブラリ / 衣装',
- title: (n) => '衣装 · ' + n + ' 点', sub: 'ゴーストマネキンの商品写真。正面・斜め・横・背面の 4 アングル。好きなポーズに合わせて、2 枚まとめて AI の着せ替えやキャラ設定に。',
- gender: { all: 'すべて', F: 'レディース', M: 'メンズ', U: 'ユニセックス' }, genderLabel: '性別', cat: 'カテゴリ', all: 'すべて',
- views: ['正面', '斜め', '横', '背面'], viewLabel: 'アングル', count: (n, all) => n + ' / ' + all + ' 点', empty: '該当する衣装がありません',
- open: (id) => id + ' を拡大', gap: 'このアングルは準備中', download: 'この画像をダウンロード · 900', save: '写真に保存',
- descLabel: '英語の衣装説明(プロンプトにそのまま使えます)', adultOn: 'ランジェリー:表示', adultOff: 'ランジェリー:ぼかし', adultHint: 'ランジェリーは初期状態でぼかしています。1 点ずつタップで表示、ここで全部表示できます', veilTitle: 'セクシーランジェリー(ぼかし中)',
- pairWith: (id) => id + ' に合わせる', startWith: 'この衣装でポーズを選ぶ', pairCostume: (id) => id + ' を合わせる', startPose: 'このポーズに衣装を合わせる',
- paired: (id) => id + ' を合わせました',
- tray: 'コーデ', slotPose: 'ポーズ', slotCostume: '衣装', pickPose: 'ポーズを選ぶ', pickCostume: '衣装を選ぶ', picking: '選択中',
- soon: '小物 · 制作中', done: '完成', hide: '閉じる', end: 'コーデを終了',
- group: 'この組み合わせ', prompt: '合成プロンプト', dlPose: 'ポーズを保存', dlCostume: '衣装を保存', saveGroup: '2 枚とも保存', holdGroup: '各画像を長押しして「画像を保存」',
- viewNote: (v) => '衣装のアングルはポーズに合わせます:' + v,
- bandEyebrow: '素材ライブラリ', bandTitle: 'ポーズに衣装を合わせる', bandSub: 'ポーズの拡大表示で「このポーズに衣装を合わせる」を押すか、ここから選んでください。', bandCta: (n) => n + ' 点の衣装を見る',
- keys: '← → アングル ↑ ↓ 前後の衣装 Esc 閉じる'
+ groups: { wear: '身につける・持つ', near: 'そばに', env: '環境' },
+ views: { front: '正面', diag: '斜め', side: '横', back: '背面', above: '上から', below: '下から', eye: '目線' },
+ title: (name, n, unit) => name + ' · ' + n + ' ' + unit, count: (n, all) => n + ' / ' + all,
+ gender: { all: 'すべて', F: 'レディース', M: 'メンズ', U: 'ユニセックス' }, genderLabel: '性別', cat: 'カテゴリ', all: 'すべて', viewLabel: 'アングル', mainView: 'メイン',
+ empty: '該当する素材がありません', open: (id) => id + ' を拡大', gap: 'このアングルは準備中', download: 'この画像をダウンロード · 900', save: '写真に保存',
+ descLabel: '英語の説明(プロンプトにそのまま使えます)', veilTitle: 'セクシーランジェリー(ぼかし中)',
+ adultOn: 'ランジェリー:表示', adultOff: 'ランジェリー:ぼかし', adultHint: 'ランジェリーは初期状態でぼかしています。1 点ずつタップで表示、ここで全部表示できます',
+ pairWith: (id) => id + ' に合わせる', startWith: 'これでポーズを選ぶ', startPose: 'このポーズで組み合わせる', pairItems: (n) => '選んだ ' + n + ' 点を合わせる',
+ tray: 'コーデ', slotPose: 'ポーズ', pickPose: 'ポーズを選ぶ', picking: '選択中', add: '素材を追加', addFor: (id) => id + ' に追加',
+ done: '完成', hide: '閉じる', end: 'コーデを終了', group: (n) => 'この組み合わせ · ' + n + ' 点', prompt: '合成プロンプト', change: '変更', remove: (x) => x + 'を外す',
+ dl: '保存', saveGroup: (n) => 'まとめて保存 · ' + n + ' 枚', holdGroup: '各画像を長押しして「画像を保存」',
+ bandEyebrow: '素材ライブラリ', bandTitle: 'ポーズに衣装・小物・背景を', bandSub: '6 つのライブラリはすべてポーズにつながります。ポーズの拡大表示で「このポーズで組み合わせる」を押すか、ここから選んでください。',
+ bandCount: (n, v) => n + ' 点 · ' + v + ' 枚',
+ menu: 'メニュー', poseSets: (n) => n + ' ポーズ', libsLabel: '素材ライブラリ · ポーズに合わせて', libsCrumb: '素材',
+ keys: '← → アングル ↑ ↓ 前後の素材 Esc 閉じる'
},
en: {
- nav: 'Costumes', crumb: 'Library / Costumes',
- title: (n) => 'Costumes · ' + n, sub: 'Ghost-mannequin product shots from the front, three-quarter, side and back. Pick one, pair it with any pose and hand both images to your AI outfit or character tool.',
- gender: { all: 'All', F: 'Women', M: 'Men', U: 'Unisex' }, genderLabel: 'Gender', cat: 'Category', all: 'All',
- views: ['Front', '3/4', 'Side', 'Back'], viewLabel: 'View', count: (n, all) => n + ' / ' + all, empty: 'No costumes match',
- open: (id) => 'Open ' + id, gap: 'This view is not ready yet', download: 'Download · 900', save: 'Save to Photos',
- descLabel: 'English costume description, ready for a prompt', adultOn: 'Lingerie: shown', adultOff: 'Lingerie: blurred', adultHint: 'Lingerie is blurred by default; tap one to see it, or show them all here', veilTitle: 'Lingerie, blurred',
- pairWith: (id) => 'Pair with ' + id, startWith: 'Find a pose for this', pairCostume: (id) => 'Pair with ' + id, startPose: 'Pick a costume for this pose',
- paired: (id) => 'Paired with ' + id,
- tray: 'Pairing', slotPose: 'Pose', slotCostume: 'Costume', pickPose: 'Pick a pose', pickCostume: 'Pick a costume', picking: 'picking',
- soon: 'Props · coming', done: 'Done', hide: 'Hide', end: 'End pairing',
- group: 'This pair', prompt: 'Combined prompt', dlPose: 'Pose image', dlCostume: 'Costume image', saveGroup: 'Save both', holdGroup: 'Long-press each image and choose “Save Image”',
- viewNote: (v) => 'Costume view follows the pose: ' + v,
- bandEyebrow: 'Library', bandTitle: 'Dress your pose', bandSub: 'Open any pose and tap “Pick a costume for this pose”, or start here.', bandCta: (n) => 'Browse ' + n + ' costumes',
- keys: '← → view ↑ ↓ costume Esc close'
+ groups: { wear: 'Worn and held', near: 'Beside', env: 'Surroundings' },
+ views: { front: 'Front', diag: '3/4', side: 'Side', back: 'Back', above: 'Above', below: 'Below', eye: 'Eye level' },
+ title: (name, n) => name + ' · ' + n, count: (n, all) => n + ' / ' + all,
+ gender: { all: 'All', F: 'Women', M: 'Men', U: 'Unisex' }, genderLabel: 'Gender', cat: 'Category', all: 'All', viewLabel: 'View', mainView: 'Main view',
+ empty: 'Nothing matches', open: (id) => 'Open ' + id, gap: 'This view is not ready yet', download: 'Download · 900', save: 'Save to Photos',
+ descLabel: 'English description, ready for a prompt', veilTitle: 'Lingerie, blurred',
+ adultOn: 'Lingerie: shown', adultOff: 'Lingerie: blurred', adultHint: 'Lingerie is blurred by default; tap one to see it, or show them all here',
+ pairWith: (id) => 'Pair with ' + id, startWith: 'Find a pose for this', startPose: 'Build a set on this pose', pairItems: (n) => 'Pair with the ' + n + ' picked',
+ tray: 'Set', slotPose: 'Pose', pickPose: 'Pick a pose', picking: 'picking', add: 'Add another library', addFor: (id) => 'Add to ' + id,
+ done: 'Done', hide: 'Hide', end: 'End this set', group: (n) => 'This set · ' + n, prompt: 'Combined prompt', change: 'Change', remove: (x) => 'Remove ' + x,
+ dl: 'Download', saveGroup: (n) => 'Save all · ' + n, holdGroup: 'Long-press each image and choose “Save Image”',
+ bandEyebrow: 'Library', bandTitle: 'Dress, prop and place your pose', bandSub: 'All six libraries attach to a pose: open one and tap “Build a set on this pose”, or start here.',
+ bandCount: (n, v) => n + ' items · ' + v + ' images',
+ menu: 'Menu', poseSets: (n) => n + ' poses', libsLabel: 'Library · to pair with a pose', libsCrumb: 'Library',
+ keys: '← → view ↑ ↓ item Esc close'
},
ko: {
- nav: '의상', crumb: '소재 라이브러리 / 의상',
- title: (n) => '의상 · ' + n + '벌', sub: '고스트 마네킹 상품 사진. 정면·사선·측면·뒷면 4개 앵글. 원하는 포즈에 맞춰 두 장을 함께 AI 의상 변경이나 캐릭터 설정에 쓰세요.',
- gender: { all: '전체', F: '여성', M: '남성', U: '공용' }, genderLabel: '성별', cat: '분류', all: '전체',
- views: ['정면', '사선', '측면', '뒷면'], viewLabel: '앵글', count: (n, all) => n + ' / ' + all + '벌', empty: '조건에 맞는 의상이 없습니다',
- open: (id) => id + ' 크게 보기', gap: '이 앵글은 준비 중', download: '이 이미지 다운로드 · 900', save: '사진에 저장',
- descLabel: '영어 의상 설명 (프롬프트에 바로 사용)', adultOn: '란제리: 표시', adultOff: '란제리: 흐림', adultHint: '란제리는 기본으로 흐리게 표시됩니다. 하나씩 눌러 보거나 여기서 모두 표시하세요', veilTitle: '란제리, 흐림 처리됨',
- pairWith: (id) => id + '에 맞추기', startWith: '이 의상으로 포즈 고르기', pairCostume: (id) => id + ' 맞추기', startPose: '이 포즈에 의상 맞추기',
- paired: (id) => id + ' 맞춤 완료',
- tray: '코디', slotPose: '포즈', slotCostume: '의상', pickPose: '포즈 고르기', pickCostume: '의상 고르기', picking: '고르는 중',
- soon: '소품 · 제작 중', done: '완료', hide: '접기', end: '코디 끝내기',
- group: '이 조합', prompt: '합성 프롬프트', dlPose: '포즈 저장', dlCostume: '의상 저장', saveGroup: '두 장 모두 저장', holdGroup: '각 이미지를 길게 눌러 「이미지 저장」',
- viewNote: (v) => '의상 앵글은 포즈를 따릅니다: ' + v,
- bandEyebrow: '소재 라이브러리', bandTitle: '포즈에 의상 입히기', bandSub: '포즈를 크게 열고 「이 포즈에 의상 맞추기」를 누르거나 여기서 먼저 고르세요.', bandCta: (n) => '의상 ' + n + '벌 보기',
- keys: '← → 앵글 ↑ ↓ 이전·다음 의상 Esc 닫기'
+ groups: { wear: '입고 드는 것', near: '곁에', env: '환경' },
+ views: { front: '정면', diag: '사선', side: '측면', back: '뒷면', above: '부감', below: '앙각', eye: '눈높이' },
+ title: (name, n, unit) => name + ' · ' + n + unit, count: (n, all) => n + ' / ' + all,
+ gender: { all: '전체', F: '여성', M: '남성', U: '공용' }, genderLabel: '성별', cat: '분류', all: '전체', viewLabel: '앵글', mainView: '기본 앵글',
+ empty: '조건에 맞는 소재가 없습니다', open: (id) => id + ' 크게 보기', gap: '이 앵글은 준비 중', download: '이 이미지 다운로드 · 900', save: '사진에 저장',
+ descLabel: '영어 설명 (프롬프트에 바로 사용)', veilTitle: '란제리, 흐림 처리됨',
+ adultOn: '란제리: 표시', adultOff: '란제리: 흐림', adultHint: '란제리는 기본으로 흐리게 표시됩니다. 하나씩 눌러 보거나 여기서 모두 표시하세요',
+ pairWith: (id) => id + '에 맞추기', startWith: '이걸로 포즈 고르기', startPose: '이 포즈로 조합하기', pairItems: (n) => '고른 ' + n + '개 맞추기',
+ tray: '조합', slotPose: '포즈', pickPose: '포즈 고르기', picking: '고르는 중', add: '소재 더하기', addFor: (id) => id + '에 더하기',
+ done: '완료', hide: '접기', end: '조합 끝내기', group: (n) => '이 조합 · ' + n + '개', prompt: '합성 프롬프트', change: '바꾸기', remove: (x) => x + ' 빼기',
+ dl: '저장', saveGroup: (n) => '모두 저장 · ' + n + '장', holdGroup: '각 이미지를 길게 눌러 「이미지 저장」',
+ bandEyebrow: '소재 라이브러리', bandTitle: '포즈에 옷·소품·배경을', bandSub: '여섯 라이브러리는 모두 포즈에 붙습니다. 포즈를 크게 열고 「이 포즈로 조합하기」를 누르거나 여기서 먼저 고르세요.',
+ bandCount: (n, v) => n + '개 · ' + v + '장',
+ menu: '메뉴', poseSets: (n) => n + '세트', libsLabel: '소재 라이브러리 · 포즈에 맞춰', libsCrumb: '소재',
+ keys: '← → 앵글 ↑ ↓ 이전·다음 Esc 닫기'
}
};
@@ -223,7 +227,8 @@ window.I18N_PAGES = // BEGIN-JSON
{
"zh": {
"langName": "中文", "langShort": "中", "ogLocale": "zh_CN",
- "navCostumes": "服装", "costumeTitle": "服装参考 · {n} 件 × 4 视角 | Shisei", "costumeDesc": "{n} 件隐形人台服装参考图:中国历代、世界民族、现代日常、礼服、制服、幻想等,每件正面、斜侧、侧面、背面四个视角,CC0。",
+ "navLibrary": "素材库", "libTitle": "{name}参考 · {n} {unit} | Shisei", "libDesc": "{n} {unit}{name}参考图,挂在姿势上用:{sub} CC0。",
+ "libs": {"costume": {"name": "服装", "unit": "件", "sub": "隐形人台商品照,正面、斜侧、侧面、背面四个视角。", "role": "穿在身上"}, "prop": {"name": "道具", "unit": "件", "sub": "悬浮商品照:乐器、古风器物、手持与运动器材,四个视角。", "role": "拿在手里"}, "furniture": {"name": "家具", "unit": "件", "sub": "椅、沙发、桌台、中式家具和造型台,五个视角含俯视。", "role": "坐、靠、倚"}, "animal": {"name": "动物", "unit": "个动作", "sub": "和姿势同一画法的动物线稿:猫、狗、马、鸟、野生和幻想生物。", "role": "陪在身边"}, "scene": {"name": "场景", "unit": "处", "sub": "室内、城市、自然、历史与影棚背景,平视、俯视、仰视三个视角。", "role": "站在哪里"}, "light": {"name": "光线", "unit": "种", "sub": "同一个人台在不同光线下:时段、空间、人工光、光位和氛围色。", "role": "光从哪来"}},
"navPoses": "姿势", "navChangelog": "更新日志",
"views": ["正面", "斜侧", "侧面", "俯视", "仰视"],
"descLabel": "英文姿势描述,可直接放进提示词", "copy": "复制", "copied": "已复制",
@@ -252,7 +257,8 @@ window.I18N_PAGES = // BEGIN-JSON
},
"ja": {
"langName": "日本語", "langShort": "日", "ogLocale": "ja_JP",
- "navCostumes": "衣装", "costumeTitle": "衣装リファレンス · {n} 点 × 4 アングル | Shisei", "costumeDesc": "ゴーストマネキンの衣装リファレンス {n} 点。中国の歴代衣装、世界の民族衣装、現代服、フォーマル、制服、ファンタジーなど。各 4 アングル、CC0。",
+ "navLibrary": "素材", "libTitle": "{name}リファレンス · {n} {unit} | Shisei", "libDesc": "ポーズに合わせる{name}リファレンス {n} {unit}。{sub} CC0。",
+ "libs": {"costume": {"name": "衣装", "unit": "点", "sub": "ゴーストマネキンの商品写真。正面・斜め・横・背面の 4 アングル。", "role": "身にまとう"}, "prop": {"name": "小物", "unit": "点", "sub": "楽器、古風な道具、手持ち・スポーツ用品の商品写真。4 アングル。", "role": "手に持つ"}, "furniture": {"name": "家具", "unit": "点", "sub": "椅子、ソファ、テーブル、中国家具、撮影台。上からを含む 5 アングル。", "role": "座る・もたれる"}, "animal": {"name": "動物", "unit": "ポーズ", "sub": "ポーズと同じ描き方の動物線画:猫、犬、馬、鳥、野生動物、幻想生物。", "role": "そばにいる"}, "scene": {"name": "背景", "unit": "か所", "sub": "室内、街、自然、歴史・ファンタジー、スタジオ背景。目線・上から・下からの 3 アングル。", "role": "どこに立つ"}, "light": {"name": "ライティング", "unit": "種", "sub": "同じマネキンをさまざまな光で:時間帯、空間、人工光、ライト位置、雰囲気の色。", "role": "光の向き"}},
"navPoses": "ポーズ", "navChangelog": "更新履歴",
"views": ["正面", "斜め", "横", "上から", "下から"],
"descLabel": "英語のポーズ説明(プロンプトにそのまま使えます)", "copy": "コピー", "copied": "コピーしました",
@@ -281,7 +287,8 @@ window.I18N_PAGES = // BEGIN-JSON
},
"en": {
"langName": "English", "langShort": "EN", "ogLocale": "en_US",
- "navCostumes": "Costumes", "costumeTitle": "Costume reference · {n} outfits × 4 views | Shisei", "costumeDesc": "{n} ghost-mannequin costume references: Chinese historical, world traditional, everyday, formal, workwear, fantasy and more, each from the front, three-quarter, side and back. CC0.",
+ "navLibrary": "Library", "libTitle": "{name} reference · {n} {unit} | Shisei", "libDesc": "{n} {unit} to pair with a pose. {sub} CC0.",
+ "libs": {"costume": {"name": "Costumes", "unit": "outfits", "sub": "Ghost-mannequin product shots from the front, three-quarter, side and back.", "role": "Worn"}, "prop": {"name": "Props", "unit": "items", "sub": "Instruments, period objects, handheld and sports gear, from four views.", "role": "Held"}, "furniture": {"name": "Furniture", "unit": "pieces", "sub": "Chairs, sofas, tables, Chinese furniture and studio blocks, five views including from above.", "role": "Sat on"}, "animal": {"name": "Animals", "unit": "actions", "sub": "Animal line art drawn like the poses: cats, dogs, horses, birds, wildlife and fantasy creatures.", "role": "Beside you"}, "scene": {"name": "Scenes", "unit": "places", "sub": "Interiors, city, nature, historical and studio backdrops at eye level, from above and from below.", "role": "Where"}, "light": {"name": "Lighting", "unit": "setups", "sub": "One mannequin under different light: time of day, spaces, lamps, studio positions and colour moods.", "role": "Light"}},
"navPoses": "Poses", "navChangelog": "Changelog",
"views": ["Front", "3/4", "Side", "Above", "Below"],
"descLabel": "Pose description, ready for a prompt", "copy": "Copy", "copied": "Copied",
@@ -310,7 +317,8 @@ window.I18N_PAGES = // BEGIN-JSON
},
"ko": {
"langName": "한국어", "langShort": "한", "ogLocale": "ko_KR",
- "navCostumes": "의상", "costumeTitle": "의상 레퍼런스 · {n}벌 × 4앵글 | Shisei", "costumeDesc": "고스트 마네킹 의상 레퍼런스 {n}벌. 중국 역대 복식, 세계 전통 의상, 데일리, 포멀, 유니폼, 판타지 등. 각 4앵글, CC0.",
+ "navLibrary": "소재", "libTitle": "{name} 레퍼런스 · {n}{unit} | Shisei", "libDesc": "포즈에 맞추는 {name} 레퍼런스 {n}{unit}. {sub} CC0.",
+ "libs": {"costume": {"name": "의상", "unit": "벌", "sub": "고스트 마네킹 상품 사진. 정면·사선·측면·뒷면 4앵글.", "role": "입는 것"}, "prop": {"name": "소품", "unit": "개", "sub": "악기, 옛 물건, 손에 드는 물건과 운동 용품. 4앵글.", "role": "손에 드는 것"}, "furniture": {"name": "가구", "unit": "점", "sub": "의자, 소파, 테이블, 중국 가구, 촬영 받침대. 위에서 본 것 포함 5앵글.", "role": "앉고 기대는 것"}, "animal": {"name": "동물", "unit": "동작", "sub": "포즈와 같은 화법의 동물 선화: 고양이, 개, 말, 새, 야생 동물, 판타지 생물.", "role": "곁에 있는 것"}, "scene": {"name": "배경", "unit": "곳", "sub": "실내, 도시, 자연, 역사·판타지, 스튜디오 배경. 눈높이·부감·앙각 3앵글.", "role": "어디에 서는가"}, "light": {"name": "조명", "unit": "가지", "sub": "같은 마네킹을 다양한 빛으로: 시간대, 공간, 인공광, 조명 위치, 분위기 색.", "role": "빛의 방향"}},
"navPoses": "포즈", "navChangelog": "변경 내역",
"views": ["정면", "대각선", "옆", "위에서", "아래에서"],
"descLabel": "영문 포즈 설명 (프롬프트에 바로 사용)", "copy": "복사", "copied": "복사됨",
diff --git a/web/index.html b/web/index.html
index a0ce593c..92dca8a9 100644
--- a/web/index.html
+++ b/web/index.html
@@ -18,7 +18,6 @@ __HEAD__
</a>
<div class="nav-links">
<a href="#all" data-i18n="navPoses"></a>
- <a href="costume/" data-i18n="navCostumes"></a>
<button type="button" class="linklike" data-open="how" data-i18n="navHow"></button>
<a href="__CHANGELOG__" data-i18n="navChangelog"></a>
</div>
@@ -84,8 +83,8 @@ __HEAD__
</section>
<section class="wrap c-band" id="cBand" aria-labelledby="cBandT" hidden>
- <div class="c-band-t"><span class="eyebrow" id="cBandEyebrow"></span><h2 id="cBandT"></h2><p id="cBandSub"></p></div>
- <a class="c-band-card" href="costume/"><span class="c-band-imgs" id="cBandImgs"></span><span class="c-band-cta"><b id="cBandCta"></b><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></span></a>
+ <div class="c-band-h"><div class="c-band-t"><span class="eyebrow" id="cBandEyebrow"></span><h2 id="cBandT"></h2><p id="cBandSub"></p></div><span class="count" id="cBandCount"></span></div>
+ <div class="c-band-libs" id="cBandLibs"></div>
</section>
__NOSCRIPT__
@@ -189,7 +188,7 @@ __NOSCRIPT__
<div class="nudge" id="nudge" role="status" hidden><span id="nudgeText"></span><button type="button" id="nudgeAll" data-i18n="veilAll"></button><button type="button" class="nudge-x" id="nudgeClose" data-i18n-aria="close"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div>
<script id="catalog" type="application/json">__CATALOG__</script>
-<script>window.SHISEI = { repo: '__REPO__', version: '__VERSION__', base: '__BASE__', lang: '__LOC__', packs: __PACKS__, costumes: __COSTUME_TEASER__ };</script>
+<script>window.SHISEI = { repo: '__REPO__', version: '__VERSION__', base: '__BASE__', lang: '__LOC__', packs: __PACKS__ };</script>
<script src="__BASE__i18n.js?v=__VERSION__"></script>
<script src="__BASE__common.js?v=__VERSION__"></script>
<script src="__BASE__tray.js?v=__VERSION__"></script>
diff --git a/web/costume.html b/web/library.html
similarity index 93%
rename from web/costume.html
rename to web/library.html
index 7db06d7a..ce972f5c 100644
--- a/web/costume.html
+++ b/web/library.html
@@ -18,7 +18,6 @@ __HEAD__
</a>
<div class="nav-links">
<a href="__HOME__#all" data-i18n="navPoses"></a>
- <a href="./" aria-current="page" data-c="nav"></a>
<a href="__CHANGELOG__" data-i18n="navChangelog"></a>
</div>
<div class="nav-tools">
@@ -40,9 +39,9 @@ __HEAD__
<main>
<header class="wrap c-head">
- <p class="c-crumb"><a href="__HOME__" data-i18n="navPoses"></a><span aria-hidden="true">/</span><span data-c="nav"></span></p>
+ <p class="c-crumb"><a href="__HOME__" data-i18n="navPoses"></a><span aria-hidden="true">/</span><span id="cCrumbLib"></span><span aria-hidden="true">/</span><span id="cCrumbName"></span></p>
<h1 id="cTitle"></h1>
- <p class="c-sub" data-c="sub"></p>
+ <p class="c-sub" id="cSub"></p>
</header>
<section class="wrap c-sec" id="all" aria-labelledby="cTitle">
@@ -69,7 +68,7 @@ __NOSCRIPT__
<nav class="foot-links" aria-label="Footer">
<a href="__REPO__">GitHub</a>
<a href="__CHANGELOG__"><span data-i18n="navChangelog"></span> v__VERSION__</a>
- <a href="__BASE__costumes.json">costumes.json</a>
+ <a href="__DATAFILE__" id="cDataLink"></a>
</nav>
</div>
</footer>
@@ -105,21 +104,21 @@ __NOSCRIPT__
</div>
</div>
<div class="lb-desc clb-desc" id="clbDescBox">
- <div class="lb-desc-h"><span data-c="descLabel"></span><button type="button" class="pill light tiny" id="clbCopy" data-i18n="copy"></button></div>
+ <div class="lb-desc-h"><span id="clbDescLabel"></span><button type="button" class="pill light tiny" id="clbCopy" data-i18n="copy"></button></div>
<p id="clbDesc"></p>
</div>
- <p class="keys" data-c="keys"></p>
+ <p class="keys" id="clbKeys"></p>
</aside>
<button type="button" class="lb-close" id="clbClose" autofocus data-i18n-aria="close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
</div>
</dialog>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
-<script id="costumes" type="application/json">__COSTUMES__</script>
+<script id="libdata" type="application/json">__LIBDATA__</script>
<script>window.SHISEI = { repo: '__REPO__', version: '__VERSION__', base: '__BASE__', lang: '__LOC__' };</script>
<script src="__BASE__i18n.js?v=__VERSION__"></script>
<script src="__BASE__common.js?v=__VERSION__"></script>
<script src="__BASE__tray.js?v=__VERSION__"></script>
-<script src="__BASE__costume.js?v=__VERSION__"></script>
+<script src="__BASE__library.js?v=__VERSION__"></script>
</body>
</html>
diff --git a/web/costume.js b/web/library.js
similarity index 80%
rename from web/costume.js
rename to web/library.js
index 7bba69a5..bdf2bccf 100644
--- a/web/costume.js
+++ b/web/library.js
@@ -1,21 +1,24 @@
-/* The costume library page (costume/): a grid of ghost-mannequin outfits and a lightbox, both built from the
- costumes.json the build inlines. It is a satellite of the pose gallery (docs/DESIGN.md, 服装与搭配): a costume is
- picked to go with a pose, through the pairing tray (web/tray.js). */
+/* A library page (costume/, prop/, furniture/, animal/, scene/, light/): a grid and a lightbox, built from the
+ library data the build inlines. Every library is a satellite of the pose gallery (docs/DESIGN.md, 素材库与搭配): an
+ item is picked to go with a pose, through the tray (web/tray.js). */
(() => {
'use strict';
- const DATA = JSON.parse(document.getElementById('costumes').textContent);
+ const DATA = JSON.parse(document.getElementById('libdata').textContent);
+ const LIB = DATA.lib;
const LANGS = ['zh', 'ja', 'en', 'ko'];
const PREFIX = { zh: '', ja: 'ja/', en: 'en/', ko: 'ko/' };
const loc = LANGS.includes(window.SHISEI.lang) ? window.SHISEI.lang : 'zh';
const BASE = window.SHISEI.base || '';
- const T = window.I18N[loc], TP = window.I18N_PAGES[loc], TC = window.I18N_COSTUME[loc];
- const VIEWS = window.ShiseiTray.views;
+ const T = window.I18N[loc], TC = window.I18N_LIB[loc], LN = T.libs[LIB];
+ const VIEWS = DATA.views;
+ const VNAME = VIEWS.map((v) => TC.views[v]);
+ const MEDIA = window.SHISEI_NAV ? window.SHISEI_NAV.media : BASE;
const EYE_OFF = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3 3l18 18"/><path d="M10.6 5.1A10 10 0 0 1 12 5c6 0 10 7 10 7a17 17 0 0 1-3.2 3.9"/><path d="M6.6 6.6C3.9 8.4 2 12 2 12s4 7 10 7c1.8 0 3.4-.6 4.8-1.4"/><path d="M9.9 9.9a3 3 0 0 0 4.2 4.2"/></svg>';
const GAP_IC = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 8h3l2-2.5h6L17 8h3v11H4z"/><circle cx="12" cy="13" r="3.5"/></svg>';
const $ = (id) => document.getElementById(id);
const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
- const img = (tier, f) => BASE + 'images/costume/grey/' + tier + '/' + f;
+ const img = (tier, f) => MEDIA + 'images/' + DATA.dir + '/' + tier + '/' + f;
const srcset = (f) => img('w300', f) + ' 300w, ' + img('w600', f) + ' 600w, ' + img('w900', f) + ' 900w';
const store = {
get: (k) => { try { return localStorage.getItem('shisei.' + k); } catch (e) { return null; } },
@@ -29,15 +32,18 @@
const S = {
cat: catName.has(params.get('cat')) ? params.get('cat') : 'all',
g: ['F', 'M', 'U'].includes(params.get('g')) ? params.get('g') : 'all',
- view: Math.max(0, VIEWS.indexOf(params.get('view'))),
+ // -1: each item on its own main view (an animal's side, a bird's front); a view picked here applies to all.
+ view: VIEWS.indexOf(params.get('view')),
adult: store.get('adult') === '1',
revealed: new Set()
};
const veiled = (c) => c.suggestive && !S.adult && !S.revealed.has(c.id);
const first = (c) => Math.max(0, c.v.findIndex(Boolean));
- const shown = (c) => (c.v[S.view] ? S.view : first(c));
+ const shown = (c) => (S.view >= 0 && c.v[S.view] ? S.view : c.m);
+ const hasGender = items.some((c) => c.g);
+ const sameMain = items.every((c) => c.m === items[0].m);
const tray = window.ShiseiTray;
- tray.setPage('costume');
+ tray.setPage(LIB);
function toast(msg) {
const el = $('toast');
@@ -50,7 +56,7 @@
const p = new URLSearchParams();
if (S.cat !== 'all') p.set('cat', S.cat);
if (S.g !== 'all') p.set('g', S.g);
- if (S.view) p.set('view', VIEWS[S.view]);
+ if (S.view >= 0) p.set('view', VIEWS[S.view]);
const qs = p.toString();
history.replaceState(null, '', location.pathname + (qs ? '?' + qs : '') + location.hash);
}
@@ -59,10 +65,16 @@
function applyText() {
document.querySelectorAll('[data-i18n]').forEach((el) => { const v = T[el.dataset.i18n]; if (typeof v === 'string') el.textContent = v; });
document.querySelectorAll('[data-i18n-aria]').forEach((el) => el.setAttribute('aria-label', T[el.dataset.i18nAria]));
- document.querySelectorAll('[data-c]').forEach((el) => { const v = TC[el.dataset.c]; if (typeof v === 'string') el.textContent = v; });
$('langName').textContent = T.langName;
$('langShort').textContent = T.langShort;
- $('cTitle').textContent = TC.title(items.length);
+ $('cTitle').textContent = TC.title(LN.name, items.length, LN.unit);
+ $('cCrumbLib').textContent = T.navLibrary;
+ $('cCrumbName').textContent = LN.name;
+ $('cSub').textContent = LN.sub;
+ $('cDataLink').textContent = $('cDataLink').getAttribute('href').split('/').pop();
+ $('clbDescLabel').textContent = TC.descLabel;
+ $('clbKeys').textContent = TC.keys;
+ document.body.dataset.kind = DATA.kind;
}
/* filters */
@@ -77,8 +89,10 @@
.map(([k, n]) => chip(k.key, k.name[loc], n)).join('');
const seg = (label, opts) => '<div class="seg" role="group" aria-label="' + esc(label) + '">' +
opts.map(([text, act, on]) => '<button type="button" data-cact="' + act + '" aria-pressed="' + on + '">' + esc(text) + '</button>').join('') + '</div>';
- $('cFilters').innerHTML = seg(TC.genderLabel, ['all', 'F', 'M', 'U'].map((g) => [TC.gender[g], 'g:' + g, S.g === g])) +
- seg(TC.viewLabel, TC.views.map((v, i) => [v, 'view:' + i, S.view === i]));
+ $('cFilters').innerHTML = (hasGender ? seg(TC.genderLabel, ['all', 'F', 'M', 'U'].map((g) => [TC.gender[g], 'g:' + g, S.g === g])) : '') +
+ // Every item opens on its main view; when they all share it, that view shows as picked. Animals differ (a
+ // quadruped's side, a bird's front), so they get a "main view" choice of their own.
+ seg(TC.viewLabel, (sameMain ? [] : [[TC.mainView, 'view:-1', S.view < 0]]).concat(VNAME.map((v, i) => [v, 'view:' + i, S.view === i || (S.view < 0 && sameMain && i === items[0].m)])));
const adult = $('adult');
adult.hidden = !items.some((c) => c.suggestive);
adult.setAttribute('aria-checked', String(S.adult));
@@ -93,11 +107,11 @@
const name = c.n[loc];
return '<article class="ccard' + (veil ? ' veiled' : '') + '" data-id="' + c.id + '">' +
'<div class="ctile-box"><a class="ctile" href="#' + c.id + '-' + VIEWS[v] + '" data-copen="' + c.id + '" aria-label="' + esc(TC.open(c.id) + ' ' + name) + '">' +
- (f ? '<img src="' + img('w300', f) + '" srcset="' + srcset(f) + '" sizes="(max-width: 720px) 31vw, 240px" alt="' + esc(c.id + ' ' + name + ' · ' + TC.views[v]) + '" loading="lazy" decoding="async">' : '') +
- (v !== S.view ? '<span class="cvlabel">' + esc(TC.views[v]) + '</span>' : '') + '</a>' +
+ (f ? '<img src="' + img('w300', f) + '" srcset="' + srcset(f) + '" sizes="(max-width: 720px) 31vw, 240px" alt="' + esc(c.id + ' ' + name + ' · ' + VNAME[v]) + '" loading="lazy" decoding="async">' : '') +
+ (S.view >= 0 && v !== S.view ? '<span class="cvlabel">' + esc(VNAME[v]) + '</span>' : '') + '</a>' +
(veil ? '<button type="button" class="veil" data-creveal="' + c.id + '" aria-label="' + esc(T.veilShow(c.id) + ' ' + name) + '"><span class="veil-ic">' + EYE_OFF + '</span><span class="veil-t">' + esc(T.veilTap) + '</span></button>' : '') +
quickHtml(c) + '</div>' +
- '<div class="ccard-t"><h3>' + esc(name) + '</h3><span class="mono">' + c.id + ' · ' + esc(catName.get(c.cat)) + '</span></div></article>';
+ '<div class="ccard-t"><h3>' + esc(name) + '</h3><span class="mono">' + c.id + ' · ' + esc(c.sub ? c.sub[loc] : catName.get(c.cat)) + '</span></div></article>';
}
// Hover / focus shortcut on desktop: pair without opening the lightbox, when a pose is waiting in the tray.
function quickHtml(c) {
@@ -143,11 +157,11 @@
/* pairing */
function pairIt(c, v) {
- tray.set('costume', { id: c.id, files: c.v, names: c.n, keep: c.keep, v });
+ tray.set(LIB, { id: c.id, files: c.v, names: c.n, clause: c.clause, v });
if ($('clb').open) $('clb').close();
// With a pose waiting, the tray opens the pair: that is the confirmation.
if (tray.get().pose) return;
- // No pose yet: the pose is the anchor, so go and pick one; the tray keeps the costume.
+ // No pose yet: the pose is the anchor, so go and pick one; the tray keeps the item.
else location.href = BASE + PREFIX[loc] + '#all';
}
window.addEventListener('shisei:combo', () => {
@@ -158,12 +172,11 @@
});
if ($('clb').open) renderLb();
});
- // The tray's costume slot opens that costume here instead of reloading the page.
+ // The tray's slot for this library opens that item here instead of reloading the page.
tray.onSlot = (kind, st) => {
- if (kind !== 'costume' || !st.costume || !byId.has(st.costume.id)) return false;
- const pv = st.pose ? st.pose.v : 0;
- const want = pv <= 2 ? pv : 0;
- openLb(st.costume.id, st.costume.files[want] ? want : first(byId.get(st.costume.id)));
+ const x = st.items && st.items[kind];
+ if (kind !== LIB || !x || !byId.has(x.id)) return false;
+ openLb(x.id, tray.viewFor(LIB, x.files));
return true;
};
@@ -201,18 +214,18 @@
$('clbVeilAll').textContent = T.veilAll;
const im = $('clbImg');
im.hidden = !f;
- if (f) { im.src = img('w900', f); im.alt = c.id + ' ' + name + ' · ' + TC.views[LB.v]; }
+ if (f) { im.src = img('w900', f); im.alt = c.id + ' ' + name + ' · ' + VNAME[LB.v]; }
$('clbGap').hidden = !!f;
$('clbGap').innerHTML = f ? '' : '<span class="gap-ic">' + GAP_IC + '</span><b>' + esc(TC.gap) + '</b>';
- $('clbCounter').textContent = TC.views[LB.v] + ' ' + (LB.v + 1) + '/4';
+ $('clbCounter').textContent = VNAME[LB.v] + ' ' + (LB.v + 1) + '/' + VIEWS.length;
$('clbPrev').disabled = $('clbNext').disabled = c.v.filter(Boolean).length < 2;
const list = lbList();
- $('clbMeta').textContent = c.id + ' · ' + catName.get(c.cat) + (c.era ? ' · ' + c.era[loc] : '') + ' · ' + TC.gender[c.g] + ' · ' + (list.indexOf(c) + 1) + '/' + list.length;
+ $('clbMeta').textContent = [c.id, catName.get(c.cat), c.sub && c.sub[loc], c.g && TC.gender[c.g], (list.indexOf(c) + 1) + '/' + list.length].filter(Boolean).join(' · ');
$('clbTitle').textContent = name;
$('clbNames').innerHTML = LANGS.filter((l) => l !== loc).map((l) => '<dt>' + l.toUpperCase() + '</dt><dd>' + esc(c.n[l]) + '</dd>').join('');
$('clbChips').setAttribute('aria-label', TC.viewLabel);
$('clbChips').innerHTML = VIEWS.map((_, i) => '<button type="button" data-cv="' + i + '" aria-pressed="' + (i === LB.v) + '"' + (c.v[i] ? '' : ' disabled') + '>' +
- '<span class="cchip">' + (c.v[i] ? '<img src="' + img('w300', c.v[i]) + '" alt="">' : GAP_IC) + '</span>' + esc(TC.views[i]) + '</button>').join('');
+ '<span class="cchip">' + (c.v[i] ? '<img src="' + img('w300', c.v[i]) + '" alt="">' : GAP_IC) + '</span>' + esc(VNAME[i]) + '</button>').join('');
$('clbDesc').textContent = c.desc || '';
$('clbDescBox').hidden = !c.desc;
const pose = tray.get().pose;
@@ -230,7 +243,8 @@
}
function stepView(d) {
const c = byId.get(LB.id);
- for (let k = 1; k <= 4; k++) { const i = (LB.v + d * k + 8) % 4; if (c.v[i]) { LB.v = i; break; } }
+ const n = VIEWS.length;
+ for (let k = 1; k <= n; k++) { const i = (LB.v + d * k + 2 * n) % n; if (c.v[i]) { LB.v = i; break; } }
renderLb();
}
function stepItem(d) {
@@ -278,7 +292,7 @@
function renderLangs() {
const qs = new URLSearchParams(location.search);
qs.delete('lang');
- const tail = 'costume/' + (qs.toString() ? '?' + qs : '') + location.hash;
+ const tail = LIB + '/' + (qs.toString() ? '?' + qs : '') + location.hash;
$('langList').innerHTML = LANGS.map((l) => '<a href="' + esc(BASE + PREFIX[l] + tail) + '" lang="' + window.I18N[l].htmlLang + '" hreflang="' + window.I18N[l].htmlLang +
'" data-lang-link="' + l + '"' + (l === loc ? ' aria-current="true"' : '') + '>' + esc(window.I18N[l].langName) + '</a>').join('');
}
@@ -293,10 +307,10 @@
store.set('theme', root.dataset.theme);
});
- // Deep links: #C061 or #C061-back.
+ // Deep links: #C061, #C061-back, #E029-above.
function openFromHash() {
- const m = location.hash.match(/^#(C\d{3})(?:-(front|diag|side|back))?$/);
- if (m && byId.has(m[1])) openLb(m[1], m[2] ? VIEWS.indexOf(m[2]) : 0);
+ const m = location.hash.match(/^#([A-Z]\d{3})(?:-([a-z]+))?$/);
+ if (m && byId.has(m[1])) openLb(m[1], m[2] && VIEWS.includes(m[2]) ? VIEWS.indexOf(m[2]) : byId.get(m[1]).m);
}
window.addEventListener('hashchange', openFromHash);
diff --git a/web/tray.js b/web/tray.js
index 4eedd304..d6619ef2 100644
--- a/web/tray.js
+++ b/web/tray.js
@@ -1,42 +1,80 @@
-/* The pairing tray (docs/DESIGN.md, 服装与搭配, design A of 2026-11-01): a pose and a costume picked on two different
- pages stay together in a bar at the bottom right (a full-width bar on phones). The pose is always the first slot:
- the library is a pose library and costumes, later props and scenes, attach to a pose. Each slot leads back to its
- page to change it; "Done" opens the pair, its combined prompt and the two images. The pair lives in localStorage
- so it survives moving between the gallery and the costume page; × ends it. */
+/* The tray (docs/DESIGN.md, 素材库与搭配): a pose and what goes with it, picked across the gallery and the library
+ pages, stays together in a bar at the bottom right (full width on phones). The pose is always the first slot: the
+ site is a pose library, and costumes, props, furniture, animals, scenes and light attach to a pose. Each library
+ gets a slot once something is picked from it; "+" lists the others. "Done" opens the set: every image, a combined
+ prompt and the downloads. The set lives in localStorage so it survives moving between pages; × ends it. */
(() => {
'use strict';
const KEY = 'shisei.combo';
const loc = document.documentElement.dataset.loc || 'zh';
- const TC = window.I18N_COSTUME[loc];
- const TP = window.I18N_PAGES[loc];
- const BASE = (window.SHISEI && window.SHISEI.base) || '';
+ const T = window.I18N[loc], TC = window.I18N_LIB[loc];
+ const NAV = window.SHISEI_NAV || { root: '', media: '', libs: [] };
+ const ROOT = NAV.root, MEDIA = NAV.media;
const PREFIX = { zh: '', ja: 'ja/', en: 'en/', ko: 'ko/' };
const POSE_VIEWS = ['front', 'diag', 'side', 'above', 'below'];
- const C_VIEWS = ['front', 'diag', 'side', 'back'];
const NAME = { zh: 'cn', ja: 'jp', en: 'en', ko: 'kr' };
+ const LIBS = new Map(NAV.libs.map((l) => [l.key, l]));
+ const ORDER = NAV.libs.map((l) => l.key);
const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
- const home = BASE + PREFIX[loc];
- const costumePage = home + 'costume/';
- const poseImg = (tier, f) => BASE + 'images/line/' + tier + '/' + f;
- const costumeImg = (tier, f) => BASE + 'images/costume/grey/' + tier + '/' + f;
- // Costumes have no view from above or below: those pose angles pair with the costume's front.
- const cView = (c, poseV) => {
- const want = poseV <= 2 ? poseV : 0;
- return c.files[want] ? want : c.files.findIndex(Boolean);
- };
+ const home = ROOT + PREFIX[loc];
+ const libPage = (lib) => home + lib + '/';
+ const poseImg = (tier, f) => ROOT + 'images/line/' + tier + '/' + f;
+ const libImg = (lib, tier, f) => MEDIA + 'images/' + LIBS.get(lib).dir + '/' + tier + '/' + f;
+ const ICON_X = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg>';
+ const ICON_DL = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M12 4v11m0 0-4-4m4 4 4-4M5 20h14"/></svg>';
+
const store = {
- get() { try { return JSON.parse(localStorage.getItem(KEY)) || {}; } catch (e) { return {}; } },
+ get() {
+ let s;
+ try { s = JSON.parse(localStorage.getItem(KEY)) || {}; } catch (e) { s = {}; }
+ // The first tray (2026-11-01) held one costume beside the pose.
+ if (s.costume) { s.items = Object.assign({ costume: Object.assign({ clause: 'wearing ' + (s.costume.keep || '') }, s.costume) }, s.items); delete s.costume; }
+ s.items = s.items || {};
+ for (const k of Object.keys(s.items)) if (!LIBS.has(k)) delete s.items[k];
+ return s;
+ },
set(v) { try { localStorage.setItem(KEY, JSON.stringify(v)); } catch (e) { /* private mode: this page only */ } }
};
let state = store.get();
- let open = false;
- let page = 'pose'; // which slot this page fills: 'pose' or 'costume'
+ let open = false, adding = false;
+ let page = 'pose'; // the slot this page fills: 'pose' or a library key
const ALBUM = matchMedia('(pointer: coarse)').matches;
const SHARE = ALBUM && !!navigator.canShare && (() => {
try { return navigator.canShare({ files: [new File([''], 'a.webp', { type: 'image/webp' })] }); } catch (e) { return false; }
})();
const files = new Map();
+ // A library's view for the pose's angle: the same angle when the library has it; scenes put the three level angles
+ // at eye level; anything else falls back to the front, then to the first view that exists.
+ function viewFor(lib, fs) {
+ const views = LIBS.get(lib).views;
+ const pv = POSE_VIEWS[state.pose ? state.pose.v : 0];
+ let want = views.indexOf(pv);
+ if (want < 0) want = views.indexOf(views.includes('eye') && ['front', 'diag', 'side'].includes(pv) ? 'eye' : 'front');
+ return want >= 0 && fs[want] ? want : fs.findIndex(Boolean);
+ }
+ const picked = () => ORDER.filter((k) => state.items[k]);
+ const poseHref = (p) => home + '#' + p.id + '-' + POSE_VIEWS[p.v];
+ const itemHref = (lib, x, v) => libPage(lib) + '#' + x.id + '-' + LIBS.get(lib).views[v];
+ const libName = (lib) => T.libs[lib].name;
+ const nameOf = (x) => (x.names && x.names[loc]) || x.id;
+ function prompt() {
+ const p = state.pose;
+ return [p ? p.desc : ''].concat(picked().map((k) => state.items[k].clause)).filter(Boolean).join(', ');
+ }
+ // Every image of the set at the pose's angle.
+ function members() {
+ const out = [];
+ const p = state.pose;
+ if (p) out.push({ lib: 'pose', x: p, v: p.v, href: poseHref(p), src: (t) => poseImg(t, p.file), file: 'shisei_' + p.id + '_' + POSE_VIEWS[p.v] + '.webp' });
+ for (const k of picked()) {
+ const x = state.items[k], v = viewFor(k, x.files);
+ if (v < 0) continue;
+ out.push({ lib: k, x, v, href: itemHref(k, x, v), src: (t) => libImg(k, t, x.files[v]), file: 'shisei_' + x.id + '_' + LIBS.get(k).views[v] + '.webp' });
+ }
+ return out;
+ }
+
const el = document.createElement('div');
el.className = 'tray';
el.id = 'tray';
@@ -45,65 +83,73 @@
el.hidden = true;
document.body.appendChild(el);
- function pair() {
- const p = state.pose, c = state.costume;
- if (!p || !c) return null;
- const cv = cView(c, p.v);
- return { p, c, cv, prompt: p.desc + (c.keep ? ', wearing ' + c.keep : '') };
+ const isLine = (lib) => lib === 'pose' || LIBS.get(lib).kind === 'line';
+ function thumb(m) {
+ return '<span class="tray-th' + (isLine(m.lib) ? ' line' : '') + '"' + (m.lib === 'pose' ? ' style="--tint:' + esc(m.x.tint || 'var(--tile)') + '"' : '') + '><img src="' + esc(m.src('w300')) + '" alt=""></span>';
}
- const poseHref = (p) => home + '#' + p.id + '-' + POSE_VIEWS[p.v];
- const costumeHref = (c, v) => costumePage + '#' + c.id + '-' + C_VIEWS[v];
-
- function slotHtml(kind) {
+ function slotHtml(m) {
+ const label = m.lib === 'pose' ? TC.slotPose : libName(m.lib);
+ const cur = page === m.lib ? ' cur' : '';
+ return '<a class="tray-slot' + cur + '" href="' + esc(m.href) + '" data-slot="' + m.lib + '" aria-label="' + esc(label + ' ' + m.x.id + ' ' + nameOf(m.x)) + '">' + thumb(m) +
+ '<span class="tray-st"><small>' + esc(label) + (cur ? '<span class="tray-pk"> · ' + esc(TC.picking) + '</span>' : '') + '</small><b class="mono">' + esc(m.x.id) + '</b></span></a>';
+ }
+ function emptySlot(kind) {
const isPose = kind === 'pose';
- const x = state[kind];
- const cur = page === kind ? ' cur' : '';
- const label = isPose ? TC.slotPose : TC.slotCostume;
- if (!x) {
- return '<a class="tray-slot empty' + cur + '" href="' + esc(isPose ? home + '#all' : costumePage) + '" data-slot="' + kind + '">' +
- '<span class="tray-plus" aria-hidden="true">+</span><span class="tray-st"><small>' + esc(label) + '</small><b>' + esc(isPose ? TC.pickPose : TC.pickCostume) + '</b></span></a>';
- }
- const v = isPose ? x.v : cView(x, state.pose ? state.pose.v : 0);
- const img = isPose ? poseImg('w300', x.file) : costumeImg('w300', x.files[v]);
- const name = (x.names && x.names[loc]) || x.id;
- return '<a class="tray-slot ' + kind + cur + '" href="' + esc(isPose ? poseHref(x) : costumeHref(x, v)) + '" data-slot="' + kind + '"' +
- (isPose ? ' style="--tint:' + esc(x.tint || 'var(--tile)') + '"' : '') + ' aria-label="' + esc(label + ' ' + x.id + ' ' + name) + '">' +
- '<span class="tray-th"><img src="' + esc(img) + '" alt=""></span><span class="tray-st"><small>' + esc(label) + (cur ? '<span class="tray-pk"> · ' + esc(TC.picking) + '</span>' : '') + '</small><b class="mono">' + esc(x.id) + '</b></span></a>';
+ return '<a class="tray-slot empty' + (page === kind ? ' cur' : '') + '" href="' + esc(isPose ? home + '#all' : libPage(kind)) + '" data-slot="' + kind + '">' +
+ '<span class="tray-plus" aria-hidden="true">+</span><span class="tray-st"><small>' + esc(isPose ? TC.slotPose : libName(kind)) + '</small><b>' + esc(isPose ? TC.pickPose : libName(kind)) + '</b></span></a>';
+ }
+ function cardHtml(m) {
+ const lab = m.lib === 'pose' ? TC.slotPose : libName(m.lib);
+ const views = m.lib === 'pose' ? POSE_VIEWS : LIBS.get(m.lib).views;
+ return '<div class="tp-card' + (m.lib === 'pose' ? ' pose' : '') + '"><a class="tp-img' + (isLine(m.lib) ? ' line' : '') + '" href="' + esc(m.href) + '" data-slot="' + m.lib + '"' +
+ (m.lib === 'pose' ? ' style="--tint:' + esc(m.x.tint || 'var(--tile)') + '"' : '') + '><img src="' + esc(m.src('w600')) + '" alt="' + esc(m.x.id + ' ' + nameOf(m.x)) + '" loading="lazy"></a>' +
+ '<span class="tp-meta"><small>' + esc(lab + ' · ' + TC.views[views[m.v]]) + '</small><b>' + esc(nameOf(m.x)) + '</b><span class="mono">' + esc(m.x.id) + '</span></span>' +
+ '<span class="tp-acts">' + (SHARE ? '' : '<a class="tp-ic" href="' + esc(m.src('w900')) + '" download="' + m.file + '" aria-label="' + esc(TC.dl + ' ' + m.x.id) + '">' + ICON_DL + '</a>') +
+ '<a class="tp-ic tp-change" href="' + esc(m.lib === 'pose' ? home + '#all' : libPage(m.lib)) + '">' + esc(TC.change) + '</a>' +
+ (m.lib === 'pose' ? '' : '<button type="button" class="tp-ic" data-tray="remove:' + m.lib + '" aria-label="' + esc(TC.remove(lab)) + '">' + ICON_X + '</button>') + '</span></div>';
}
function render() {
- const p = state.pose, c = state.costume;
- const on = !!(p || c);
+ const ms = members();
+ const p = state.pose, items = ms.filter((m) => m.lib !== 'pose');
+ const on = !!(p || items.length);
el.hidden = !on;
document.body.classList.toggle('has-tray', on);
- if (!on) { el.innerHTML = ''; open = false; return; }
- const P = pair();
- if (!P) open = false;
+ if (!on) { el.innerHTML = ''; open = adding = false; return; }
+ const ready = !!p && items.length > 0;
+ if (!ready) open = false;
+ const rest = ORDER.filter((k) => !state.items[k]);
const chev = '<svg class="tray-chev" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>';
- let panel = '';
- if (P && open) {
- const pv = TP.views[P.p.v];
- const pf = poseImg('w900', P.p.file), cf = costumeImg('w900', P.c.files[P.cv]);
- const pn = 'shisei_' + P.p.id + '_' + POSE_VIEWS[P.p.v] + '.webp', cn = 'shisei_' + P.c.id + '_' + C_VIEWS[P.cv] + '.webp';
- const acts = SHARE
- ? '<button type="button" class="pill dark tp-save" data-tray="save">' + esc(TC.saveGroup) + '</button>'
- : '<a class="pill light" href="' + esc(pf) + '" download="' + pn + '">' + esc(TC.dlPose) + '</a><a class="pill dark" href="' + esc(cf) + '" download="' + cn + '">' + esc(TC.dlCostume) + '</a>';
- panel = '<section class="tray-panel" id="trayPanel" aria-label="' + esc(TC.group) + '">' +
- '<div class="tp-h"><b>' + esc(TC.group) + '</b><span class="mono">' + esc(P.p.id + ' + ' + P.c.id) + '</span></div>' +
- '<div class="tp-imgs"><a class="tp-img pose" href="' + esc(poseHref(P.p)) + '" data-slot="pose" style="--tint:' + esc(P.p.tint || 'var(--tile)') + '"><img src="' + esc(poseImg('w600', P.p.file)) + '" alt="' + esc(P.p.id + ' ' + ((P.p.names && P.p.names[loc]) || '') + ' · ' + pv) + '"></a>' +
- '<a class="tp-img costume" href="' + esc(costumeHref(P.c, P.cv)) + '" data-slot="costume"><img src="' + esc(costumeImg('w600', P.c.files[P.cv])) + '" alt="' + esc(P.c.id + ' ' + ((P.c.names && P.c.names[loc]) || '') + ' · ' + TC.views[P.cv]) + '"></a></div>' +
- '<p class="tp-note">' + esc(TC.viewNote(pv + ' → ' + TC.views[P.cv])) + '</p>' +
- '<div class="tp-prompt"><div class="tp-ph"><span>' + esc(TC.prompt) + '</span><button type="button" class="pill light tiny" data-tray="copy">' + esc(TP.copy) + '</button></div><p class="mono">' + esc(P.prompt) + '</p></div>' +
- '<div class="tp-acts">' + acts + '</div><p class="tp-tip" id="trayTip" role="status" hidden></p></section>';
- if (SHARE) [[pf, pn], [cf, cn]].forEach(([u, n]) => prefetch(u, n));
+ let html = '';
+ if (open) {
+ html += '<section class="tray-panel" id="trayPanel" aria-label="' + esc(TC.group(ms.length)) + '">' +
+ '<div class="tp-h"><b>' + esc(TC.group(ms.length)) + '</b><span class="mono">' + esc(ms.map((m) => m.x.id).join(' + ')) + '</span></div>' +
+ '<div class="tp-cards">' + ms.map(cardHtml).join('') + '</div>' +
+ (rest.length ? '<div class="tp-more"><span>' + esc(TC.add) + '</span>' + rest.map((k) => '<a href="' + esc(libPage(k)) + '">+ ' + esc(libName(k)) + '</a>').join('') + '</div>' : '') +
+ '<div class="tp-prompt"><div class="tp-ph"><span>' + esc(TC.prompt) + '</span><button type="button" class="pill light tiny" data-tray="copy">' + esc(T.copy) + '</button></div><p class="mono">' + esc(prompt()) + '</p></div>' +
+ (SHARE ? '<button type="button" class="pill dark tp-save" data-tray="save">' + esc(TC.saveGroup(ms.length)) + '</button>' : '') +
+ '<p class="tp-tip" id="trayTip" role="status" hidden></p></section>';
+ if (SHARE) ms.forEach((m) => prefetch(m.src('w900'), m.file));
+ }
+ if (adding && rest.length) {
+ html += '<div class="tray-add" id="trayAdd"><span class="tray-add-h">' + esc(p ? TC.addFor(p.id) : TC.add) + '</span>' +
+ rest.map((k) => { const L = LIBS.get(k); return '<a href="' + esc(libPage(k)) + '"><span class="tray-th' + (L.kind === 'line' ? ' line' : '') + '">' + (L.thumb ? '<img src="' + esc(libImg(k, 'w300', L.thumb)) + '" alt="">' : '') + '</span><span class="tray-add-n">' + esc(libName(k)) + '</span><span class="mono">' + L.n + '</span></a>'; }).join('') + '</div>';
}
- el.innerHTML = panel + '<div class="tray-bar"><span class="tray-l">' + esc(TC.tray) + '</span>' + slotHtml('pose') + chev + slotHtml('costume') +
- '<span class="tray-soon" title="' + esc(TC.soon) + '"><span aria-hidden="true">+</span><span class="sr">' + esc(TC.soon) + '</span></span>' +
- (P ? '<button type="button" class="tray-done" data-tray="toggle" aria-expanded="' + open + '" aria-controls="trayPanel">' + esc(open ? TC.hide : TC.done) + '</button>' : '') +
- '<button type="button" class="tray-x" data-tray="end" aria-label="' + esc(TC.end) + '"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div>';
+ // The current library gets an empty slot to fill even before anything is picked from it.
+ const here = page !== 'pose' && !state.items[page] ? emptySlot(page) : '';
+ const curItem = items.find((m) => m.lib === page);
+ const stack = items.slice(0, 3).map((m) => '<span class="tray-th' + (isLine(m.lib) ? ' line' : '') + '"><img src="' + esc(m.src('w300')) + '" alt=""></span>').join('');
+ html += '<div class="tray-bar' + (items.length ? '' : ' solo') + '"><span class="tray-l">' + esc(TC.tray) + '</span>' + (p ? slotHtml(ms[0]) : emptySlot('pose')) + chev +
+ '<span class="tray-items">' + items.map(slotHtml).join('') + here + '</span>' +
+ // Phones: the picked items fold into one slot of stacked thumbnails that opens the set.
+ (items.length ? '<button type="button" class="tray-stack' + (curItem ? ' cur' : '') + '" data-tray="' + (ready ? 'toggle' : 'add') + '" aria-label="' + esc(items.map((m) => libName(m.lib) + ' ' + m.x.id).join(', ')) + '"><span class="tray-stack-th">' + stack + '</span><span class="tray-st"><small>' + esc(curItem ? libName(curItem.lib) : TC.tray) + '</small><b class="mono">' + (curItem ? esc(curItem.x.id) : '+' + items.length) + '</b></span></button>' : '<span class="tray-here">' + here + '</span>') +
+ (rest.length ? '<button type="button" class="tray-soon" data-tray="add" aria-expanded="' + adding + '" aria-controls="trayAdd" aria-label="' + esc(TC.add) + '">+</button>' : '') +
+ (ready ? '<button type="button" class="tray-done" data-tray="toggle" aria-expanded="' + open + '" aria-controls="trayPanel">' + esc(open ? TC.hide : TC.done + ' · ' + ms.length) + '</button>' : '') +
+ '<button type="button" class="tray-x" data-tray="end" aria-label="' + esc(TC.end) + '">' + ICON_X + '</button></div>';
+ el.innerHTML = html;
}
- // share() must run inside the tap, so both files are fetched as soon as the panel shows them.
+ // share() must run inside the tap, so the files are fetched as soon as the panel shows them.
function prefetch(url, name) {
if (files.has(url)) return;
const entry = { file: null };
@@ -113,49 +159,55 @@
}
function tip(msg) {
const t = document.getElementById('trayTip');
- if (!t) return;
- t.textContent = msg;
- t.hidden = false;
+ if (t) { t.textContent = msg; t.hidden = false; }
}
+ function save() { store.set(state); render(); changed(); }
el.addEventListener('click', (e) => {
- const b = e.target.closest('[data-tray]');
const slot = e.target.closest('[data-slot]');
if (slot && api.onSlot && api.onSlot(slot.dataset.slot, state) === true) { e.preventDefault(); return; }
+ const b = e.target.closest('[data-tray]');
if (!b) return;
- const a = b.dataset.tray;
- if (a === 'toggle') { open = !open; render(); if (open) el.querySelector('.tray-panel').scrollTop = 0; }
- else if (a === 'end') { state = {}; store.set(state); open = false; render(); changed(); }
- else if (a === 'copy') { const P = pair(); if (P) window.ShiseiShare.copy(P.prompt); }
+ const [a, arg] = b.dataset.tray.split(':');
+ if (a === 'toggle') { open = !open; adding = false; render(); }
+ else if (a === 'add') { adding = !adding; open = false; render(); }
+ else if (a === 'remove') { delete state.items[arg]; save(); }
+ else if (a === 'end') { state = { items: {} }; open = adding = false; save(); }
+ else if (a === 'copy') window.ShiseiShare.copy(prompt());
else if (a === 'save') {
- const P = pair();
- const got = [poseImg('w900', P.p.file), costumeImg('w900', P.c.files[P.cv])].map((u) => files.get(u));
+ const got = members().map((m) => files.get(m.src('w900')));
if (got.every((x) => x && x.file)) navigator.share({ files: got.map((x) => x.file) }).catch((err) => { if (err.name !== 'AbortError') tip(TC.holdGroup); });
- else tip((window.I18N[loc] || {}).preparing || TC.holdGroup);
+ else tip(T.preparing || TC.holdGroup);
}
});
- // Escape folds the panel first.
+ // Escape folds the panel or the add list; a click outside the tray folds the add list.
document.addEventListener('keydown', (e) => {
- if (e.key === 'Escape' && open && !document.querySelector('dialog[open]')) { open = false; render(); el.querySelector('.tray-done').focus(); }
+ if (e.key !== 'Escape' || document.querySelector('dialog[open]') || !(open || adding)) return;
+ open = adding = false;
+ render();
});
- // Another tab changed the pair.
+ document.addEventListener('click', (e) => { if (adding && !e.target.closest('#tray')) { adding = false; render(); } });
window.addEventListener('storage', (e) => { if (e.key === KEY) { state = store.get(); render(); changed(); } });
function changed() { window.dispatchEvent(new CustomEvent('shisei:combo', { detail: state })); }
const api = {
get: () => state,
- // Called by the gallery with a pose, by the costume page with a costume; the panel opens once both are there.
+ pose: () => state.pose || null,
+ count: () => picked().length,
+ // The gallery sets the pose, a library page an item; the panel opens once there is a pose and an item.
set(kind, value) {
- state = Object.assign({}, state, { [kind]: value });
- store.set(state);
- open = !!pair();
- render();
- changed();
+ if (kind === 'pose') state.pose = value; else state.items[kind] = value;
+ open = !!state.pose && picked().length > 0;
+ adding = false;
+ save();
},
+ // After setting a pose with nothing picked yet: show where to go next.
+ // Deferred: the tap that called this would otherwise reach the outside-click handler and fold it again.
+ showAdd() { setTimeout(() => { adding = true; open = false; render(); }, 0); },
setPage(k) { page = k; render(); },
- names: (o, key) => Object.fromEntries(Object.entries(NAME).map(([l, s]) => [l, o[key === 'pose' ? 'name_' + s : 'name_' + l]])),
- onSlot: null,
- views: C_VIEWS
+ viewFor,
+ names: (o) => Object.fromEntries(Object.entries(NAME).map(([l, s]) => [l, o['name_' + s]])),
+ onSlot: null
};
window.ShiseiTray = api;
render();