Skip to content

Commit

Permalink
fix: use another frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardocasares committed Oct 31, 2020
1 parent 4389bea commit f8e286b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Logo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ type Icon = {

const Icon = styled(Radio)<Icon>`
path {
color: ${({ alpha }) => `rgba(0, 112, 243, ${alpha})`};
color: ${({ alpha }) => `rgba(0, 112, 243, ${alpha || 1})`};
}
`;

export const Logo = () => {
const freq = useFrequency();
const alpha = mapValueToRange(freq, [0, 255], [0, 1]);

return <Icon alpha={alpha || 1} />;
return <Icon alpha={alpha} />;
};
2 changes: 1 addition & 1 deletion src/lib/hooks/useFrequency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function useFrequency() {

const update = () => {
analyser.getByteFrequencyData(frequencyData);
setState(frequencyData[1]);
setState(frequencyData[3]);
return requestAnimationFrame(update);
};

Expand Down

1 comment on commit f8e286b

@vercel
Copy link

@vercel vercel bot commented on f8e286b Oct 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.