-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
71 lines (71 loc) · 1.77 KB
/
index.html
File metadata and controls
71 lines (71 loc) · 1.77 KB
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
<html><head></head><body>
<div class="top-bar">
<h1>
Micro:Code Bugs
</h1>
<p>If you find any bugs, please report them here.</p>
</div>
<div class="main">
<ol>
</ol>
</div>
<script src="data.js"></script>
<script>
console.log(threads);
var container = document.querySelector('ol');
for (let thread of threads) {
var html = `
<li class="row">
<a href="thread.html?${thread.id}">
<h4 class="title">
${thread.title}
</h4>
<div class="bottom">
<p class="timestamp">
${new Date(thread.date).toLocaleString()}
</p>
<p class="comment-count">
${thread.comments.length} comments
</p>
</div>
</a>
</li>
`
container.insertAdjacentHTML('beforeend', html);
}
</script>
<style>
body {
margin: 10px 60px;
}
a {
text-decoration: none;
color: black;
}
h1, h4, ol {
margin: 0;
}
p {
margin: 5px 0;
}
.top-bar {
background-color: skyblue;
padding: 0 40px;
}
.main {
background-color: #F6F6EF;
padding: 10px 15px;
}
.row {
padding: 5px 0;
}
.bottom {
display: flex;
color: grey;
font-size: 12px;
}
.timestamp {
padding-right: 10px;
}
</style>
</body></html>