summaryrefslogtreecommitdiff
path: root/public/assets/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/app.js')
-rw-r--r--public/assets/js/app.js79
1 files changed, 54 insertions, 25 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js
index 35a162c..b8992ea 100644
--- a/public/assets/js/app.js
+++ b/public/assets/js/app.js
@@ -1,31 +1,60 @@
-var is_iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i));
-var is_ipad = (navigator.userAgent.match(/iPad/i));
-var is_android = (navigator.userAgent.match(/Android/i))
-var is_mobile = is_iphone || is_ipad || is_android;
-$(function() {
+var app = (function() {
+ var app = {}
+
+ app.init = function() {
+ app.bind()
+ app.build()
+ app.ready()
+
+ app.iscroll_options = {
+ mouseWheel: true,
+ scrollbars: true,
+ click: is_android,
+ }
+ }
+
+ app.bind = function() {
if (is_mobile) {
- $("html").addClass("mobile");
- } else {
- $("html").addClass("desktop");
+ document.addEventListener('touchmove', function(e) {
+ e.preventDefault()
+ })
+ FastClick.attach(document.body)
}
-});
+ }
+
+ app.build = function(data) {
+ app.nav = new NavView()
+ }
+
+ app.ready = function() {
+ setTimeout(function(){
+ $("body").removeClass("loading")
+ }, 20)
+ app.view = null
+ console.log("launched")
+ }
+
+ return app
+
+})()
+
+app.init()
+
$(".cell, .next").css({ 'height': ($(".top").height() + 'px') });
$('.top').flickity({
- cellAlign: 'left',
- contain: true,
- pageDots: false,
- wrapAround: true,
- arrowShape: {
- x0: 10,
- x1: 35,
- y1: 25,
- x2: 40,
- y2: 25,
- x3: 15
- }
-});
+ cellAlign: 'left',
+ contain: true,
+ pageDots: false,
+ wrapAround: true,
+ arrowShape: {
+ x0: 10,
+ x1: 35, y1: 25,
+ x2: 40, y2: 25,
+ x3: 15
+ }
+})
$(".previous, .next").css({ 'height': ($(".top").height() + 'px') });
@@ -33,8 +62,8 @@ $('.index').click(function() {
$('body').toggleClass('navopen');
});
-$('.item').click(function() {
- $('body').removeClass('navopen');
+$('.item').click( function(){
+ $('body').removeClass('navopen');
});
@@ -54,4 +83,4 @@ $(window).resize(function() {
$('.top').flickity('resize');
$('body').removeClass('resizing');
}, 400);
-}); \ No newline at end of file
+}) \ No newline at end of file