diff options
Diffstat (limited to 'public/assets/js/app.js')
| -rw-r--r-- | public/assets/js/app.js | 79 |
1 files changed, 54 insertions, 25 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 8a11dd8..a58854c 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -1,39 +1,68 @@ -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").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 + } }); -$('.index').click(function() { - $('body').toggleClass('navopen'); +$('.index').click( function(){ + $('body').toggleClass('navopen'); }); -$('.item').click(function() { - $('body').removeClass('navopen'); +$('.item').click( function(){ + $('body').removeClass('navopen'); }); |
