Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

3-2-[fix, refactor] [FE] [메인] 배경에 반짝이는 별 레이어를 생성한다. #35

Merged
merged 8 commits into from
Nov 21, 2022
15 changes: 8 additions & 7 deletions frontend/src/components/StarLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ const StarLayer = () => {

return (
<Container>
{Array.from({ length: 15 }).map((_, i) => {
const randomSize = Math.random();
{Array.from({ length: 15 }, (_, i) => {
const randomConstant = Math.random();
return (
<Stars
key={i}
style={{
animationDuration: `${randomSize * 5 + 5}s`,
animationDelay: `${randomSize * 5}s`,
animationDuration: `${randomConstant * 5 + 5}s`,
animationDelay: `${randomConstant * 5}s`,
}}
>
{Array.from({ length: 20 }).map((_, j) => (
{Array.from({ length: 20 }, (_, j) => (
<Star
key={j}
style={{
backgroundColor: `${COLORS[j % COLORS.length]}`,
width: `${randomSize * 3 + 1}px`,
height: `${randomSize * 3 + 1}px`,
width: `${randomConstant * 3 + 1}px`,
height: `${randomConstant * 3 + 1}px`,
top: `${Math.random() * height}px`,
left: `${Math.random() * width}px`,
}}
Expand All @@ -67,6 +67,7 @@ const Container = styled.div`
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
`;

const twinkle = keyframes`
Expand Down