-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront_page_adjusted.html
143 lines (109 loc) · 3.17 KB
/
front_page_adjusted.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
<!DOCTYPE html>
<html>
<head>
<script src="https://d3js.org/d3.v5.min.js"></script>
<link rel="stylesheet" href="values.css">
<body>
<div class="header1" >
<img src="autistica.jpg" alt="Autistica logo" width="250" height="70" >
</div>
<div class="row">
<div class="leftcolumn">
<div class="card">
<h2>Notices</h2>
<p id="demo"></p>
<p>Based on your most recent submission, here are some links you may find helpful:</p>
<p id="link1"></p>
<p id="link2"></p>
<p id="link3"></p>
<p id="default"></p>
</div>
</div>
<div class="rightcolumn">
<div class="card">
<h2>Review your submissions here:</h2>
<button class="button button2" onclick="window.location.href = 'landingPage.html'+ '#' + text;">View Submissions</button>
</div>
<div class="card">
<span class="small_font">
You have submitted
</span>
<span class="large_font">
25
</span>
<span class="small_font">
questionaires in total.
</span>
</div>
</div>
</div>
<script>
var text = window.location.hash.substring(1); //Username for the logged in User
console.log(text);
function test(){
var d = new Date();
var time = d.getHours();
return time;
}
<!-- if(test()<=12){-->
<!-- document.getElementById("demo").innerHTML = "Good morning!";-->
<!-- } else if(test()>12&& test()<=18){-->
<!-- document.getElementById("demo").innerHTML = "Good afternoon!";-->
<!-- } else{-->
<!-- document.getElementById("demo").innerHTML = "Good night!";-->
<!-- }-->
function getMentalHealthData(){
d3.csv("Mental-health-Table1.csv", function(d){
if(text == d.Username){
return{
date : d.Date,
depression : +d.Depression,
};
}
}).then(function(data){
if(data[data.length - 1].depression > 20){
document.getElementById("link1").innerHTML = "https://www.giveusashout.org/get-help/?gclid=EAIaIQobChMI_c6zlJ_L5QIVyrHtCh3tbghNEAAYAiAAEgJDfPD_BwE";
}
// do something
});
}
getMentalHealthData();
// logic 1 depression
function getSelfConfidence(){
d3.csv("How_rate_your_confidence-Table1.csv", function(d){
if(text == d.Username){
return{
teamwork : +d.Teamwork,
};
}
}).then(function(data){
if(data[data.length - 1]<2.5){
document.getElementById("link2").innerHTML = "https://www.top10tips.uk/confidence";
}
// do something here
});
}
getSelfConfidence();
function getOrganisationalCulture(){
d3.csv("Organisational-culture-Table1.csv", function(d){
if(text == d.Username){
return{
average : +d.Average
};
}
}).then(function(data){
if(data[data.length - 1]<2){
document.getElementById("link3").innerHTML = "https://www.top10tips.uk/officeCulture";
}
// do something here
});
}
getOrganisationalCulture();
// logic 2 confidence
// logic 3 culture
if(true){
document.getElementById("default").innerHTML = "https://dareuk.org/"
}
</script>
</body>
</html>