Skip to content

Commit 10df5af

Browse files
committed
feat: update algo for bubbles
1 parent 0ebc725 commit 10df5af

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pwa/components/con/speakers/SpeakerImage2025.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ interface SpeakerImageProps {
1111
}
1212

1313
function nameToAngle(name: string): number {
14+
const nameToHash = name.substring(0, 12);
1415
let hash = 0;
15-
for (let i = 0; i < name.length; i++) {
16-
hash += name.charCodeAt(i);
16+
for (let i = 0; i < nameToHash.length; i++) {
17+
hash += nameToHash.charCodeAt(i);
1718
}
1819
let angle = hash % 360;
20+
console.log(nameToHash);
21+
console.log(angle);
1922

2023
const forbiddenZones: [number, number][] = [
2124
[60, 120],
@@ -42,7 +45,6 @@ function nameToSize(name: string, min = 10, max = 30) {
4245
}
4346

4447
function cssPositionOnCircle(angle: number) {
45-
// angle en radians
4648
return {
4749
x: `calc(50% + ${Math.cos(angle) * 50}%)`,
4850
y: `calc(50% + ${Math.sin(angle) * 50}%)`,

0 commit comments

Comments
 (0)