diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-08-23 15:07:32 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-08-23 15:07:32 +0200 |
| commit | 2b1fe8184068141677c2141eaea1b3dde7447dbf (patch) | |
| tree | 8eb8dea131b3195173d8b24b6c94b325f328c363 /public/assets/site.js | |
| parent | c6253d35a56b6868e04dcac62f9e53af16f2aaf1 (diff) | |
some styling
Diffstat (limited to 'public/assets/site.js')
| -rw-r--r-- | public/assets/site.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/public/assets/site.js b/public/assets/site.js index ff109da..215df11 100644 --- a/public/assets/site.js +++ b/public/assets/site.js @@ -27,6 +27,12 @@ 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) @@ -74,4 +80,11 @@ 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>') } +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')
\ No newline at end of file |
