-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
313 lines (271 loc) · 9.28 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<title>Tindev</title>
<link rel="icon" href="favicon.ico">
<!-- See https://goo.gl/OOhYW5 -->
<link rel="manifest" href="manifest.json">
<!-- See https://goo.gl/qRE0vM -->
<meta name="theme-color" content="#231657">
<!-- Add to homescreen for Chrome on Android. Fallback for manifest.json -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="Tindev">
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Tindev">
<!-- Homescreen icons -->
<link rel="apple-touch-icon" sizes="128x128" href="images-optimized/manifest/icon-128x128.png">
<link rel="apple-touch-icon" sizes="144x144" href="images-optimized/manifest/icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="images-optimized/manifest/icon-152x152.png">
<link rel="apple-touch-icon" sizes="192x192" href="images-optimized/manifest/icon-192x192.png">
<link rel="apple-touch-icon" sizes="200x200" href="images-optimized/manifest/icon-200x200.png">
<!-- Tile icon for Windows 8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="images-optimized/manifest/icon-144x144.png">
<meta name="msapplication-TileColor" content="#231657">
<meta name="msapplication-tap-highlight" content="no">
<script>
// Setup Polymer options
window.Polymer = window.Polymer || {
dom: 'shadow',
lazyRegister: true
};
</script>
<link rel="import" href="/index-imports.html">
<style>
html {
margin: 0;
--primary-color: #231657;
--secondary-color: #F39200;
--tertiary-color: #8BD1EF;
--text-color: #fafafa;
--header-height: 64px;
}
body {
margin: 0;
height: calc(100vh - 80px);
padding-top: 80px; /* 64px + 16px */
color: #212121;
font-family: "Helvetica Neue", "Calibri Light", Roboto, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
letter-spacing: 0.02em;
background-color: #eeeeee;
}
header {
position: fixed;
height: 64px;
background-color: #231657;
color: #fafafa;
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
font-weight: bold;
top: 0;
z-index: 5;
box-shadow: 0 2px 5px rgba(0,0,0,.26);
}
header .title {
margin: auto 16px;
}
header label {
display: none;
margin: 20px;
}
header input {
display: none;
}
nav {
margin: 20px;
background-color: #231657;
}
nav a {
margin: 0 10px;
color: #fafafa;
opacity: 1;
transition: opacity 0.2s ease-in-out;
}
nav a:hover {
opacity: 0.6;
}
.logo {
margin: 4px 20px;
}
.pages {
height: 100%;
display: flex;
flex-direction: column;
}
iron-lazy-pages {
flex: 1;
}
iron-lazy-pages > * {
margin: 0 auto;
max-width: 800px;
width: 80vw;
height: calc(100vh - 80px);
}
.large-width {
width: 100%;
max-width: 100%;
}
[data-route="404"] {
display: none;
}
.title {
color: #fafafa;
font-weight: 600;
}
footer {
background-color: #231657;
color: white;
padding: 15px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
}
@media (max-width: 500px) {
body {
height: calc(100vh - 64px);
padding-top: 64px;
}
nav {
display: block;
margin: 0;
padding: 10px;
width: 100%;
border-top: solid 1px #e7e7e7;
text-align: center;
line-height: 24px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
visibility: collapse;
opacity: 0;
transition: visibility 0s, opacity 0.25s;
}
header input:checked ~ nav {
visibility: visible;
opacity: 1;
}
iron-selector {
display: flex;
flex-direction: column;
text-align: left;
}
a {
padding: 8px 0;
}
header label {
display: block;
}
.pages {
min-width: 100%;
padding-top: 0;
}
footer {
box-shadow: none;
}
}
</style>
</head>
<body>
<!-- app-location binds to the app's URL -->
<app-location id="location"></app-location>
<app-route id="route" pattern="/:page"></app-route>
<header>
<span class="title">Tindev</span>
<label for="menu">Menu</label>
<input id="menu" type="checkbox" />
<nav>
<iron-selector attr-for-selected="data-route" id="navigation">
<a data-route="" href="/">Home</a>
<a data-route="classify" href="/classify">Classify</a>
</iron-selector>
</nav>
</header>
<div class="pages">
<iron-lazy-pages id="pages" attr-for-selected="data-route" fallback-selection="404">
<tindev-homepage data-route="" data-path="/src/tindev-homepage.html" id="home"></tindev-homepage>
<tindev-results data-route="results" data-path="/src/tindev-results.html" id="results"></tindev-results>
<tindev-details data-route="details" data-path="/src/tindev-details.html" id="details"></tindev-details>
<tindev-commits data-route="classify" data-path="/src/tindev-commits.html" id="classify" class="large-width"></tindev-commits>
</iron-lazy-pages>
</div>
<script>
(function(document, window) {
window.addEventListener('WebComponentsReady', function() {
var navigation = document.getElementById('navigation');
var location = document.getElementById('location');
var route = document.getElementById('route');
var pages = document.getElementById('pages');
var menu = document.getElementById('menu');
var results = document.getElementById('results');
var details = document.getElementById('details');
var homepage = document.getElementById('home');
navigation.addEventListener('selected-changed', function(e) {
var selected = e.detail.value;
route.data.page = selected;
location.path = selected + (selected && '/');
pages.selected = selected;
menu.checked = false;
});
location.addEventListener('route-changed', function(e) {
route.route = e.detail.value;
});
route.addEventListener('data-changed', function(e) {
var page = e.detail.value.page;
if (page !== undefined) {
navigation.selected = e.detail.value.page;
var fastPath = document.getElementsByClassName('fast-path');
fastPath.length && fastPath[0].classList.remove('fast-path');
}
});
results.addEventListener('accepted-results-changed', function(e) {
details.results = results.acceptedResults;
});
homepage.addEventListener('search', function(query) {
var results = document.getElementById('results');
results.query = query.detail;
// results.setAttribute('query', JSON.stringify(query.detail));
var route = document.getElementById('route');
route.set('route.path', "/results");
});
route.route = location.route;
});
// Load webcomponentsjs polyfill if browser does not support native Web Components
(function() {
'use strict';
var onload = function() {
// For native Imports, manually fire WebComponentsReady so user code
// can use the same code path for native and polyfill'd imports.
if (!window.HTMLImports) {
document.dispatchEvent(
new CustomEvent('WebComponentsReady', {bubbles: true})
);
}
};
var webComponentsSupported = (
'registerElement' in document
&& 'import' in document.createElement('link')
&& 'content' in document.createElement('template')
);
if (!webComponentsSupported) {
var script = document.createElement('script');
script.async = true;
script.src = 'bower_components/webcomponentsjs/webcomponents-loader.js';
script.onload = onload;
document.head.appendChild(script);
} else {
onload();
}
})();
// Load pre-caching Service Worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('service-worker.js');
});
}
})(document, window);
</script>
</body>
</html>