-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblog.html
More file actions
155 lines (122 loc) · 5.52 KB
/
blog.html
File metadata and controls
155 lines (122 loc) · 5.52 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
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
<!DOCTYPE html>
<html>
<head>
<title>Blog</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif}
.w3-bar,h1,button {font-family: "Montserrat", sans-serif}
.fa-anchor,.fa-coffee {font-size:200px}
</style>
</head>
<body>
<!-- Navbar -->
<div class="w3-top">
<div class="w3-bar w3-white w3-card w3-large">
<a href="index.html" class="w3-bar-item w3-left-align w3-button w3-padding-large w3-hover-red" style="font-size:23px;background-color:#A64D79;color:white;">RealCompany</a>
<a href="whyreal.html" class="w3-bar-item w3-left-align w3-button w3-hide-small w3-padding-large w3-hover-red" style="font-size:23px;">Why</a>
<a href="product.html" class="w3-bar-item w3-left-align w3-button w3-hide-small w3-padding-large w3-hover-red" style="font-size:23px;">Product</a>
<a href="about.html" class="w3-bar-item w3-left-align w3-button w3-hide-small w3-padding-large w3-hover-red" style="font-size:23px;">Company</a>
<a href="blog.html" class="w3-bar-item w3-left-align w3-button w3-hide-small w3-padding-large w3-hover-red" style="font-size:23px;">Blog</a>
<a href="login.html" class="w3-bar-item w3-right w3-button w3-hide-small w3-padding-large w3-hover-red"><i class="fa fa-user" style="font-size:32px;padding:medium;"></i><div id="display_username"></div></a>
</div>
</div>
<head>
<title>RealCompany Careers</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="./style.css">
<style>
</style>
</head>
<body>
<!-- header -->
<div class="page-header w3-container">
<h2>Blog Posts</h2>
<p>Keep in touch with our latest news and events!</p>
</div>
<!-- what we do -->
<div id="beginblogs" class="w3-container w3-border w3-padding w3-padding-large">
<div class="w3-row">
</div>
</div>
<section>
<div class="w3-content w3-padding-64" style="margin-left:0px;width: 80vh;">
<div style=" background-color:#A64D79;cursor:pointer;" class="w3-container w3-hover-red" onclick="window.location.href='/resources.html'">
<h5>Need Help? <br>
<a class="w3-large">Resources</a>
</h5>
</div>
<div style="cursor:pointer;" class="w3-margin-top w3-container w3-light-grey w3-hover-red" onclick="window.location.href='/careers.html'">
<h5>Want a job?<br><a class="w3-large">Careers</a></h5>
</div>
<div class="w3-margin-top w3-padding w3-hover-red" style="background-color:#A64D79;cursor:pointer;" onclick="window.location.href='/contact.html'">
<h5>Have Questions?</h5>
<a class="w3-large">Contact us</a>
</div>
</div>
</section>
<!-- footer -->
<footer class="site-footer w3-grey">
<p>Don't see what you're looking for? <a href="contact.html">Contact us</a></p>
<p>Additional resources: see our <a href="blog.html">blog</a></p>
</footer>
<!-- <div class="w3-row">
<div class="w3-container w3-border w3-padding">
<div class="w3-col m2 w3-left"><h4>Update: Weekly Blog</h4></div>
<div class="w3-col m2 w3-right w3-right-align"><h6>11/29/2023 19:38</h6></div>
<div class="w3-col m4 w3-left w3-left-align"><h5>Sorry about this one</h5></div>
</div>
</div> -->
<script>
window.onload = async function() {
var webAddress = "http://localhost:5000/isLoggedIn";
var response = await fetch(webAddress);
var json = await response.json();
if (json.username != null){
document.getElementById("display_username").textContent = json.username;
}
var blogs = document.getElementById("beginblogs");
webAddress = "http://localhost:5000/blogposts";
response = await fetch(webAddress);
json = await response.json();
console.log();
var i = 0;
while (json.data[i]){
// create all div elements
var newrow = document.createElement('div');
newrow.setAttribute("class", "w3-row");
var newDiv = document.createElement('div');
newDiv.setAttribute("class", "w3-container w3-border w3-padding");
var newDiv2 = document.createElement('div');
newDiv2.setAttribute("class", "w3-col m2 w3-left");
var newDiv3 = document.createElement("div");
newDiv3.setAttribute("class", "w3-col m2 w3-right w3-right-align");
var newDiv4 = document.createElement("div");
newDiv4.setAttribute("class", "w3-col m4 w3-left w3-left-align");
// create all header elements
var newHead = document.createElement("h4");
newHead.textContent = json.data[i][0];
var newHead2 = document.createElement("h6");
newHead2.textContent = json.data[i][2];
var newHead3 = document.createElement("h5");
newHead3.textContent = json.data[i][1];
// append all elements in order
blogs.appendChild(newrow);
newrow.appendChild(newDiv);
newDiv.appendChild(newDiv2);
newDiv.appendChild(newDiv3);
newDiv.appendChild(newDiv4);
newDiv2.appendChild(newHead);
newDiv3.appendChild(newHead2);
newDiv4.appendChild(newHead3);
i++;
}
}
</script>
<script src="login.js"></script>
</html>