aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-11-20 09:26:06 -0800
committerAdam Soltys <[email protected]>2023-11-20 09:26:06 -0800
commit3a5d21db11a2f128e5f51df9c123b7abc367c778 (patch)
tree52df486c0c06bc7e55773b49e18aad4c4e08d8ff /src/lib/utils.js
parentee8d15697a3b758b8f26d7074edf017b3db6d480 (diff)
downloadcoinos-ui-3a5d21db11a2f128e5f51df9c123b7abc367c778.tar.gz
coinos-ui-3a5d21db11a2f128e5f51df9c123b7abc367c778.zip
randomize avatars
Diffstat (limited to 'src/lib/utils.js')
-rw-r--r--src/lib/utils.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js
index 9e1066e2..9b3e5592 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -256,3 +256,11 @@ export let types = {
};
export let ease = (t) => (t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t);
+
+ export function shuffleArray(array) {
+ for (let i = array.length - 1; i > 0; i--) {
+ const j = Math.floor(Math.random() * (i + 1));
+ [array[i], array[j]] = [array[j], array[i]];
+ }
+ }
+