-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GGFE-194] 랜덤아이템 뽑기 애니메이션 #964
The head ref may contain hidden characters: "GGFE-194-\uB79C\uB364\uC544\uC774\uD15C-\uBF51\uAE30-\uC560\uB2C8\uBA54\uC774\uC158"
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와 수고많으셨습니다. 애니메이션이 이쁘네요. 이후에 애니메이션이 더 추가되는 걸까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
애니메이션 확인했습니다!! 공 잘 튀고 미리보기 자연스럽게 보여주는 효과도 예쁘네요!! 고생하셨습니다!! 👍👍
꽃가루 추가하고 다시 올리겠습니다! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
꽃가루 애니메이션 대박이네요! 완전 예쁩니다! 고생하셨습니다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컨페티 추가하니까 훨씬 뽑기 느낌나고 좋은 것 같네여 👍👍 수고하셨습니다!!! 😆
const colorList = new Map([ | ||
['BASIC', 'BASIC'], | ||
['COLOR1', 'TRANQUIL'], | ||
['COLOR2', 'BLUE GREEN'], | ||
['COLOR3', 'MIDNIGHT'], | ||
['COLOR4', 'ORANGE'], | ||
['COLOR5', 'GRASS GREEN'], | ||
['COLOR6', 'LEMON BLUE'], | ||
['COLOR7', 'DRACULA'], | ||
['COLOR8', 'MINT GREEN'], | ||
['COLOR9', 'STEEL GRAY'], | ||
['COLOR10', 'BLOOD RED'], | ||
['COLOR11', 'BLUE SKY'], | ||
['COLOR12', 'OCEAN BLUE'], | ||
['COLOR13', 'PINK BLUE'], | ||
['COLOR14', 'SUNSET PINK'], | ||
['COLOR15', 'DARK NAVY'], | ||
['COLOR16', 'ORANGE GREEN'], | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 맵의 구성요소들이 모두 string으로 되어 있는데, 나중에 변경되거나 하면 꼬일 수 있을 것 같아서 요런 식으로 앞에 key랑 value 모두 string 리터럴 타입으로 바꾸는게 더 안전할 것 같아요!
const colorList = new Map([ | |
['BASIC', 'BASIC'], | |
['COLOR1', 'TRANQUIL'], | |
['COLOR2', 'BLUE GREEN'], | |
['COLOR3', 'MIDNIGHT'], | |
['COLOR4', 'ORANGE'], | |
['COLOR5', 'GRASS GREEN'], | |
['COLOR6', 'LEMON BLUE'], | |
['COLOR7', 'DRACULA'], | |
['COLOR8', 'MINT GREEN'], | |
['COLOR9', 'STEEL GRAY'], | |
['COLOR10', 'BLOOD RED'], | |
['COLOR11', 'BLUE SKY'], | |
['COLOR12', 'OCEAN BLUE'], | |
['COLOR13', 'PINK BLUE'], | |
['COLOR14', 'SUNSET PINK'], | |
['COLOR15', 'DARK NAVY'], | |
['COLOR16', 'ORANGE GREEN'], | |
]); | |
type colors = 'BASIC' | 'COLOR1' | 'COLOR2' | 'COLOR3' | 'COLOR4' | 'COLOR5' | 'COLOR6' | 'COLOR7' | 'COLOR8' | 'COLOR9' | 'COLOR10' | 'COLOR11' | 'COLOR12' | 'COLOR13' | 'COLOR14' | 'COLOR15' | 'COLOR16'; | |
type backgrounds = 'BASIC' | 'TRANQUIL' | 'BLUE GREEN' | 'MIDNIGHT' | 'ORANGE' | 'GRASS GREEN' | 'LEMON BLUE' | 'DRACULA' | 'MINT GREEN' | 'STEEL GRAY' | 'BLOOD RED' | 'BLUE SKY' | 'OCEAN BLUE' | 'PINK BLUE' | 'SUNSET PINK' | 'DARK NAVY' | 'ORANGE GREEN'; | |
const colorList: Map<colors, backgrounds> = new Map([ | |
['BASIC', 'BASIC'], | |
['COLOR1', 'TRANQUIL'], | |
['COLOR2', 'BLUE GREEN'], | |
['COLOR3', 'MIDNIGHT'], | |
['COLOR4', 'ORANGE'], | |
['COLOR5', 'GRASS GREEN'], | |
['COLOR6', 'LEMON BLUE'], | |
['COLOR7', 'DRACULA'], | |
['COLOR8', 'MINT GREEN'], | |
['COLOR9', 'STEEL GRAY'], | |
['COLOR10', 'BLOOD RED'], | |
['COLOR11', 'BLUE SKY'], | |
['COLOR12', 'OCEAN BLUE'], | |
['COLOR13', 'PINK BLUE'], | |
['COLOR14', 'SUNSET PINK'], | |
['COLOR15', 'DARK NAVY'], | |
['COLOR16', 'ORANGE GREEN'], | |
]); | |
return ( | ||
<canvas | ||
ref={canvasRef} | ||
width={width} | ||
height={height} | ||
style={{ position: 'absolute', top: '5%', left: 0 }} | ||
/> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컨페티 터지는 위치는 공의 위치로 설정해두었어요!
const edgeColorList = [ | ||
'BASIC', | ||
'COLOR1', | ||
'COLOR2', | ||
'COLOR3', | ||
'COLOR4', | ||
'COLOR5', | ||
'COLOR6', | ||
'COLOR7', | ||
'COLOR8', | ||
'COLOR9', | ||
'COLOR10', | ||
'COLOR11', | ||
'COLOR12', | ||
'COLOR13', | ||
'COLOR14', | ||
'COLOR15', | ||
'COLOR16', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
만약에 'BASIC',
'COLOR1'
이런 값들을 타입으로 관리하게 된다면 https://stackoverflow.com/questions/44497388/typescript-array-to-string-literal-type
요런 식으로 배열로 먼저 만든 다음에 → 타입으로 바꾸어서 쓰는 방법도 있네요!
colorList 배열 자주 쓰이는 것 같은데 배열 선언해두고 import해서 쓰는것도 편할 것 같아요 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확장성 면에서 이렇게 사용하는 것이 더 편할 것 같네요! 감사합니다👍
📌 개요
💻 작업사항