forked from aleksandra-codes/SafeBike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiker.html
220 lines (188 loc) · 9.68 KB
/
biker.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"f>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/5.5.8/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/firebaseui/3.1.1/firebaseui.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCDm-MuMfMTfLEon_tUB4Vw2Hy6unaE6-I",
authDomain: "safebike-15d63.firebaseapp.com",
databaseURL: "https://safebike-15d63.firebaseio.com",
projectId: "safebike-15d63",
storageBucket: "",
messagingSenderId: "832976793088",
appId: "1:832976793088:web:04ae41016c6474f65d32e5"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
app_firebase = firebase;
</script>
<link rel="stylesheet" href="css/style.css"/>
<!--Leaflet imports-->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
crossorigin=""></script>
<!--Mapbox imports-->
<link rel='stylesheet' href='https://api.mapbox.com/mapbox.js/v3.2.0/mapbox.css'/>
<script src='https://api.mapbox.com/mapbox.js/v3.2.0/mapbox.js'></script>
<!--jQuery imports-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Bootstrap and font awesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.css" type="text/css" rel="stylesheet">
<!-- Local stylesheets -->
<link rel="stylesheet" href="css/style.css"/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
crossorigin=""></script>
<script src='https://api.mapbox.com/mapbox.js/v3.2.0/mapbox.js'></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Nunito&display=swap" rel="stylesheet">
<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/6.6.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.6.1/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js"></script>
<script src="src/utils/firebase.js"></script>
<script src="src/utils/alertSystem.js"></script>
</head>
<body>
<nav class="navbar navbar-light navbar-default navbar-expand-md fixed-top" id="mainNav">
<a href="#" class="navbar-brand" id="brand"> <i class="fas fa-bicycle"></i> SafeBike</a>
<button class="navbar-toggler" data-toggle="collapse" data-target="#navLinks" aria-label="Toggle-navbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navLinks">
<ul class="navbar-nav">
<li class="nav-item"><a href="#" class="nav-link">Dashboard</a></li>
<li class="nav-item"><a href="#" class="nav-link">About</a></li>
<li class="nav-item" id="logOutButton"><a href="#" class="nav-link">Logout</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="justify-content-md-center white-container shadow">
<div id="mapid"></div>
<div class="col-md text-center">
<div class="mt-5">To request help press on one of the buttons.</div>
<div id="confirm-msg"></div>
<div id="help-is-coming"></div>
<button id="med-btn" type="button" class="btn btn-primary biker-buttons my-4" value="medical">
<i class="fas fa-briefcase-medical"></i> Medical</button>
<button id="water-btn" type="button" class="btn btn-primary biker-buttons my-4" value="water">
<i class="fas fa-tint"></i>
Water
</button>
<button id="repair-btn" type="button" class="btn btn-primary biker-buttons my-4" value="repair">
<i class="fas fa-tools"></i>
Repair</button>
<!-- <button id="request-btn" type="button" class="btn btn-secondary biker-buttons my-4s">My requests</button> -->
<button id="confirm-btn" type="button" class="btn btn-success biker-buttons m-4">Confirm</button>
<button id="cancel-btn" type="button" class="btn btn-danger biker-buttons m-4">Cancel</button>
<button id="ok-btn" type="button" class="btn btn-success biker-buttons mt-4 mb-5 cl">Ok</button>
</div>
</div>
</div>
<script>
firebase.auth().onAuthStateChanged(firebaseUser => {
if (firebaseUser) {
console.log(firebaseUser);
btnLogOut.style.display = "inline";
btnLogin.style.display = 'none';
btnSignUp.style.display = 'none';
} else {
btnLogOut.style.display = "none";
btnLogin.style.display = 'inline';
btnSignUp.style.display = 'inline';
console.log("Not logged in")
}
});
</script>
<script>
// Medical button was clicked
$('#med-btn').on('click', addMsgMed);
function addMsgMed(){
$('#confirm-msg').text("Please confirm your request for medical help.");
$('#water-btn').toggle();
$('#repair-btn').toggle();
$('#med-btn').toggle();
$('#request-btn').toggle();
$('#confirm-btn').show();
$('#cancel-btn').show();
$('#confirm-msg').show();
}
// Water button was clicked
$('#water-btn').on('click', addMsgWater);
function addMsgWater(){
$('#confirm-msg').text("Please confirm your request for water.");
$('#water-btn').toggle();
$('#repair-btn').toggle();
$('#request-btn').toggle();
$('#med-btn').toggle();
$('#confirm-btn').toggle();
$('#cancel-btn').toggle();
$('ok-btn').toggle();
$('#confirm-msg').toggle();
}
//Repair button was clicked
$('#repair-btn').on('click', addMsgRepair);
function addMsgRepair(){
$('#confirm-msg').text("Please confirm your request for repair.");
$('#confirm-msg').show();
$('#water-btn').toggle();
$('#repair-btn').toggle();
$('#med-btn').toggle();
$('#request-btn').toggle();
$('#confirm-btn').toggle();
$('#cancel-btn').toggle();
}
// Cancel request button
$('#cancel-btn').on('click', returnFuncCancel);
function returnFuncCancel(){
$('#confirm-msg').hide();
$('#water-btn').show();
$('#repair-btn').show();
$('#med-btn').show();
$('#confirm-btn').hide();
$('#cancel-btn').hide();
$('#request-btn').show();
}
// Confirm button clicked
$('#confirm-btn').on('click', returnFuncConfirm);
function returnFuncConfirm(){
$('#help-is-coming').toggle();
$('#help-is-coming').text("Help is on the way! Please wait, a voluneer is going to be with you shortly");
$('#confirm-msg').hide();
$('#confirm-btn').hide();
$('#cancel-btn').hide();
$('#request-btn').show();
$('#ok-btn').show();
}
// Ok button
$('#ok-btn').on('click', okFunc);
function okFunc(){
$('#help-is-coming').hide();
$('#water-btn').show();
$('#repair-btn').show();
$('#med-btn').show();
$('#confirm-btn').hide();
$('#cancel-btn').hide();
$('#ok-btn').toggle();
$('#request-btn').toggle();
}
</script>
<script src="public/js/map.js"></script>
<script src="public/js/leaflet-routing-machine.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>