-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.html
347 lines (301 loc) · 7.64 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>index</title>
<style>
body {
margin: 0;
padding: 0;
}
.container {
position: relative;
height: 100vh;
width: calc(100vw - 40px);
}
h3 {
text-align: center;
}
hr {
margin-left: 20px;
}
ul {
display: flex;
flex-wrap: wrap;
}
ul li {
display: flex;
position: relative;
flex-wrap: wrap;
list-style: none;
margin: 15px;
padding: 20px 15px 40px 15px;
box-shadow: 0 0 12px 0 rgba(0, 0, 0, .2);
}
ul li a {
position: absolute;
bottom: 0px;
height: 40px;
line-height: 40px;
display: inline-block;
width: calc(100% - 40px);
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
ul li a:hover {
text-decoration: underline;
}
/* 对navbar pagination searchbox input等 width足够的进行重新布局 */
/* CSS Start*/
.navbar ul li,
.pagination ul li,
.searchbox ul li,
.input ul li {
width: calc(33% - 80px);
}
@media screen and (max-width: 1600px) {
.navbar ul li {
width: calc(50% - 80px);
}
.pagination ul li {
width: calc(50% - 80px);
}
.searchbox ul li {
width: calc(50% - 80px);
}
.input ul li {
width: calc(50% - 80px);
}
}
@media screen and (max-width: 1200px) {
.navbar ul li {
width: 100%;
}
.pagination ul li {
width: 100%;
}
.searchbox ul li {
width: 100%;
}
.input ul li {
width: 100%;
}
}
.navbar ul li iframe,
.pagination ul li iframe,
.searchbox ul li iframe,
.input ul li iframe {
width: 100%;
}
/* CSS End*/
.list ul li {
height: 400px;
}
</style>
</head>
<body>
<div class="container">
<!-- Button -->
<div class="button">
<h3>Button</h3>
<ul>
<!-- button type list -->
</ul>
</div>
<hr>
<!-- Loading -->
<div class="loading">
<h3>Loading</h3>
<ul>
<!-- loading type list -->
</ul>
</div>
<hr>
<!-- Switch -->
<div class="switch">
<h3>Switch</h3>
<ul>
<!-- switch type list -->
</ul>
</div>
<hr>
<!-- Progress -->
<div class="progress">
<h3>Progress</h3>
<ul>
<!-- progress type list -->
</ul>
</div>
<hr>
<!-- Checkbox -->
<div class="checkbox">
<h3>Checkbox</h3>
<ul>
<!-- checkbox type list -->
</ul>
</div>
<hr>
<!-- Icon -->
<div class="icon">
<h3>Icon</h3>
<ul>
<!-- icon area list -->
</ul>
</div>
<hr>
<!-- Navbar -->
<div class="navbar">
<h3>NavBar</h3>
<ul>
<!-- navbar type list -->
</ul>
</div>
<hr>
<!-- Pagination -->
<div class="pagination">
<h3>Pagination</h3>
<ul>
<!-- pagination type list -->
</ul>
</div>
<hr>
<!-- SearchBox -->
<div class="searchbox">
<h3>SearchBox</h3>
<ul>
<!-- searchbox type list -->
</ul>
</div>
<hr>
<!-- Input -->
<div class="input">
<h3>Input</h3>
<ul>
<!-- input type list -->
</ul>
</div>
<hr>
<!-- List -->
<div class="list">
<h3>List</h3>
<ul>
<!-- list type list -->
</ul>
</div>
<hr>
<!-- Unclassified -->
<div class="unclassified">
<h3>Unclassified</h3>
<ul>
<!-- unclassified type list -->
</ul>
</div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
/**
* @description
* @params {string} type 指属于哪种文件分类
* @params {number} length 文件数量
* @returns
*/
function addFrames(type, length) {
// 单独处理 icon
if (type == 'icon' || type == 'unclassified') {
let fileArr = [] // 声明fileArr
// 使用数组存放所有的文件名 icon
if (type == 'icon') {
fileArr = ['arrow', 'bluetooth', 'change', 'change02', 'cloud', 'code', 'download',
'link', 'loading', 'moon-dark', 'moon-light', 'power',
'question-mark', 'scan', 'scan02', 'search', 'star-five',
'star-six', 'upload', 'wifi', 'exit']
// unclassified
} else if (type == 'unclassified') {
fileArr = ['cube', 'letterA-D', 'letterE-H', 'letterI-L',
'letterM-P', 'letterQ-T', 'letterU-X', 'letterY-Z', 'concentric-circles', 'taiji']
}
for (let i = 0; i < fileArr.length; i++) {
let tagArea = $('.' + type + ' ul') // 标签域
let listArea // 模板字符串
let iframeSrc = '', hrefLink = ''
// 本地环境
if (location.hostname == '127.0.0.1') {
iframeSrc = `./${type}/`
hrefLink = `./${type}/`
// github page
} else if (location.hostname == 'ajycc20.github.io') {
iframeSrc = `https://ajycc20.github.io/easy-css-layout/${type}/`
hrefLink = `https://github.com/ajycc20/easy-css-layout/blob/master/${type}/`
}
listArea = `
<li>
<iframe src="${iframeSrc + fileArr[i]}.html" frameborder="0"></iframe>
<a href="${hrefLink + fileArr[i]}.html" target="_blank">
<span>${fileArr[i]}</span>
</a>
</li>`
tagArea.append(listArea)
}
} else {
for (let i = 1; i <= length; i++) {
let tagArea = $('.' + type + ' ul') // 标签域
let numStr = '' // add 0
if (i < 10) {
numStr = '0' + i
} else {
numStr = '' + i
}
let listArea // 模板字符串
let iframeSrc = '', hrefLink = ''
// 本地环境
if (location.hostname == '127.0.0.1') {
iframeSrc = './'
hrefLink = './'
// github page
} else if (location.hostname == 'ajycc20.github.io') {
iframeSrc = 'https://ajycc20.github.io/easy-css-layout/'
hrefLink = 'https://github.com/ajycc20/easy-css-layout/blob/master/'
}
listArea = `
<li>
<iframe src="${iframeSrc + type}/${type + numStr}.html" frameborder="0"></iframe>
<a href="${hrefLink + type}/${type + numStr}.html" target="_blank">
<span>${type} ${numStr}</span>
</a>
</li>`
tagArea.append(listArea)
}
}
}
// button type
addFrames('button', 14)
// loading type
addFrames('loading', 21)
// switch type
addFrames('switch', 5)
// progress type
addFrames('progress', 3)
// checkbox type
addFrames('checkbox', 3)
// icon type
addFrames('icon', 20)
// navbar type
addFrames('navbar', 3)
// pagination type
addFrames('pagination', 4)
// searchbox type
addFrames('searchbox', 3)
// input type
addFrames('input', 1)
// list type
addFrames('list', 3)
// unclassified type
addFrames('unclassified', 10)
})
</script>
</body>
</html>