Skip to content

Commit

Permalink
サイズを変えたりした
Browse files Browse the repository at this point in the history
  • Loading branch information
na-trium-144 committed Nov 10, 2024
1 parent 0440eb8 commit 771f517
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/play/fallingWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@ function Particle(props: PProps) {
const animateDone = useRef<boolean>(false);
const angleRandom = useRef<number>(0);
const bigParam = useRef<number>(1);
const sizeParam = useRef<number>(1);
const hueParam = useRef<number>(0);
const hue =
55 - (15 * hueParam.current * Math.min(props.chain, bonusMax)) / bonusMax;
const { noteSize } = props;
const particleSize = noteSize / 6;
const particleSize = (noteSize / 4) * sizeParam.current;
useEffect(() => {
if (!animateDone.current) {
const distance = noteSize * (0.5 + Math.random() * Math.random() * 1);
Expand All @@ -245,6 +246,7 @@ function Particle(props: PProps) {
);
angleRandom.current = Math.random() * Math.random() * 120;
bigParam.current = Math.random() * 1 + 1;
sizeParam.current = Math.random() * Math.random() * 0.5 + 0.5;
hueParam.current = Math.random() * Math.random() * 1;
}
animateDone.current = true;
Expand All @@ -265,7 +267,7 @@ function Particle(props: PProps) {
>
<div
ref={ref}
className="absolute rounded-full shadow-xl shadow-yellow-500 "
className="absolute rounded-full "
style={{
background: `hsl(${hue} 100% 50%)`,
width: particleSize,
Expand Down

0 comments on commit 771f517

Please sign in to comment.