add GalleryView component

This commit is contained in:
axolotle
2021-07-07 21:28:27 +02:00
parent 635d3af584
commit a5c4cd0f51
4 changed files with 210 additions and 2 deletions
+12
View File
@@ -8,3 +8,15 @@ export function toCommaList (arr, key = 'name') {
if (!arr) return
return arr.map(item => item[key]).join(', ')
}
export function shuffle (a) {
let j, x, i
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1))
x = a[i]
a[i] = a[j]
a[j] = x
}
return a
}