diff options
| author | Catalina Vallejos <kintrala@me.com> | 2017-08-23 19:57:53 +0100 |
|---|---|---|
| committer | Catalina Vallejos <kintrala@me.com> | 2017-08-23 19:57:53 +0100 |
| commit | 0e494854248bb5b76839fa9c73b07f5e864248a4 (patch) | |
| tree | 86e290cfcc6c721ce819a3750a4a64895b8557bd /public/assets/site.js | |
| parent | d4efcefac91f6e596625fbe9d0049985a4e09789 (diff) | |
| parent | eddee7c150388106979c16221b3ee106e53b1990 (diff) | |
commit with merge conflict
Diffstat (limited to 'public/assets/site.js')
| -rw-r--r-- | public/assets/site.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/public/assets/site.js b/public/assets/site.js index ff109da..61b7da6 100644 --- a/public/assets/site.js +++ b/public/assets/site.js @@ -1,4 +1,10 @@ -var site = {} +var isIphone = !! (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) +var isIpad = !! (navigator.userAgent.match(/iPad/i)) +var isAndroid = !! (navigator.userAgent.match(/Android/i)) +var isMobile = isIphone || isIpad || isAndroid +var isDesktop = ! isMobile + +document.body.classList.add(isDesktop ? 'desktop' : 'mobile') $(function(){ $.getJSON('/db.json', function(data){ @@ -27,10 +33,25 @@ function bind(){ $('.close').click( function(){ close_modals() }) + $('.page, #entry').click( function(){ + close_modals() + }) + $('.inner').click( function(e){ + e.stopPropagation() + }) $('.tag').click( function(){ var tag = $(this).html() filter_by_tag(tag) }) + var gallery = new Flickity( "#testimonials", { + cellSelector: '.testimonial', + wrapAround: true, + prevNextButtons: true, + pageDots: false, + setGallerySize: false, + draggable: true, + autoPlay: 5000, + }) } function build(){ $('.cell').each( function(){ @@ -74,4 +95,4 @@ function close_modals(){ $('body').removeClass('entry').removeClass('about') } -function newlineToBr(s){ return s.replace(/\n/g,'<br>') }
\ No newline at end of file +function newlineToBr(s){ return s.replace(/\n/g,'<br>') } |
