-
Notifications
You must be signed in to change notification settings - Fork 0
/
signed_in.html
184 lines (176 loc) · 9.17 KB
/
signed_in.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lactation Location</title>
<!-- Include links to CSS stylesheets below -->
<link rel="stylesheet" href="node_modules/bulma/css/bulma.css">
<link rel="stylesheet" href="lactation.css">
<link rel="icon" href="pictures/mother.png">
</head>
<body>
<div id="root">
<section class="hero is-info">
<div class="hero-body">
<div class="container">
<!--button class="button" id="sign_in" style="background-color:black; color: white; margin-top: 10px; float: right; text-decoration: none;"><a href="sign_in.html" style="color: white; text-decoration: none;">Sign In</a></button-->
<button class="button" id="sign_out" style="background-color:black; color: white; margin-top: 10px; float: right; text-decoration: none;"><a href="index.html" style="color: white; text-decoration: none;">Sign Out</a></button>
<h1 class="title"><strong><a href="signed_in.html" style="text-decoration: none; color: white;">Lactation Location</a></strong></h1>
<h2 class="subtitle">A woman's guide to finding a close lacation room while on UNC's campus.</h2>
<form autocomplete="off" action="/action_page.php">
<div class="autocomplete" style="width:300px;"></div>
<div class="field is-grouped">
<p class="control is-expanded">
<input class="input" id="searchBar" type="text" placeholder="Find a lactation room (ex. 'North Campus', 'Carolina Union')">
<p class="control" id="searchButton">
<!--a class="button is-dark">Search</a-->
</p>
</div>
</p>
</div>
</form>
</div>
</div>
</section>
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<script>
mybutton = document.getElementById("myBtn");
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}
</script>
<script>
// Initialize and add the map
function initMap() {
var chapelHill = {lat: 35.9132, lng: -79.0558};
// The map, centered at chapel hill
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 14, center: chapelHill});
lactationData.forEach(room => {
var roomCoord = {lat: room.lat, lng: room.lng};
var marker = new google.maps.Marker({position: roomCoord, map: map});
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCMm5aIAjT3m0MSPEnM-aeZ8tYznHS0SGo&callback=initMap">
</script>
<div class="container section" style="padding:10px;">
<div class="columns">
<!-- Include links to JavaScript files below -->
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="data.js"></script>
<script src="signed_in.js" type="module"></script>
<script src="permissions.js" type="module"></script>
<script src="test.js" type="module"></script>
<!-- <script src="sign_in.js" type="module"></script>
<script src="sign_up.js" type="module"></script> -->
</div>
</div>
<div class="container box section" id="directions">
<div style="display:inline;">
<img src="pictures/globe.png" style="width:60px;height:60px;float:left;margin-right:10px;">
<h1 class="title is-1" style="color:#4B9CD3;">Find Directions</h1>
</div>
<div id="map"></div>
</div>
</div>
<footer class="footer" style="padding:20px !important; background-color:lightgray; margin-top: 20px;">
<div class="content has-text-centered">
<p><strong>KMPeeps' Lacation Location</strong> created by Abby Brosnan, Jessica Davis, and Cassidy Soutter.</p>
</div>
</footer>
<script>
function autocomplete(inp, arr) {
var currentFocus;
inp.addEventListener("input", function(e) {
var a, b, i, val = this.value;
closeAllLists();
if (!val) { return false;}
currentFocus = -1;
a = document.createElement("DIV");
a.setAttribute("id", this.id + "autocomplete-list");
a.setAttribute("class", "autocomplete-items");
this.parentNode.appendChild(a);
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
b = document.createElement("DIV");
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
b.innerHTML += arr[i].substr(val.length);
b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
b.addEventListener("click", function(e) {
inp.value = this.getElementsByTagName("input")[0].value;
closeAllLists();
});
a.appendChild(b);
}
}
});
inp.addEventListener("keydown", function(e) {
var x = document.getElementById(this.id + "autocomplete-list");
if (x) x = x.getElementsByTagName("div");
if (e.keyCode == 40) {
currentFocus++;
addActive(x);
} else if (e.keyCode == 38) {
currentFocus--;
addActive(x);
} else if (e.keyCode == 13) {
e.preventDefault();
if (currentFocus > -1) {
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
if (!x) return false;
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1);
x[currentFocus].classList.add("autocomplete-active");
}
function removeActive(x) {
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("autocomplete-active");
}
}
function closeAllLists(elmnt) {
var x = document.getElementsByClassName("autocomplete-items");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i] && elmnt != inp) {
x[i].parentNode.removeChild(x[i]);
}
}
}
document.addEventListener("click", function (e) {
closeAllLists(e.target);
});
}
var searchWords = ["North Campus", "Central Campus", "South Campus",
"Fred Brooks", "MacNider Hall", "Carolina Square", "Carolina Union",
"Marsico Hall", "Carrington Hall", "Cheek-Clark Building",
"FedEx Global Education Center", "First Dental Building", "Friday Center",
"Genetic Medicine Building", "Genome Sciences Building",
"Giles Horney Building", "Hill Hall", "Mary Ellen Jones Building",
"McColl Building", "Medical Biomolecular Research Building",
"NC Botanical Garden", "Office of University Development", "Rosenau Hall",
"Sonja Haynes Stone Center", "Student Stores", "Tate-Turner-Kuralt",
"Carolina Veterans Resource Center", "Wilson Hall", "Off Campus"];
autocomplete(document.getElementById("searchBar"), searchWords);
</script>
</script>
</body>
</html>