diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-06 00:59:39 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-06 00:59:39 +0200 |
| commit | d3fcd1212f7214b12b04a83d03dfb129c5fbb0a4 (patch) | |
| tree | b9cede8c8b245d5dc5d3ed23d8879e603af82809 /app/client/util/index.js | |
| parent | 8c8e2e08d2ae89ba18ca05bab446e4642798dce2 (diff) | |
pix2wav paths
Diffstat (limited to 'app/client/util/index.js')
| -rw-r--r-- | app/client/util/index.js | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/app/client/util/index.js b/app/client/util/index.js index a811dcf..4ce1245 100644 --- a/app/client/util/index.js +++ b/app/client/util/index.js @@ -2,17 +2,13 @@ import * as sort from './sort' import * as format from './format' import * as maths from './math' -export { - sort, - ...maths, - ...format, -} +import './hidpi-canvas' -export const is_iphone = !!((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) -export const is_ipad = !!(navigator.userAgent.match(/iPad/i)) -export const is_android = !!(navigator.userAgent.match(/Android/i)) -export const is_mobile = is_iphone || is_ipad || is_android -export const is_desktop = ! is_mobile; +const is_iphone = !!((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) +const is_ipad = !!(navigator.userAgent.match(/iPad/i)) +const is_android = !!(navigator.userAgent.match(/Android/i)) +const is_mobile = is_iphone || is_ipad || is_android +const is_desktop = ! is_mobile; const htmlClassList = document.body.parentNode.classList htmlClassList.add(is_desktop ? 'desktop' : 'mobile') @@ -20,9 +16,7 @@ htmlClassList.remove('loading') // window.debug = false -document.body.style.backgroundImage = 'linear-gradient(' + (randint(40)+40) + 'deg, #fde, #ffe)' - -export const allProgress = (promises, progress_cb) => { +const allProgress = (promises, progress_cb) => { let d = 0 progress_cb(0, 0, promises.length) promises.forEach((p) => { @@ -34,3 +28,13 @@ export const allProgress = (promises, progress_cb) => { }) return Promise.all(promises) } + +document.body.style.backgroundImage = 'linear-gradient(' + (maths.randint(40)+40) + 'deg, #fde, #ffe)' + +export default { + ...maths, + ...format, + sort, + allProgress, + is_iphone, is_ipad, is_android, is_mobile, is_desktop, +} |
