diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-03 17:19:51 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-03 17:19:51 +0100 |
| commit | 966e27c7418d6e188ea4b1f651a5e6c67495b765 (patch) | |
| tree | fd48ccddfb8af56e544d99f42dce4fe7fd3a7b7c /site/assets/js/app/site.js | |
| parent | 6062728b63e6496709f2e552542c220f4f16e79c (diff) | |
base css
Diffstat (limited to 'site/assets/js/app/site.js')
| -rw-r--r-- | site/assets/js/app/site.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/site/assets/js/app/site.js b/site/assets/js/app/site.js new file mode 100644 index 00000000..04c0c495 --- /dev/null +++ b/site/assets/js/app/site.js @@ -0,0 +1,22 @@ +const isiPhone = !!((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) +const isiPad = !!(navigator.userAgent.match(/iPad/i)) +const isAndroid = !!(navigator.userAgent.match(/Android/i)) +const isMobile = isiPhone || isiPad || isAndroid +const isDesktop = !isMobile + +const htmlClassList = document.body.parentNode.classList +htmlClassList.add(isDesktop ? 'desktop' : 'mobile') + +var site = (function(){ + var site = {} + site.init = function(){ + site.build() + } + site.build = function(){ + const paras = document.querySelectorAll("section p") + if (paras.length) { + paras[0].classList.add('first_paragraph') + } + } + site.init() +})()
\ No newline at end of file |
