-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog.html
378 lines (348 loc) · 11.7 KB
/
blog.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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!DOCTYPE html>
<!--
TXT by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>SyMptOMS Info</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, user-scalable=no"
/>
<link rel="stylesheet" href="assets/css/main.css" />
<link rel="stylesheet" href="assets/css/custom.css" />
<script>
// posts with tag Symptoms
getText(
"https://symptoms-web-default-rtdb.europe-west1.firebasedatabase.app/.json"
);
let last_displayed_post = 0;
async function getText(file) {
let myObject = await fetch(file);
let posts = await myObject.json();
/*
const req = new XMLHttpRequest();
req.addEventListener("load", req);
req.open("GET", file);
req.send();
let posts = JSON.parse(req.responseText);
*/
let posts_summary_html = "";
let posts_html = "";
let more_posts = "";
let last_displayed_post = posts.geotecblog[0].id;
let i = 0;
posts.geotecblog.forEach((p) => {
let d = new Date(p.date);
// left sidebar, load last 3 posts
if (i < 4) {
posts_summary_html =
posts_summary_html +
'<li> <a onclick="displayPost(' +
p.id +
')" href="#">' +
'<article class="box post-summary">' +
"<h3> " +
p.title.rendered +
"</h3>" +
'<div class="text-small">' +
p.excerpt.rendered +
"</div>" +
'<ul class="meta">' +
'<li class="icon fa-clock">' +
d.toDateString() +
"</li>" +
"</ul>" +
"</article>" +
"</a> </li>";
}
i++;
posts_html =
posts_html +
"<div id=" +
p.id +
' class="hide"><header>' +
"<h2>" +
p.title.rendered +
"</h2>" +
'<ul class="meta">' +
'<li class="icon fa-clock">' +
d.toDateString() +
"</li>" +
'<li class="icon fa-comments">';
p._embedded["wp:term"][1].forEach((tag) => {
posts_html = posts_html + tag.name + "; ";
});
let title_image = p._embedded["wp:featuredmedia"][0].title
? p._embedded["wp:featuredmedia"][0].title.rendered
: "";
if (p.imgurl) {
posts_html =
posts_html +
"</li>" +
'<li class="icon fa-link"> <a href="' +
p.link +
'" target= "_blank"> See original post</a></li>' +
"</ul>" +
"</header>" +
"" +
"<section>" +
'<span class="image featured"><img src="' +
p.imgurl +
'" alt="' +
title_image +
'" /></span>' +
"<p>" +
p.content.rendered +
"</p>" +
"</section> </div>";
more_posts =
more_posts +
'<div class="col-3 col-6-medium col-12-small">' +
'<section class="box feature">' +
'<span class="image featured"><img src="' +
p.imgurl +
'" alt="' +
title_image +
'" /></span>' +
'<h3><a href="#" onclick="displayPost(' +
p.id +
')">' +
p.title.rendered +
"</a></h3>" +
"<p>" +
p.excerpt.rendered +
"</p>" +
"</section>" +
'<ul class="actions">' +
"<li>" +
'<a href="#" onclick="displayPost(' +
p.id +
')" class="button large" style="background-color: #1F525E;"> Read more </a>' +
"</li>" +
"</ul>" +
"</div>";
} else {
posts_html =
posts_html +
"</a></li>" +
"</ul>" +
"</header>" +
"" +
"<section>" +
"<p>" +
p.content.rendered +
"</p>" +
"</section> </div>";
more_posts =
more_posts +
'<div class="col-3 col-6-medium col-12-small">' +
'<section class="box feature">' +
'<h3><a href="#" onclick="displayPost(' +
p.id +
')">' +
p.title.rendered +
"</a></h3>" +
"<p>" +
p.excerpt.rendered +
"</p>" +
"</section>" +
'<ul class="actions">' +
"<li>" +
'<a href="#" onclick="displayPost(' +
p.id +
')" class="button large" style="background-color: #1F525E;"> Read more </a>' +
"</li>" +
"</ul>" +
"</div>";
}
});
document.getElementById("posts-summary").innerHTML = posts_summary_html;
document.getElementById("last_post").innerHTML = posts_html;
document.getElementById("more_posts").innerHTML = more_posts;
console.log(posts);
// show last post
displayPost(last_displayed_post);
}
function displayPost(idPost) {
hidePost(last_displayed_post);
last_displayed_post = idPost;
document.getElementById(idPost).className = "show";
}
function hidePost(idPost) {
if (idPost != 0) {
document.getElementById(idPost).className = "hide";
}
}
</script>
</head>
<body class="homepage">
<div id="page-wrapper">
<!-- Header -->
<header id="header">
<div class="logo container">
<div>
<h1>
<a href="index.html" id="logo"
><img
style="width: 15%; height: 15%; vertical-align: middle"
src="images/logo-symptoms.png"
alt="Logo symptoms"
/></a>
</h1>
<p>Sensor- and Mobile -based Mental Health Solution</p>
</div>
</div>
</header>
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="research-lines.html">Research Lines</a></li>
<li><a href="use-cases.html">Use Cases</a></li>
<li><a href="tools.html">Tools</a></li>
<li><a href="publications.html">Publications</a></li>
<li class="current"><a href="blog.html">Blog</a></li>
<li><a href="about.html">About us</a></li>
<li><a href="privacy-policies.html">Privacy Policies</a></li>
<span class="menu-lang">
<li class="item-lang lang-disabled">
<a href="blog.html">EN</a>
</li>
<li class="item-lang lang">
<a href="es/blog.html">ES</a>
</li>
</span>
</ul>
</nav>
<!-- Main -->
<section id="main">
<div class="container">
<div class="row">
<div class="col-3 col-12-medium">
<div class="sidebar">
<!-- Sidebar -->
<!-- Recent Posts -->
<section>
<h2 class="major"><span>Recent Posts</span></h2>
<ul class="divided" id="posts-summary"></ul>
<a href="#" class="button alt">Archives</a>
</section>
</div>
</div>
<div class="col-9 col-12-medium imp-medium">
<div class="content">
<!-- Content -->
<article id="last_post" class="box page-content"></article>
</div>
</div>
<div class="col-12">
<!-- Features -->
<section class="box features">
<h2 class="major"><span>See more Symptoms posts</span></h2>
<div>
<div id="more_posts" class="row">
<div class="col-12">
<ul class="actions">
<li>
<a href="#" class="button large">Do Something</a>
</li>
<li>
<a href="#" class="button alt large"
>Think About It</a
>
</li>
</ul>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer id="footer">
<div class="container">
<div class="row gtr-200">
<div class="col-12">
<!-- About -->
<section>
<p>
SyMptOMS is being developed by
<a href="http://geotec.uji.es">GEOTEC</a> with the
contribution of
<a href="http://www.labpsitec.uji.es/esp/index.php"
>LABPSITEC</a
>
and funding by Ministerio de Ciencia, Innovación y
Universidades
</p>
</section>
</div>
<div class="col-12">
<!-- Contact -->
<section>
<h2 class="major"><span>Get in touch</span></h2>
<ul class="contact">
<li>
<a class="icon brands fa-facebook-f" href="#"
><span class="label">Facebook</span></a
>
</li>
<li>
<a
class="icon brands fa-twitter"
target="_blank"
href="https://twitter.com/geotecUJI"
><span class="label">Twitter</span></a
>
</li>
<li>
<a class="icon brands fa-instagram" href="#"
><span class="label">Instagram</span></a
>
</li>
<li>
<a
class="icon brands fa-dribbble"
target="_blank"
href="http://geotec.uji.es/projects/symptoms/"
><span class="label">Dribbble</span></a
>
</li>
<li>
<a
class="icon brands fa-linkedin-in"
target="_blank"
href="https://www.linkedin.com/company/geotec-geospatial-technologies-research-group---universitat-jaume-i/about/"
><span class="label">LinkedIn</span></a
>
</li>
</ul>
</section>
</div>
</div>
<!-- Copyright -->
<div id="copyright">
<ul class="menu">
<li>© Untitled. All rights reserved</li>
<li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</div>
</div>
</footer>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.dropotron.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>