-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·279 lines (209 loc) · 6.11 KB
/
index.html
File metadata and controls
executable file
·279 lines (209 loc) · 6.11 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
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
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<style>
body
{
margin:0;
}
#container
{
border: 1px solid black;
border-radius: 30px;
margin: auto;
width: 80%;
position: relative;
text-align:center;
padding: 20px;
}
#container #tweet
{
background-color:#F0FFFF;
border-radius: 30px;
float: left;
width: 96.5%;
font-size: 2em;
padding: 20px;
}
#container #tweet div
{
text-align:left;
}
#container img
{
width: 20%;
height: 20%;
float:left;
padding-right: 20px;
border-radius: 30px;
}
#container video
{
clear: both;
text-decoration: none;
border:none;
padding-top: 20px;
margin-left: 3px;
margin-right: 3px;
width: 25%;
height: 20%;
}
#head
{
width:100%;
color:#FAFAFA;
height:170px;
text-shadow: 2px 2px 0px rgba(150, 150, 150, 1);
background: #39d800; /* Old browsers */
background: -moz-linear-gradient(top, #39d800 0%, #00a008 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#39d800), color-stop(100%,#00a008)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #39d800 0%,#00a008 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #39d800 0%,#00a008 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #39d800 0%,#00a008 100%); /* IE10+ */
background: linear-gradient(to bottom, #39d800 0%,#00a008 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#39d800', endColorstr='#00a008',GradientType=0 ); /* IE6-9 */
font-family: Brush Script MT;
font-weight:bold;
font-size:8.5em;
text-align:center;
}
form div
{
padding:0.8%;
}
fieldset
{
font-size: 2em;
position:relative;
}
input
{
width: 300px;
height: 50px;
font-size: 1.2em;
clear:both;
}
</style>
</head>
<body>
<div id = "head">Notifye</div><br>
<div id = "container">
</div>
<br>
<fieldset>
<legend>Search</legend>
<form id = "annoyingForm" name = "form" method = "get">
<div>Tags:
<input id = "tag" type="text" required = "required" name = "tag" placeholder = "lolcats">
</div>
<div>Distance (miles):
<input placeholder = "200" type = "text" id = "distance" name = "distance">
</div>
<div>From:
<input type="date" id = "firstDate" name = "fDate">
</div>
<div id = "happy"> Mood Evaluator:
<input type="checkbox" id = "happy" name = "happy">
</div>
<br>
<div><input type = "button" name = "submit" value = "Submit" id = "sub"></div>
</form>
</fieldset>
<script>
$(document).ready(function(){
/*For click the button.*/
$("#sub").click(function(){
locationStuff();
// All searches will be done based date if no date is
// defined it just ignores the since.
handleTagSearchFrom();
window.scrollTo(0,0);
});
function locationStuff(){
getLocation();
}
function getLocation(){
navigator.geolocation.getCurrentPosition(showLocation);
}
function showLocation(position){
var string = "You are here: (";
var lat = position.coords.latitude;
var lon = position.coords.longitude;
string = string + lat + ", " + lon + ").";
var dist = parseInt($("#distance").val());
dist = Math.sqrt(dist);
lon -= dist;
lat -= dist;
var maxLon = lon + dist;
var maxLat = lat + dist;
var tags = $("#tag").val();
var string = "";
for (var i = 0, len = tags.length; i<len; i++){
string += tags[i];
}
var array = string.split(",");
if (dist === undefined){}
else{
// HERE YOU GO WE SENT GEOLOCATION TO SERVER
$.get('geoloc', {arr: [lon, lat, maxLon, maxLat, array[0]]}, function(data){});
}
}
function handleTagSearchFrom()
{
// got the date of today
var fDate = $("#firstDate").val();
var tags = $("#tag").val();
var string = "";
for (var i = 0, len = tags.length; i<len; i++){
string += tags[i];
}
var array = string.split(",");
$.get("/formstuff", {arr: array}, function(data){
var elem = document.getElementById("container");
var hr = document.createElement("hr");
// get a tweet.
$.get("/searchFromDay", {arr: [array[0], fDate]}, function(ttt){
var text = ttt;
var textField = document.createElement('div');
textField.setAttribute('id', 'tweet');
var p = document.createElement('p');
var h = document.getElementById('happy').checked;
if ($("#happy:checked").val() !== undefined){
$.get('/mood', {arr: text}, function(data){
// put the mood into a <p>
var happyP = document.createElement('p');
var happyLevel = String.fromCharCode(13) + "Mood = " + data;
happyP.innerHTML = happyLevel;
// add the text to the paragraph
p.innerHTML = text;
textField.appendChild(p);
textField.appendChild(happyP);
elem.insertBefore(textField, elem.firstChild.nextSibling);
});
}
});
// create the area to hold all the info.
var page = document.createElement("div");
page.setAttribute('id', 'block');
// create all the frames and add them to the page.
for (var i = 0 ; i < data.length; i++)
{
var frame = document.createElement("video");
var loc = data[i];
frame.setAttribute('src', loc);
frame.setAttribute('id', 'block');
frame.setAttribute('id', 'vine');
frame.setAttribute('controls', 'true');
page.appendChild(frame);
}
// put a horizontal line at the end of the page.
page.appendChild(hr);
// add the new page to the main container.
elem.insertBefore(page, elem.firstChild.nextSibling);
});
}
});
</script>
</body>
</html>