-
Notifications
You must be signed in to change notification settings - Fork 9
[Project1/최민석] Colors #1
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
base: main
Are you sure you want to change the base?
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.
수업에서 배운 것을 활용하려고 노력하신 게 잘 보였던 코드였습니다. 또 원본 프로젝트를 유심히 살펴보신 것도 인상깊었네요 ㅎㅎ
코드리뷰가 익숙치 않아서 실수한 점이 있을 수도 있으니 자유롭게 말씀해주세요😀
$main.className = "main-container"; | ||
$target.appendChild($main); | ||
|
||
let ColorListIndex = 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.
사소한 부분이지만 자바스크립트 변수 네이밍 컨벤션은 camelCase니까 colorListIndex
로 하면 어떨까요?ㅎㅎ
if (ColorListIndex > COLOR_LIST.length - 1) { | ||
ColorListIndex = 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.
고양이 사진 검색기에서도 나왔던 패턴이군요! 저는 랜덤 컬러를 랜덤으로 만드는 것으로 구현했는데 민석님은 원본 프로젝트를 꼼꼼히 살펴보시고 정해진 패턴대로 움직인다는 것을 파악하셨네요 👍👍👍
import App from "./components/App.js"; | ||
const $app = document.querySelector("#App"); |
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.
eslint에서는 import 라인 뒤에 new line을 넣도록 권장하고 있는데 한번 참고하시면 좋을 것 같습니다ㅎㅎ
@keyframes colorChange { | ||
from { | ||
color: #000000; | ||
} | ||
to { | ||
color: #ffffff; | ||
} | ||
} |
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.
저는 setInterval로 구현했는데 역시 CSS잘알이셔서 애니메이션을 활용하셨군요!! 배워갑니다👍👍👍
<link rel="stylesheet" href="./assets/reset.css" /> | ||
<link rel="stylesheet" href="./assets/index.css" /> |
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.
전에 동영팀 스크럼때 reset.css 말씀해주셨던 것 같은데 이렇게 활용하는 거군요ㅎㅎ배워갑니다👍
const secondColor = randHexColorCode(); | ||
const nextBackgroundColor = `background: linear-gradient(to right, ${firstColor}, ${secondColor});`; | ||
colorText.setState({ firstColor, secondColor }); | ||
$main.style = nextBackgroundColor; |
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.
$main
의 스타일을 고치는 부분도 setState로 처리해볼 수 있을 것 같은데 어떻게 생각하시나요?$main
의 스타일(style) 객체 전체를nextBackgroundColor
로 할당하는 것보다style.background = linear-gradient(to right, ...)
와 같이 해당하는 것만 바꾸는 게 안전할 것 같다는 생각이 듭니다.
Uh oh!
There was an error while loading. Please reload this page.