-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·443 lines (365 loc) · 13.7 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
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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="assets/img/favicon.ico">
<title>Biteup - Join the Takeout Revolution</title>
<!-- Twitter Bootstrap styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<!-- Third-party styles -->
<link href="assets/css/superslides.css" rel="stylesheet">
<link href="assets/css/ionicons.min.css" rel="stylesheet">
<link href="assets/css/cubeportfolio.css" rel="stylesheet">
<!-- Custom style -->
<link href="assets/css/style.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<section id="slides">
<ul class="slides-container">
<li>
<img src="assets/img/pho.jpg" alt="">
</li>
</ul>
<div id="bannertext">
<h1>Biteup</h1>
<hr class="aligncenter">
<h3>Because We Deserve Better for Takeaway Menus.</h3>
<p><button class="btn btn-lg btn-gobbl btn-design">Learn More</button></p>
</div>
<!-- end:Banner text -->
<nav class="slides-navigation">
<a href="index.html#" class="next">
<i class="ion-ios7-arrow-forward"></i>
</a>
<a href="index.html#" class="prev">
<i class="ion-ios7-arrow-back"></i>
</a>
</nav>
</section>
<!-- END SLIDES SECTION -->
<div id="g">
<div class="container">
<div class="row mtb">
<div class="col-md-1 centered">
<i class="icon ion-ios7-heart-outline"></i>
</div>
<div class="col-md-3 w">
<h5>Search</h5>
<hr>
<p>Information of delicious bento offerings at your fingertips!<br>Smart search makes choosing easy!</p>
</div>
<div class="col-md-1 centered">
<i class="icon ion-ios7-toggle-outline"></i>
</div>
<div class="col-md-3 w">
<h5>Tap</h5>
<hr>
<p>With a clean and easy interface, finding your bento is finally simple and fun! </p>
</div>
<div class="col-md-1 centered">
<i class="icon ion-ios7-navigate-outline"></i>
</div>
<div class="col-md-3 w">
<h5>Biteup</h5>
<hr>
<p>Go Go Go! Let bring you to your bento with active Geolocation!</p>
</div>
</div><!--/row -->
</div><!--/container -->
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<img class="img-responsive aligncenter" src="assets/img/phone.png" alt="">
</div>
</div><!--/row -->
</div><!--/container -->
</div><!--G -->
<div id="grid-container" class="cbp-l-grid-fullScreen">
<ul id="bentoGallery">
</ul>
</div><!--/grid-container-->
<div class="container">
<div class="row mtb2 centered">
<div class="col-md-4 w">
<div class="circle-icon">
<div class="icon ion-fork"></div>
</div>
<h5>Fine Selection</h5>
<hr class="aligncenter">
<p>Biteup is not just a search engine for takeaway meals. We curate our lists so that you will only see the fine selection of takeaway meals you deserve! </p>
</div><!--/col-md-4-->
<div class="col-md-4 w">
<div class="circle-icon">
<div class="icon ion-ios7-navigate-outline"></div>
</div>
<h5>Distance-Friendly</h5>
<hr class="aligncenter">
<p>While it's great to burn some calories while walking, with Biteup, you don't have to run a marathon to get to those delicious takeaways.</p>
</div><!--/col-md-4-->
<div class="col-md-4 w">
<div class="circle-icon">
<div class="icon ion-ios7-lightbulb-outline"></div>
</div>
<h5>Save Time Thinking</h5>
<hr class="aligncenter">
<p>Biteup smartly initiates places and meals for you! Save time spend pondering over lunch for a more productive day!</p>
</div><!--/col-md-4-->
</div><!--/row -->
</div><!-- /.container -->
<div id="t" class="carousel slide" data-ride="carousel">
<div class="col-md-6 col-md-offset-3 centered">
<h5></h5>
<hr class="aligncenter">
<div class="carousel-inner">
<div class="item active">
<div class="centered mtb">
<h4 id="bento-view-header" data-mixpanel-event="Simulate Bento Viewed">Number of Bentos viewed:</h4>
<h1 id="bento-view-info">0</h1>
</div>
</div><!-- /item -->
</div><!--/carousel-inner -->
</div><!--/col-md-6 -->
</div><!--/T -->
<div id="f">
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3 w centered">
<h5 class="mb">Would you like to know more information on bentos around you?</h5>
<form role="form" action="#" method="post" enctype="plain">
<input type="email" name="email" class="subscribe-input" placeholder="Enter your e-mail address..." required>
<button class='btn btn-lg btn-clear subscribe-submit' type="submit">Subscribe</button>
</form>
</div><!--/col-md-6-->
</div><!--/row -->
<div class="row mtb">
<div class="col-md-6 col-md-offset-3 centered">
<a href="http://github.com/biteup"><i class="icon ion-social-github"></i></a>
<a href="http://facebook.com/biteup"><i class="icon ion-social-facebook"></i></a>
<a href="http://twitter.com/biteup"><i class="icon ion-social-twitter"></i></a>
</div>
</div>
</div><!--/container -->
</div><!--/F -->
<!-- Bootstrap JS
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- Third-party JS -->
<script src="assets/js/retina-1.1.0.js"></script>
<script src="assets/js/jquery.superslides.js"></script>
<script src="assets/js/jquery.cubeportfolio.js"></script>
<script src="assets/js/jquery.hammer.min.js"></script>
<script src="node_modules/mixpanel-data-export/dist/mixpanel_data_export.js"></script>
<script>
!function($){
var undefined; // define undefined so the undefined value does not get overridden
var currentViewed;
var isBentoViewAnimated;
Array.prototype.shuffle = function(){
// Fisher-Yates shuffle
var currentIndex = this.length,
randomIndex,
tmp;
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// swap
tmp = this[currentIndex];
this[currentIndex] = this[randomIndex];
this[randomIndex] = tmp;
};
return this;
};
loadMenus();
// Banner text add parallax efect and fade
function EasyPeasyParallax() {
scrollPos = $(this).scrollTop();
$('#slider').css({
'background-position': '50% ' + (-scrollPos / 4) + "px"
});
$('#bannertext').css({
'margin-top': (scrollPos / 4) + "px",
'opacity': 1 - (scrollPos / 250)
});
}
// Check if element is on screen or not
$.fn.isOnScreen = function() {
var viewport = {};
viewport.top = $(window).scrollTop();
viewport.bottom = viewport.top + $(window).height();
var bounds = {};
bounds.top = this.offset().top;
bounds.bottom = bounds.top + this.outerHeight();
return ((bounds.top <= viewport.bottom) && (bounds.bottom >= viewport.top));
};
Math.easeOutQuad = function (t, b, c, d) {
t /= d;
return -c * t*(t-2) + b;
};
$.fn.countUpAnimate = function(start, target) {
var elements = this;
var clr = null;
// Max distant is 100
var start = target - start > 100 ? target - 100 : start;
var count = start;
var elapsedTime = 0;
(function () {
var inloop;
clearTimeout(clr);
(inloop = function () {
if (count >= target) {
return;
}
elapsedTime += 1;
count = Math.round(Math.easeOutQuad(elapsedTime, start, target - start, target));
count = count > target ? target : count;
elements.text(count);
clr = setTimeout(inloop, 32);
})();
})();
}
$(document).ready(function () {
$('#slides').superslides({
slide_easing: 'easeInOutCubic',
slide_speed: 800,
pagination: true,
hashchange: false,
scrollable: true,
animation: 'fade'
});
// Add swipe option
$('#slides').hammer().on('swipeleft', function () {
$(this).superslides('animate', 'next');
});
$('#slides').hammer().on('swiperight', function () {
$(this).superslides('animate', 'prev');
});
$(window).scroll(function () {
EasyPeasyParallax();
if ($('#bento-view-info').isOnScreen() && !isBentoViewAnimated) {
isBentoViewAnimated = true;
if (currentViewed) {
$('#bento-view-info').countUpAnimate(0, currentViewed);
}
}
});
// get mixpanel event info
var mixpanelEvent = $('#bento-view-header').data('mixpanel-event');
fetchMixpanelEvents([mixpanelEvent], function(data){
currentViewed = data[mixpanelEvent];
$('#bento-view-info').text(data[mixpanelEvent]);
});
});
function fetchMixpanelEvents(events, callback){
// NOTE
// we really need to make this repository private if we want to keep our Mixpanel data private
// or at least shift settings / config below to a specific json file
var API_KEY = 'cb7947b81e377833c6e2b43303c35a67',
API_SECRET = '47133ca36be25e1b72b91dbea947ea20',
MIXPANEL_API_URL = 'http://mixpanel.com/api/2.0/';
var panel = new MixpanelExport({
api_key: API_KEY,
api_secret: API_SECRET
});
panel.events({
event: events,
interval: 7,
unit: "day",
type: "general"
}).then(function(data){
var score = {};
for(var event in data.data.values){
var eventDetail = data.data.values[event];
if(score[event] === undefined){
score[event] = 0;
};
for(var interval in eventDetail){
score[event] += eventDetail[interval];
};
};
return callback(score);
})
}
function loadMenus(){
var snakebiteURL = 'http://snakebite.herokuapp.com' + '/menus',
i = 0,
max = 4,
elem,
img,
menu;
$.getJSON(snakebiteURL).success(function(data){
var menus = data.items || [],
menuGallery = $('#bentoGallery');
if(menus.length > 0){
// get random menus by shuffling filters-container
menus = menus.shuffle();
for(; i < max; i++){
menu = menus[i];
img = menu.images[0];
// for now, it's trivial but the code below is slightly ridiculous and amateur. apologies :(
// we should probably use Ember JS or a similar frontend MVC framework to work with templates for this
// -- Kelvin
elem = '<li class="cbp-item graphic identity"><a class="cbp-caption cbp-lightbox" data-title="Image" href="' + img + '"<div class="cbp-caption-defaultWrap"><img src="' + img + '" alt="" class="img-responsive"></div><div class="cbp-caption-activeWrap"><div class="cbp-l-caption-alignCenter"><div class="cbp-l-caption-body"><div class="cbp-l-caption-title">' + menu.name + ' <small>¥ ' + menu.price + '</small></div><div class="cbp-l-caption-desc"></div></div></div></div></a></li>';
menuGallery.append(elem);
};
(function ($, window, document, undefined) {
var gridContainer = $('#grid-container'),
filtersContainer = $('#filters-container');
// init cubeportfolio
gridContainer.cubeportfolio({
defaultFilter: '*',
animationType: 'rotateRoom',
gapHorizontal: 0,
gapVertical: 0,
gridAdjustment: 'responsive',
caption: 'overlayBottomAlong',
displayType: 'bottomToTop',
displayTypeSpeed: 100,
// lightbox
lightboxDelegate: '.cbp-lightbox',
lightboxGallery: true,
lightboxTitleSrc: 'data-title',
lightboxShowCounter: true,
});
// add listener for filters click
filtersContainer.on('click', '.cbp-filter-item', function (e) {
var me = $(this),
wrap;
// get cubeportfolio data and check if is still animating (reposition) the items.
if (!$.data(gridContainer[0], 'cubeportfolio').isAnimating) {
if (filtersContainer.hasClass('cbp-l-filters-dropdown')) {
wrap = $('.cbp-l-filters-dropdownWrap');
wrap.find('.cbp-filter-item').removeClass('cbp-filter-item-active');
wrap.find('.cbp-l-filters-dropdownHeader').text(me.text());
me.addClass('cbp-filter-item-active');
} else {
me.addClass('cbp-filter-item-active').siblings().removeClass('cbp-filter-item-active');
}
}
// filter the items
gridContainer.cubeportfolio('filter', me.data('filter'), function () {});
});
// activate counter for filters
gridContainer.cubeportfolio('showCounter', filtersContainer.find('.cbp-filter-item'));
})(jQuery, window, document);
};
}).fail(function(err){
console.log('ERROR', JSON.stringify(err, null, 4));
});
}
}(jQuery);
</script>
</body>
</html>