-
Notifications
You must be signed in to change notification settings - Fork 9
[Project1~3/박규란] Colors, Hex Colors, Quotes #5
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.
리뷰가 늦어져서 죄송해요, 규란님..! 규란님의 깔끔하고 센스 넘치는 코드 잘 구경했습니다 🙇♀️ 랜덤 값 생성하는 함수와 모든 상태 데이터를 App.js
에서 관리하는 방식으로 구현하셨군요! 그 덕분에 굉장히 코드가 깔끔하네요! grid css도 자유자재로 잘 쓰시는 것 같아서 인상적이었습니다 👍 다음 프로젝트도 기대할게요!
colorBtn.addEventListener('click', () => { | ||
onClick() | ||
}) | ||
} |
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.
- github에 올린 파일 끝에 ⛔ 요런 모양의 아이콘이 뜨는 이유는 마지막 줄을 개행을 하지 않아서 그런 건데요. 파일 끝에는 항상 개행을 해야한다고 해요. EOL(End of Line) 혹은 EOF(End of File)라고 하더라고요. 자세한 내용은 이 링크를 참고해보셔요.
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.
오오 항상 그 의미가 뭐지?!! 하고 궁금했었는데 경희님 덕에 알아갑니다! 감사해요❤
<head> | ||
<title>Colors</title> | ||
<meta charset="utf-8"> | ||
<link rel="shortcut icon" href="picker.png"> |
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 picker = () => { | ||
const hexString = '0123456789abcdef' | ||
const pickIndex = () => Math.floor(Math.random() * 16) | ||
const hexColorCode = () => { | ||
let temp = '#' | ||
for (let i = 0; i < 6; i++){ | ||
const index = pickIndex() | ||
temp += hexString[index] | ||
} | ||
return temp; | ||
} | ||
return hexColorCode(); | ||
} |
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.
- 랜덤 색상 코드 생성하는 함수 보고 이렇게도 할 수 있구나 하고 인사이트를 얻어 갑니다! 저는 16777215까지 난수를 만들고 16진수로 바꿔주는 방식을 사용해서 6자리보다 작은 자리수의 난수가 반환되는 경우도 생기더라고요. 규란님 방식은 꼭 6자리가 나오니까 더 깔끔하게 코드 구현이 가능한 것 같네요!
new ColorBtn({ | ||
$target, | ||
onClick: () => { | ||
if (egg === 101) confirm("🎉 You've already clicked 100 times!\nDo you want to continue picking colors?") |
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 { request } from "./api.js"; | ||
|
||
export default function QuoteDetail({ target }) { | ||
const quotearea = document.createElement("div"); |
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.
변수명 quotearea
을 quoteArea
와 같이 카멜 케이스로 작성해주면 더 좋을 것 같습니다! 👍
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.
오 세심하게 봐주시다니 감사합니다! 다음엔 멋진 변수 컨벤션으로 돌아오겠습니다. 꼼꼼한 피드백 감사해요!
width: 98vw; | ||
height: 98vh; |
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.
width
와 height
를 100이 아닌 98로 지정해주신 이유가 궁금합니다, 규란님!
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.
아 저도 이 부분이 궁금한데^_ㅠ 100으로 줘버리니까 갑자기 화면이 넘치는지 스크롤이 생겨버리더라고요 도대체 왜 그런 걸까요? 경희님 이유를 아시나요..? 이 지점에서 역시나 아직 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.
🌈 Colors | 구현 화면
👩💻 구현 내용
display: grid;
속성을 이용하여 구현버튼이 클릭 될 때마다 colorPicker함수가 실행 되어 난수 값을 생성하며
이를 통해 생성된 Hex Color Code를 body 영역의 background-color 값으로 부여한다.
🌈 Hex Colors | 구현 사이트
https://hex-colors-gradient.vercel.app/
📝 Random Quotes Generator | 구현 사이트
https://random-quotes-generator-mu.vercel.app/
