Skip to content

Commit d6384b8

Browse files
committed
fix(guestbook): 랜덤 렌더링 추가
1 parent 25ce932 commit d6384b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/event/homecoming/GuestbookWordCloud.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ export default function GuestbookWordCloud({ entries, isLoading, recentCount = 5
1818

1919
return entries.map((entry, idx) => {
2020
const key = entry.id ?? `${entry.wristbandSerial ?? "unknown"}-${idx}`;
21-
const top = mapToRange(Math.random(), 12, 88);
22-
const left = mapToRange(Math.random(), 10, 90);
21+
const goldenRatio = 0.61803398875;
22+
const base = Math.random() + idx * goldenRatio;
23+
const top = mapToRange(base % 1, 12, 88);
24+
const left = mapToRange((base * goldenRatio) % 1, 10, 90);
2325
const fontSize = mapToRange(Math.random(), 1.2, 3.2);
2426
const rotate = mapToRange(Math.random(), -10, 10);
2527
const opacity = mapToRange(Math.random(), 0.45, 0.95);

0 commit comments

Comments
 (0)