Compare commits
4
Commits
6406858015
...
febe61b5be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
febe61b5be | ||
|
|
a8d6ee439b | ||
|
|
3df00d0def | ||
|
|
1b6872424a |
No files matched your search
@@ -26,19 +26,20 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 演职员表 nametag:5 × 2 格,格内居中 */
|
/* 演职员表大区块:4 × 9 姓名网格,背景 alpha 0.5 */
|
||||||
.nametag {
|
.nametag-block {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
display: flex;
|
display: grid;
|
||||||
align-items: center;
|
background: rgba(10, 8, 6, 0.5);
|
||||||
justify-content: center;
|
|
||||||
width: 5em;
|
|
||||||
height: 2em;
|
|
||||||
background: rgba(10, 8, 6, 0.4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nametag-name {
|
.nametag-name {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
color: #e6dac6;
|
color: #e6dac6;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|||||||
+23
-13
@@ -123,7 +123,7 @@
|
|||||||
credits.textContent = '演职员表';
|
credits.textContent = '演职员表';
|
||||||
scene.append(credits);
|
scene.append(credits);
|
||||||
|
|
||||||
/* 35 个 nametag:4 列 × 9 行,右下角缺一个 */
|
/* 35 个姓名:4 列 × 9 行,放在一个半透明大区块上 */
|
||||||
const NAMES = [
|
const NAMES = [
|
||||||
'郑滕飞', '秦雪莹', '关宸宇', '王天晓', '谢雨舟', '储明威', '庞熙若',
|
'郑滕飞', '秦雪莹', '关宸宇', '王天晓', '谢雨舟', '储明威', '庞熙若',
|
||||||
'刘婉莹', '陈彦淇', '古雅文', '周胤伯', '郑佳欣', '娄敬庭', '张加弛',
|
'刘婉莹', '陈彦淇', '古雅文', '周胤伯', '郑佳欣', '娄敬庭', '张加弛',
|
||||||
@@ -135,14 +135,31 @@
|
|||||||
const TAG = {
|
const TAG = {
|
||||||
cols: 4,
|
cols: 4,
|
||||||
rows: 9,
|
rows: 9,
|
||||||
width: 5,
|
width: 3,
|
||||||
height: 2,
|
height: 1,
|
||||||
gapX: 1,
|
gapX: 1,
|
||||||
gapY: 1,
|
gapY: 1,
|
||||||
left: 2,
|
padding: 1,
|
||||||
top: 12,
|
top: 12,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const blockWidth =
|
||||||
|
TAG.padding * 2 + TAG.cols * TAG.width + (TAG.cols - 1) * TAG.gapX;
|
||||||
|
const blockHeight =
|
||||||
|
TAG.padding * 2 + TAG.rows * TAG.height + (TAG.rows - 1) * TAG.gapY;
|
||||||
|
|
||||||
|
const block = document.createElement('div');
|
||||||
|
block.className = 'nametag-block';
|
||||||
|
block.style.top = `${TAG.top}em`;
|
||||||
|
block.style.width = `${blockWidth}em`;
|
||||||
|
block.style.height = `${blockHeight}em`;
|
||||||
|
block.style.padding = `${TAG.padding}em`;
|
||||||
|
block.style.gridTemplateColumns = `repeat(${TAG.cols}, ${TAG.width}em)`;
|
||||||
|
block.style.gridAutoRows = `${TAG.height}em`;
|
||||||
|
block.style.columnGap = `${TAG.gapX}em`;
|
||||||
|
block.style.rowGap = `${TAG.gapY}em`;
|
||||||
|
scene.append(block);
|
||||||
|
|
||||||
let nameIndex = 0;
|
let nameIndex = 0;
|
||||||
for (let row = 0; row < TAG.rows; row++) {
|
for (let row = 0; row < TAG.rows; row++) {
|
||||||
for (let col = 0; col < TAG.cols; col++) {
|
for (let col = 0; col < TAG.cols; col++) {
|
||||||
@@ -151,17 +168,10 @@
|
|||||||
const name = NAMES[nameIndex++];
|
const name = NAMES[nameIndex++];
|
||||||
if (!name) break;
|
if (!name) break;
|
||||||
|
|
||||||
const tag = document.createElement('div');
|
const label = document.createElement('div');
|
||||||
tag.className = 'nametag';
|
|
||||||
tag.style.left = `${TAG.left + col * (TAG.width + TAG.gapX)}em`;
|
|
||||||
tag.style.top = `${TAG.top + row * (TAG.height + TAG.gapY)}em`;
|
|
||||||
|
|
||||||
const label = document.createElement('span');
|
|
||||||
label.className = 'nametag-name';
|
label.className = 'nametag-name';
|
||||||
label.textContent = name;
|
label.textContent = name;
|
||||||
|
block.append(label);
|
||||||
tag.append(label);
|
|
||||||
scene.append(tag);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
@@ -33,3 +33,4 @@
|
|||||||
应玥
|
应玥
|
||||||
湛茜茜
|
湛茜茜
|
||||||
黄钰涵
|
黄钰涵
|
||||||
|
虞韫嘉
|
||||||
Reference in new issue
Block a user