MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / createParticle

Function createParticle

src/tailwind/Components/GooeyNav/GooeyNav.jsx:24–34  ·  view source on GitHub ↗
(i, t, d, r)

Source from the content-addressed store, hash-verified

22 return [distance * Math.cos(angle), distance * Math.sin(angle)];
23 };
24 const createParticle = (i, t, d, r) => {
25 let rotate = noise(r / 10);
26 return {
27 start: getXY(d[0], particleCount - i, particleCount),
28 end: getXY(d[1] + noise(7), particleCount - i, particleCount),
29 time: t,
30 scale: 1 + noise(0.2),
31 color: colors[Math.floor(Math.random() * colors.length)],
32 rotate: rotate > 0 ? (rotate + r / 20) * 10 : (rotate - r / 20) * 10
33 };
34 };
35 const makeParticles = element => {
36 const d = particleDistances;
37 const r = particleR;

Callers 1

makeParticlesFunction · 0.70

Calls 2

noiseFunction · 0.70
getXYFunction · 0.70

Tested by

no test coverage detected