forked from Abhay-N-J/NotO
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathi.html
80 lines (79 loc) · 1.99 KB
/
i.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>TOPICS</title>
</head>
<body>
<div class="top-bar">
<h1>
My Forum
</h1>
</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>