-
Notifications
You must be signed in to change notification settings - Fork 2
/
search.html
398 lines (363 loc) · 10.4 KB
/
search.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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<!DOCTYPE html>
<html>
<head>
<title id="t">Galaxy search results</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet">
<link rel='icon' href='https://lb123658.github.io/galaxy/favicon.png' type='image/png'/>
<link href="https://fonts.googleapis.com/css2?family=Material+Icons" rel="stylesheet">
<style>
body {
background: #2F3137;
}
* {
font-family: 'Montserrat', sans-serif;
color: white;
}
::selection {
background: #5765f2;
}
:focus {
outline-width: 0px;
}
.button {
background: #5765f2;
}
#logo {
position: absolute;
top: 5px;
left: 10px;
font-size: 24px;
user-select: none;
}
#container {
position: absolute;
top: 20px;
left: 100px;
width: 600px;
height: 50px;
background: #3b4351;
border-radius: 8px;
}
#search-icon {
position: absolute;
top: 0px;
left: 0px;
height: 50px;
width: 50px;
border-radius: 8px;
border: none;
background: transparent;
color: grey;
}
#input {
position: absolute;
top: 0px;
left: 50px;
width: 500px;
height: 50px;
background: transparent;
border: none;
font-size: 20px;
}
#search-submit {
position: absolute;
top: 0px;
right: 0px;
height: 50px;
width: 50px;
border-radius: 8px;
border: none;
background: transparent;
cursor: pointer;
}
#search-submit:hover {
background: #5765f2;
}
#search-submit:focus {
background: grey;
}
#link-row {
position: absolute;
bottom: 0px;
left: 0px;
width: 100%;
text-align: center;
}
a {
color: grey;
text-decoration: none;
font-size: 15px;
}
#top {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 115px;
background: #2F3137;
z-index: 1;
}
#results {
position: absolute;
top: 130px;
width: 50%;
left: 5%;
min-height: 100px;
min-width: 500px;
background: #3b4351;
border-radius: 8px;
padding: 20px;
font-size: 17px;
}
span a:hover {
text-decoration: underline;
}
#pages-banner {
position: absolute;
top: 70px;
left: 110px;
user-select: none;
-webkit-user-select: none;
cursor: pointer;
text-align: left;
width: 500px;
}
#quick {
position: absolute;
top: 130px;
left: 65%;
width: 25%;
background: #3b4351;
border-radius: 8px;
padding: 20px;
font-size: 17px;
visibility: hidden;
}
@media screen and (max-width: 800px) {
#container {
width: 100%;
margin-left: 0px;
left: 0px;
}
#input {
width: 80%;
}
#logo {
visibility: hidden;
}
#pages-banner {
left: 0px;
width: 100%;
text-align: center;
}
#results {
width: 85%;
}
#menu {
visibility: hidden;
}
#quick {
display: none;
}
}
@media screen and (max-width: 910px) {
#quick {
left: 600px;
}
}
</style>
</head>
<body onload="checkTab()">
<div id="top">
<p id="logo" onclick="home()">Galaxy</p>
<!-- pages tabs at top -->
<p id="pages-banner">
<a href="#" id="web-tab">Web</a>
<a href="#" id="img-tab">Images</a>
<a href="#" id="vid-tab">Videos</a>
<a href="#" id="mus-tab">Music</a>
</p>
<div id="container">
<button id="search-icon"><span class="material-icons" style="color:grey;">search</span></button>
<form action="search" id="form">
<input type="text" autocomplete="off" placeholder="Search privately" id="input" name="q">
</form>
<button id="search-submit" type="submit" form="form"><span class="material-icons">search</span></button>
</div>
</div>
<!-- quick answer -->
<div id="quick">
<p>There was a problem loading this section.</p>
</div>
<!-- all results -->
<div id="results">
<div id="non-search">
<p>Not many results that matched your search came up.</p>
<p>Check to make sure it is spelled right.</p>
</div>
<div id="real-results">
<span id="first"></span>
<br><br>
<span id="wikipedia"></span>
<br><br>
<span id="youtube"></span>
<br><br>
<span id="amazon"></span>
<br><br>
<span id="pinterest"></span>
<br><br>
<span id="ebay"></span>
<br><br>
<span id="reddit"></span>
<br><br>
<span id="instagram"></span>
<br><br>
<span id="google"></span>
<br><br>
<span id="twitter"></span>
<br><br>
<span id="duckduckgo"></span>
<br><br>
<span id="ecosia"></span>
<br><br>
<span id="yandex"></span>
<br><br>
<span id="yahoonews"></span>
<br><br>
<span id="cnn"></span>
<br><br>
<span id="nytimes"></span>
<br><br>
<span id="spotify"></span>
<br><br>
<span id="soundcloud"></span>
<br><br>
<span id="wikihow"></span>
<br><br>
<span id="github"></span>
<br><br>
<span id="stackoverflow"></span>
<br><br>
</div>
<br><br><br>
<p id="link-row">
<a href="about">About Galaxy</a>
<a href="privacy">Privacy Policy</a>
<a href="history">Search history</a>
</p>
</div>
<script>
var query = location.search.split("=")[1].split("&")[0].replace(/\+/gi, " ");
var input = document.getElementById("input");
var results = document.getElementById("results");
var non = document.getElementById("non-search");
var real = document.getElementById("real-results");
//result links
var first = document.getElementById("first");
var wikipedia = document.getElementById("wikipedia");
var youtube = document.getElementById("youtube");
var amazon = document.getElementById("amazon");
var pinterest = document.getElementById("pinterest");
var ebay = document.getElementById("ebay");
var reddit = document.getElementById("reddit");
var instagram = document.getElementById("instagram");
var google = document.getElementById("google");
var twitter = document.getElementById("twitter");
var duckduckgo = document.getElementById("duckduckgo");
var ecosia = document.getElementById("ecosia");
var yandex = document.getElementById("yandex");
var yahoonews = document.getElementById("yahoonews");
var cnn = document.getElementById("cnn");
var nytimes = document.getElementById("nytimes");
var spotify = document.getElementById("spotify");
var soundcloud = document.getElementById("soundcloud");
var wikihow = document.getElementById("wikihow");
var github = document.getElementById("github");
var stackoverflow = document.getElementById("stackoverflow");
//page tabs at top of page
var web = document.getElementById("web-tab");
var img = document.getElementById("img-tab");
var vid = document.getElementById("vid-tab");
var mus = document.getElementById("mus-tab");
input.value = query
function home() {
location.replace("https://lb123658.github.io/galaxy");
}
if (query.length > 0) {
non.remove();
} else {
real.remove();
}
//LOAD SEARCH RESULTS -----------------------------------------------
function loadwebResults() {
//load new title
document.getElementById("t").innerHTML = query + " - Galaxy Search";
first.innerHTML = "Galaxy is still being made so these results may not be the most helpful at first.";
//wikipedia link
wikipedia.innerHTML = query + " - Wikipedia<br><a href='https://wikipedia.org/wiki/Special:Search?search=" + query + "' target='blank'>en.wikipedia.org</a>";
//youtube link
youtube.innerHTML = query + " - YouTube<br><a href='https://www.youtube.com/results?search_query=" + query + "' target='blank'>www.youtube.com</a>";
//amazon link
amazon.innerHTML = "Amazon.com : " + query + "<br><a href='https://www.amazon.com/s?k=" + query + "' target='blank'>www.amazon.com</a>";
//pinterest link
pinterest.innerHTML = query + " - Pinterest<br><a href='https://www.pinterest.com/search/pins/?q=" + query + "' target='blank'>www.pinterest.com</a>";
//ebay link
ebay.innerHTML = query + " | eBay<br><a href='https://www.ebay.com/sch/i.html?_nkw=" + query + "' target='blank'>www.ebay.com</a>";
//reddit link
reddit.innerHTML = "reddit.com: search results - " + query + "<br><a href='https://www.reddit.com/search/?q=" + query + "' target='blank'>www.reddit.com</a>";
//instagram link
instagram.innerHTML = query + " on Instagram • Photos and Videos<br><a href='https://www.instagram.com/explore/tags/" + query + "' target='blank'>www.instagram.com</a>";
//google link
google.innerHTML = query + " - Google Search<br><a href='https://www.google.com/search?q=" + query + "' target='blank'>www.google.com</a>";
//twitter link
twitter.innerHTML = query + " - Twitter Search / Twitter<br><a href='https://twitter.com/search?q=" + query + "' target='blank'>twitter.com</a>";
//duckduckgo link
duckduckgo.innerHTML = query + " at DuckDuckGo<br><a href='https://duckduckgo.com/?q=" + query + "' target='blank'>duckduckgo.com</a>";
//ecosia link
ecosia.innerHTML = query + " - Ecosia<br><a href='https://www.ecosia.org/search?q=" + query + "' target='blank'>www.ecosia.org</a>";
//yandex link
yandex.innerHTML = query + " - Yandex<br><a href='https://yandex.com/search/?text=" + query + "' target='blank'>yandex.com</a>";
//yahoonews link
yahoonews.innerHTML = query + " - Yahoo Search Results<br><a href='https://news.search.yahoo.com/search?p=" + query + "' target='blank'>news.search.yahoo.com</a>";
//cnn link
cnn.innerHTML = query + " - CNN.com<br><a href='https://www.cnn.com/search?q=" + query + "' target='blank'>www.cnn.com</a>";
//nytimes link
nytimes.innerHTML = query + " - The New York Times<br><a href='https://www.nytimes.com/search?query=" + query + "' target='blank'>www.nytimes.com</a>";
//spotify link
spotify.innerHTML = query + " - Spotify Web Player<br><a href='https://open.spotify.com/search/" + query + "' target='blank'>open.spotify.com</a>";
//soundcloud link
soundcloud.innerHTML = query + " - Soundcloud<br><a href='https://soundcloud.com/search?q=" + query + "' target='blank'>soundcloud.com</a>";
//wikihow link
wikihow.innerHTML = "Search for '" + query + "' - wikihow<br><a href='https://www.wikihow.com/wikiHowTo?search=" + query + "' target='blank'>www.wikihow.com</a>";
//github link
github.innerHTML = query + " - GitHub<br><a href='https://github.com/search?q=" + query + "' target='blank'>github.com</a>";
//stackoverflow link
stackoverflow.innerHTML = "Posts containing '" + query + "' - Stack Overflow<br><a href='https://stackoverflow.com/search?q=" + query + "' target='blank'>stackoverflow.com</a>";
//set first result to a website if website is searched
if (query.split(".")[1].length > 1) {
first.innerHTML = query + " - website<br><a href='https://" + query + "' target='_blank'>" + query + "</a>";
}
}
function checkTab() {
web.href = "search" + location.search;
img.href = "images" + location.search;
vid.href = "videos" + location.search;
mus.href = "music" + location.search;
web.style.color = "lightgrey";
web.style.fontWeight = "bold";
}
loadwebResults();
</script>
<script src="menu.js"></script>
<script src="quick.js"></script>
<script src="security.js"></script>
<script src="notification.js"></script>
<script src="tracking.js"></script>
</body>
</html>