feat: 收紧姓名间距并缩小大区块
This commit is contained in:
1 parent
1b6872424a
commit
3df00d0def
1 file changed
+8
-4
+8
-4
@@ -135,16 +135,19 @@
|
|||||||
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,
|
||||||
|
padding: 1,
|
||||||
left: 2,
|
left: 2,
|
||||||
top: 12,
|
top: 12,
|
||||||
};
|
};
|
||||||
|
|
||||||
const blockWidth = TAG.cols * TAG.width + (TAG.cols - 1) * TAG.gapX;
|
const blockWidth =
|
||||||
const blockHeight = TAG.rows * TAG.height + (TAG.rows - 1) * TAG.gapY;
|
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');
|
const block = document.createElement('div');
|
||||||
block.className = 'nametag-block';
|
block.className = 'nametag-block';
|
||||||
@@ -152,6 +155,7 @@
|
|||||||
block.style.top = `${TAG.top}em`;
|
block.style.top = `${TAG.top}em`;
|
||||||
block.style.width = `${blockWidth}em`;
|
block.style.width = `${blockWidth}em`;
|
||||||
block.style.height = `${blockHeight}em`;
|
block.style.height = `${blockHeight}em`;
|
||||||
|
block.style.padding = `${TAG.padding}em`;
|
||||||
block.style.gridTemplateColumns = `repeat(${TAG.cols}, ${TAG.width}em)`;
|
block.style.gridTemplateColumns = `repeat(${TAG.cols}, ${TAG.width}em)`;
|
||||||
block.style.gridAutoRows = `${TAG.height}em`;
|
block.style.gridAutoRows = `${TAG.height}em`;
|
||||||
block.style.columnGap = `${TAG.gapX}em`;
|
block.style.columnGap = `${TAG.gapX}em`;
|
||||||
|
|||||||
Reference in new issue
Block a user