diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-06-22 01:31:18 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-06-22 01:31:18 +0200 |
| commit | ec598c5bbc692fc473fbed411d05b07d137b8e14 (patch) | |
| tree | 4d0735f5d270ae7b8a54781a28c278517450edc0 /client/util.js | |
| parent | 50f562afc47adfb222f18375236becab6af6f948 (diff) | |
more css :)
Diffstat (limited to 'client/util.js')
| -rw-r--r-- | client/util.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/util.js b/client/util.js index 0fe17e9..6b1e274 100644 --- a/client/util.js +++ b/client/util.js @@ -6,5 +6,12 @@ const isDesktop = ! isMobile document.body.classList.add(isDesktop ? 'desktop' : 'mobile') -export default { isIphone, isIpad, isAndroid, isMobile, isDesktop } +function randint(n){ return (Math.random()*n)|0 } +function randrange(a,b){ return (Math.random()*(b-a)+a)|0 } +function choice(a){ return a[randint(a.length)] } + +export { + isIphone, isIpad, isAndroid, isMobile, isDesktop, + randint, randrange, choice, +} |
