-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnews.html
59 lines (59 loc) · 1.75 KB
/
news.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
<!DOCTYPE html>
<html>
<head>
<title>Digital Electronics</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="common.css">
<style>
.footer {
padding: 5px; /* Some padding */
margin:0px;
text-align: center; /* Center text*/
background: #ddd; /* Grey background */
}
.main {
text-align: center;
}
.image {
float:top; /*This is invalid. Where is this even used?*/
}
.news{
border:1px solid black;
border-radius:2px;
margin:5px 0px;
}
</style>
</head>
<body>
<script src="navbar.js"></script>
<div class="header">
<h1>Digital Electronics</h1>
</div>
<div class="main">
<div class="image"><img src="/assets/newspaper-icon.png" alt="newspaper"/></div>
Note: new news(no pun intended) will only be shown for 21 days. After<br/>that, they will be deleted to prevent storage overload because I only have 100 MB.
<hr/>
<div id="news"></div>
<br/><br/><br/><br/><br/><br/>
</div>
<div class="footer">
<h2>Contact Us</h2>
<a href="https://github.com/Digital-Electronics-LLC">github</a><br/>
©2021 Digital-Electronics-LLC
</div>
<script>
var news = document.querySelector("#news")
fetch("/news.min.json").then(r => r.json()).then(function(json){
if(!json.length) return news.inneHTML = `<div class="marquee"><p><h3>No current news, You're all caught up!</h3></p></div>`
var html = ""
json.forEach(x => {
html += "<div class='news'>"
html += "<h1>"+x.title+"</h1>"
html += x.content
html += "</div>"
})
news.innerHTML = html
})
</script>
</body>
</html>