diff options
| author | Adam Soltys <[email protected]> | 2023-11-20 09:17:24 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-11-20 09:17:28 -0800 |
| commit | ee8d15697a3b758b8f26d7074edf017b3db6d480 (patch) | |
| tree | a1539462f7b7b98ace6a02c0ef767be9e5fc1b46 /src | |
| parent | 8daf9228c5ef0834611c5ee75c60daac034f3b44 (diff) | |
| download | coinos-ui-ee8d15697a3b758b8f26d7074edf017b3db6d480.tar.gz coinos-ui-ee8d15697a3b758b8f26d7074edf017b3db6d480.zip | |
randomize locations
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/LocationsMap.svelte | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index a06c993b..6f84408e 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -126,8 +126,16 @@ } inview = inview.sort((a, b) => a.tags.name.localeCompare(b.tags.name)); + shuffleArray(inview); } +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]]; + } +} + let popups = {}; let counter = 0; @@ -231,16 +239,16 @@ </div> </div> - <div class="hidden lg:grid grid-cols-3 justify-items-center"> - {#each inview as m} - <button - on:click={() => select(m)} - class="text-left" - class:font-bold={m.id === inview[currentIndex]?.id} - id={`marker-${m.id}`}>{m.tags.name}</button - > - {/each} - </div> + <!-- <div class="hidden lg:grid grid-cols-3 justify-items-center"> --> + <!-- {#each inview as m} --> + <!-- <button --> + <!-- on:click={() => select(m)} --> + <!-- class="text-left" --> + <!-- class:font-bold={m.id === inview[currentIndex]?.id} --> + <!-- id={`marker-${m.id}`}>{m.tags.name}</button --> + <!-- > --> + <!-- {/each} --> + <!-- </div> --> </div> <style> |
