feat: 完善文字画视觉并新增 PDF 导出
- 调整飞鸟、楼群与标题配色和布局 - 新增 uv + Playwright PDF 导出脚本,四边各留 1em - 页面标题改为「封面」
This commit is contained in:
1 parent
17a224be27
commit
6085fc24d3
8 files changed
+343
-19
No files matched your search
@@ -56,7 +56,7 @@ body {
|
||||
|
||||
.title-panel .title {
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
color: #e6e6e6;
|
||||
font-size: 1.6em;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
@@ -64,6 +64,8 @@ body {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.title-panel .title-em { color: #fff; }
|
||||
|
||||
/* —— 背景:空白格里的淡色「天」 —— */
|
||||
.sky { color: rgba(190, 200, 240, 0.15); }
|
||||
|
||||
@@ -75,8 +77,8 @@ body {
|
||||
.cloud-rose { --cloud: #ff85b3; }
|
||||
.cloud-lilac { --cloud: #c98cff; }
|
||||
|
||||
/* —— 落日:太阳逐行色调,t1 顶部偏红 → t17 底部偏黄;整体明度为原色的 90% —— */
|
||||
.sun { color: color-mix(in srgb, var(--tone, #ff5a36) 90%, #000); }
|
||||
/* —— 落日:太阳逐行色调,t1 顶部偏红 → t17 底部偏黄 —— */
|
||||
.sun { color: color-mix(in srgb, var(--tone, #ff5a36) 80%, #000); }
|
||||
.sun-t1 { --tone: #ff5a36; }
|
||||
.sun-t2 { --tone: #ff5a36; }
|
||||
.sun-t3 { --tone: #ff6533; }
|
||||
@@ -96,12 +98,13 @@ body {
|
||||
.sun-t17 { --tone: #ffec66; }
|
||||
|
||||
/* —— 飞鸟 —— */
|
||||
.bird-sparrow { color: #e0a45c; }
|
||||
.bird-gull { color: #a0c8f0; }
|
||||
.bird-crow { color: #b0a8c8; }
|
||||
.bird-sparrow { color: #c96b45; }
|
||||
.bird-magpie { color: #7893bd; }
|
||||
.bird-crow { color: #9f98bb; }
|
||||
|
||||
/* —— 天线 —— */
|
||||
.ant { color: #8a8a9e; }
|
||||
.ant-dark { color: #5d5d6b; }
|
||||
|
||||
/* —— 楼群:灰色系,明度与原棕色一致 —— */
|
||||
.bld { color: #3f3f3f; }
|
||||
|
||||
+20
-9
@@ -39,22 +39,23 @@
|
||||
|
||||
/* 飞鸟:数量减少,间距不等,仅少量成对;上下拉开分布 */
|
||||
const birds = [
|
||||
{ x: 0, y: 2, kind: 'gull' },
|
||||
{ x: 26, y: 2, kind: 'gull' },
|
||||
{ x: 0, y: 2, kind: 'magpie' },
|
||||
{ x: 26, y: 2, kind: 'magpie' },
|
||||
{ x: 1, y: 4, kind: 'sparrow' },
|
||||
{ x: 3, y: 8, kind: 'crow' },
|
||||
{ x: 6, y: 13, kind: 'gull' },
|
||||
{ x: 6, y: 13, kind: 'magpie' },
|
||||
{ x: 9, y: 15, kind: 'sparrow' },
|
||||
{ x: 26, y: 5, kind: 'crow' },
|
||||
{ x: 17, y: 9, kind: 'sparrow' },
|
||||
{ x: 21, y: 12, kind: 'gull' },
|
||||
{ x: 21, y: 12, kind: 'magpie' },
|
||||
{ x: 19, y: 15, kind: 'crow' },
|
||||
];
|
||||
|
||||
/* 天线:单列「线」,从 y 向下叠 h 格;楼顶在第 31 行,露出部分为 3 / 4 格 */
|
||||
/* 天线:单列「线」,从 y 向下叠 h 格;最右楼顶另加一根深色 */
|
||||
const antennas = [
|
||||
{ x: 7, y: 28, h: 3 },
|
||||
{ x: 22, y: 27, h: 4 },
|
||||
{ x: 26, y: 34, h: 3, cls: 'ant ant-dark' },
|
||||
];
|
||||
|
||||
/* 楼群:n 对应 .bld-n,最终按 x/y/w/h 铺满「楼」(高度裁到第 44 行) */
|
||||
@@ -72,12 +73,13 @@
|
||||
/* 标题区:整格扣出的居中矩形,左右各留 3 格 */
|
||||
const TITLE = {
|
||||
text: '关于「甲子」的虚构故事',
|
||||
emphasis: '甲子',
|
||||
top: 14,
|
||||
height: 5,
|
||||
side: 3,
|
||||
};
|
||||
|
||||
const BIRD_WORDS = { sparrow: '麻雀', gull: '海鸥', crow: '乌鸦' };
|
||||
const BIRD_WORDS = { sparrow: '麻雀', magpie: '喜鹊', crow: '乌鸦' };
|
||||
|
||||
const grid = Array.from({ length: ROWS }, () =>
|
||||
Array.from({ length: COLS }, () => ({ ch: '天', cls: 'sky' }))
|
||||
@@ -112,8 +114,8 @@
|
||||
put(x + 1, y, b, `bird-${kind}`);
|
||||
}
|
||||
|
||||
for (const { x, y, h } of antennas) {
|
||||
for (let i = 0; i < h; i++) put(x, y + i, '线', 'ant');
|
||||
for (const { x, y, h, cls = 'ant' } of antennas) {
|
||||
for (let i = 0; i < h; i++) put(x, y + i, '线', cls);
|
||||
}
|
||||
|
||||
for (const { n, x, y, w, h } of buildings) {
|
||||
@@ -153,7 +155,16 @@
|
||||
|
||||
const title = document.createElement('h1');
|
||||
title.className = 'title';
|
||||
title.textContent = TITLE.text;
|
||||
|
||||
const [before, after] = TITLE.text.split(TITLE.emphasis);
|
||||
if (after === undefined) {
|
||||
title.textContent = TITLE.text;
|
||||
} else {
|
||||
const em = document.createElement('span');
|
||||
em.className = 'title-em';
|
||||
em.textContent = TITLE.emphasis;
|
||||
title.append(before, em, after);
|
||||
}
|
||||
|
||||
panel.append(title);
|
||||
scene.append(panel);
|
||||
|
||||
Reference in new issue
Block a user