Skip to content

Conversation

@Chu03
Copy link

@Chu03 Chu03 commented Apr 8, 2025

No description provided.

Copy link

@ff1451 ff1451 left a comment

Choose a reason for hiding this comment

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

늦은 시간까지 과제하시느랴 수고하셨습니다.

});


document.getElementById('count-input').addEventListener('input', () => {
Copy link

Choose a reason for hiding this comment

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

const input = document.getElementById('count-input');
이미 상단에서 DOM 요소를 가져왔으니 또 가져올 필요는 없어 보여요

Copy link

Choose a reason for hiding this comment

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

document.getElementById('count-input').addEventListener('input', (e) => {
  const count = parseInt(e.target.value) || 0;
  totalPrice.textContent = `총 금액: ${count * 1000}원 (1장당 1,000원)`;
});

처럼 event 객체를 이용해서 사용할 수도 있어요 자주 사용되는 방식이니 공부해두시면 좋을 것 같아요

Comment on lines +72 to +81
const winning = displayWinningNumbers();

for (let i = 0; i < count; i++) {
const numbers = RandomNumber();
const matchCount = checkMatches(numbers, winning);
const row = createLotto(numbers);

const resultText = document.createElement('p');
resultText.className = 'result-badge';
resultText.textContent = `결과: ${matchCount}개 일치` + (matchCount === 6 ? ' - 당첨!' : '');
Copy link

Choose a reason for hiding this comment

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

지금 구조에서는 구매하기 버튼이 이번주 당첨번호 생성, 내가 구매한 번호 생성을 모두 수행하는 것으로 보여요
기능 명세상으로는 번호 생성하기 버튼을 클릭시 이번주 당첨번호가 생성되고 당첨 여부를 검증하니 수정해보면 좋을 것 같아요

Comment on lines +5 to +8
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
Copy link

Choose a reason for hiding this comment

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

화면 배율에 따라 로또를 많이 구매했을때 잘리는 현상이 발생할 수 있을 것 같아요

Comment on lines +64 to +76
.ball-yellow {
display: flex;
justify-content: center;
align-items: center;
width: 45px;
height: 45px;
border-radius: 50%;
font-weight: bold;
margin: 5px;
font-size: 18px;
color: white;
background-color: #fbc400;
}
Copy link

Choose a reason for hiding this comment

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

공의 색상을 지정하는 부분과 그외의 공통적인 부분을 분리해서 적용한다면 중복되는 코드를 줄일 수 있어요

box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
text-align: center;
box-sizing: border-box;
margin-top: 0;
Copy link

Choose a reason for hiding this comment

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

부모 요소에서 margin을 이미 적용해주었기에 중복되는 css예요

const MyNumber = document.createElement('p');
MyNumber.textContent = "내가 구매한 번호:";
winningArea.appendChild(MyNumber);
winningArea.style.display = 'block';
Copy link

Choose a reason for hiding this comment

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

지난주 pr에 답변 드렸습니다~ 확인해주세요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants