atmosphere explorer

feat: better front page random

authored by olaren.dev and committed by

Tangled ce16f8df ca7898f9

+8 -1
+8 -1
src/views/home.tsx
··· 64 64 { did: "did:plc:vafqb3yhndyawabm2t2zhw5z", handle: "neko.moe.observer" }, 65 65 ]; 66 66 67 - const profiles = [...allExampleProfiles].sort(() => Math.random() - 0.5).slice(0, 3); 67 + for (let i = allExampleProfiles.length - 1; i > 0; i--) { 68 + const j = Math.floor(Math.random() * (i + 1)); 69 + [allExampleProfiles[i], allExampleProfiles[j]] = [ 70 + allExampleProfiles[j], 71 + allExampleProfiles[i], 72 + ]; 73 + } 74 + const profiles = allExampleProfiles.slice(0, 3); 68 75 69 76 return ( 70 77 <div class="flex w-full flex-col gap-5 px-2 wrap-break-word">