From f79f9af5792b683fcef6f52175680a1cdb984943 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 26 Jun 2017 14:48:04 +0200 Subject: adding emoji --- client/lib/util.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'client/lib/util.js') diff --git a/client/lib/util.js b/client/lib/util.js index c6df6ec..7bca506 100644 --- a/client/lib/util.js +++ b/client/lib/util.js @@ -12,9 +12,11 @@ document.body.classList.add(isMobile ? 'mobile' : 'desktop') const browser = { isIphone, isIpad, isMobile, isDesktop } function clamp(n,a,b){ return n { e.preventDefault(); f(e.touches[0]) }} +function randint(n){ return Math.floor(Math.random() * n) } +function randrange(a,b) { return Math.random() * (b-a) + a } function requestAudioContext (fn) { if (isMobile) { @@ -59,5 +61,10 @@ function requestAudioContext (fn) { } } -export { choice, mod, clamp, browser, firstTouch, requestAudioContext } +export { + choice, + randint, randrange, + mod, clamp, + browser, firstTouch, requestAudioContext +} -- cgit v1.2.3-70-g09d2