diff options
| author | adamhrv <adam@ahprojects.com> | 2018-12-16 19:38:54 +0100 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2018-12-16 19:38:54 +0100 |
| commit | 23e9fef5dce8b0b15dd94713816b9d7d45f12356 (patch) | |
| tree | 3ca9ffe3adce76318450991bfc613073470b604c /site/assets/js | |
| parent | 759027d5fbfd6665082f72a3ceaeef68c2d2142e (diff) | |
| parent | 6431d06048791763f3644b3a0457cc9c4f1df6d3 (diff) | |
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'site/assets/js')
| -rw-r--r-- | site/assets/js/app/site.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/site/assets/js/app/site.js b/site/assets/js/app/site.js deleted file mode 100644 index eb6886c2..00000000 --- a/site/assets/js/app/site.js +++ /dev/null @@ -1,30 +0,0 @@ -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') - -function toArray(a) { return Array.prototype.slice.apply(a) } -function choice(a) { return a[Math.floor(Math.random()*a.length)]} - -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') - } - toArray(document.querySelectorAll('header .links a')).forEach(tag => { - if (window.location.href.match(tag.href)) { - tag.classList.add('active') - } - }) - } - site.init() -})()
\ No newline at end of file |
