feat(h5): align third feedback with latest PSD and scanning screen
This commit is contained in:
@@ -19,18 +19,18 @@ ASSETS = ROOT / "h5/assets/img/ui-20261009"
|
||||
ASSET_SPECS = [
|
||||
("bg-splash.jpg", "0/0", "0"),
|
||||
("bg-profile.jpg", "3/0/0", "3"),
|
||||
("bg-login.jpg", "9/0/0", "9"),
|
||||
("bg-login.jpg", "login/0/0", "login"),
|
||||
("bg-report.jpg", "8/0", "8"),
|
||||
("bg-history.jpg", "2/0", "2"),
|
||||
("brand-logo.png", "0/1/0", None),
|
||||
("brand-login.png", "9/7/1", None),
|
||||
("brand-login.png", "login/7/1", None),
|
||||
("icon-close.png", "1/6", None),
|
||||
("icon-dropdown.png", "3/1/2", None),
|
||||
("icon-back.png", "3/6/0", None),
|
||||
("icon-album.png", "5/1/1", None),
|
||||
("icon-switch-camera.png", "5/1/0", None),
|
||||
("icon-wechat.png", "9/7/6", None),
|
||||
("icon-guest.png", "9/7/7", None),
|
||||
("icon-wechat.png", "login/7/6", None),
|
||||
("icon-guest.png", "login/7/7", None),
|
||||
("icon-shutter.png", "5/1/2", None),
|
||||
("skin-0-dry.png", "3/3/1/0/2", None),
|
||||
("skin-1-mixeddry.png", "3/3/1/1/2", None),
|
||||
@@ -59,7 +59,13 @@ ASSET_SPECS = [
|
||||
def layer_at(psd, indices):
|
||||
layer = psd
|
||||
for part in indices.split("/"):
|
||||
layer = layer[int(part)]
|
||||
if part == "login":
|
||||
matches = [page for page in psd if page.name == "登录"]
|
||||
if len(matches) != 1:
|
||||
raise ValueError("Expected exactly one 登录 page; refusing incorrect asset mapping")
|
||||
layer = matches[0]
|
||||
else:
|
||||
layer = layer[int(part)]
|
||||
return layer
|
||||
|
||||
|
||||
@@ -111,7 +117,7 @@ def main():
|
||||
print(f"Page {index}: {page.name}", flush=True)
|
||||
# Cached layer pixels preserve Photoshop text appearance without local fonts.
|
||||
target = DESIGN / "pages" / f"{index + 1:02d}-{page.name}.png"
|
||||
if args.assets_only:
|
||||
if args.assets_only and target.exists():
|
||||
image = Image.open(target)
|
||||
else:
|
||||
image = page.composite(viewport=page.bbox)
|
||||
@@ -160,7 +166,7 @@ def main():
|
||||
thumb.thumbnail((180, 190))
|
||||
thumbs.append((filename, thumb))
|
||||
|
||||
sheet = Image.new("RGB", (5 * 236, 2 * 1620), "#eeeeee")
|
||||
sheet = Image.new("RGB", (5 * 236, ((len(previews)+4)//5) * 1620), "#eeeeee")
|
||||
draw = ImageDraw.Draw(sheet)
|
||||
for i, (_, preview) in enumerate(previews):
|
||||
x, y = (i % 5) * 236 + 10, (i // 5) * 1620 + 35
|
||||
|
||||
Reference in New Issue
Block a user