-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·60 lines (45 loc) · 1.46 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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<title>helloworld</title>
<link href="./common/files/css/style.css" rel="stylesheet">
</head>
<body>
<div id="all"></div>
<script src="common/files/js/data.js"></script>
<script>
function init() {
let dataHtml = '<article class="data-article"><div class="wrap"><h1 class="title">2D Canvas Sandbox</h1></div>';
let parseData = {};
for (const file of DATA.files) {
const category = file.category;
if (!parseData.hasOwnProperty(category)) parseData[category] = { html:'' };
let html = '';
html += '<li><a href="./' + file.directory + '/"><figure>';
html += '<span><img src="./' + file.directory + '/thumnail.png"></span>';
html += '<figcaption>' + file.name + '</figcaption>';
html += '</figure></a></li>';
parseData[category].html += html;
}
for (key in parseData) {
let listHtml = parseData[key].html;
let html = '<section class="category-section"><div class="wrap">';
html += '<h2 class="name">' + key + '</h2>';
html += '<ul class="list">';
html += listHtml;
html += '</ul>';
html += '</div></section>';
dataHtml += html;
}
// console.log(parseData)
document.getElementById('all').innerHTML = dataHtml + '</article>';
}
init();
// document.getElementById('all').innerHTML = html;
</script>
</body>
</html>