-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
119 lines (102 loc) · 3.54 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!doctype html>
<html lang="en">
<head>
<title>html转图片</title>
<link rel="icon" href="static/img/favicon.ico" type="images/x-ico"/>
<!-- 引入 jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<style>
/*定义自定义字体 */
@font-face {
font-family: "Flash";
src: url(./GEETYPE-BailongGBT-Flash.ttf)
/* 添加其他字体格式,如 ttf、eot,根据实际情况选择 */
}
/* 设置背景颜色和文字样式 */
body {
background-color: #ffffff;
color: #000000;
margin: 0;
padding: 0;
}
#box {
background-color: rgba(0, 0, 0, 0);
/* r, g, b 分别表示红、绿、蓝通道的值,0 表示完全透明 */
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 1000px;
height: 800px;
font-family: Flash;
/*color: #000000;*/
font-size: 170px;
-webkit-text-fill-color: orangered;
/*文字的填充色*/
-webkit-text-stroke: 1px #ffffff;
/*描边的像素,也就是粗细,这里指定是2像素的黑色边框*/
text-rendering: optimizeLegibility;
/*font-style: italic;*/
display: flex;
justify-content: space-evenly;
align-content: space-around;
flex-direction: column;
/* padding: 15px; */
}
.grid-container {
display: grid;
grid-template-columns: repeat(4, 1fr);
/* 定义4列,每列占据平均宽度 */
grid-template-rows: repeat(3, 1fr);
/* 定义3行,每行占据平均高度 */
width: 1000px;
height: 800px;
}
.grid-item {
width: 100%;
height: 100%;
}
.red {
background-color: black;
border-radius: 0%;
}
.white {
background-color: black;
border-radius: 0%;
}
</style>
</head>
<body>
<div class="grid-container" id="myGrid">
<!-- 网格单元格将通过 JavaScript 动态生成 -->
</div>
<div id="box">
<div style="text-align: center;margin:0 auto;width: 93%;display: flex;align-items: center;justify-content: space-evenly;">
<span>刑</span><span>天</span><span>舞</span><span>干</span><span>戚</span>
</div>
<div style="text-align: center;margin:0 auto;width: 93%;display: flex;align-items: center;justify-content: space-evenly;">
<span>猛</span><span>志</span><span>固</span><span>常</span><span>在</span>
</div>
</div>
<script>
function generateGrid() {
var gridContainer = document.getElementById("myGrid");
for (var i = 0; i < 12; i++) {
var gridItem = document.createElement("div");
gridItem.classList.add("grid-item");
if ((Math.floor(i / 4) % 2 === 0 && i % 2 === 0) || (Math.floor(i / 4) % 2 === 1 && i % 2 === 1)) {
gridItem.classList.add("red");
} else {
gridItem.classList.add("white");
}
gridContainer.appendChild(gridItem);
}
}
generateGrid();
</script>
</body>
</html>