Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
77c2296
docs: todo list 정리
usageness Feb 22, 2022
b90e001
test: model 테스트 케이스 구현
usageness Feb 22, 2022
c0ad6c3
feat: Lotto, LottoGame 모델 구현
usageness Feb 22, 2022
a0cb9ff
feat: 마크업, css 적용
usageness Feb 22, 2022
4841ed6
feat: LottoGame controller 구현
usageness Feb 22, 2022
272bbc6
refactor: DOM 요소, 에러 메시지 상수화
usageness Feb 22, 2022
6f1cb92
chore: eslint, prettier 적용
usageness Feb 22, 2022
3084723
chore: lint 설정으로 인한 변경사항
juunzzi Feb 22, 2022
1058e9b
feat: 정상적인 금액을 입력하면, 구매한 로또가 보인다
juunzzi Feb 22, 2022
988cb4a
feat: 번호 보기를 클릭하면, 로또 보기 상태가 변경된다
juunzzi Feb 22, 2022
0121c1a
refactor: 상수화 진행, align-state 의 dataset property를 변경
juunzzi Feb 22, 2022
e09d6ce
chore: 최신버전의 ecmaVersion으로 변경
juunzzi Feb 23, 2022
521d5f7
style: converter 스타일 코드를 추가
juunzzi Feb 23, 2022
af546a4
chore: eslint 설정 변경으로 인한 수정사항
juunzzi Feb 23, 2022
d91222e
refactor: onSubmitChargeInputForm 함수의 로직을 다른 메소드로 정의
juunzzi Feb 23, 2022
42e1984
refactor: converter css 파일에서 레이아웃 코드를 분리
juunzzi Feb 23, 2022
01be1a1
refactor: LottoGameModel의 숫자 리터럴 상수화, LottoModel의 주석을 제거
juunzzi Feb 23, 2022
a6e9dd3
refactor: LottoGameModel에서 불필요한 메소드 삭제, 메소드의 네이밍 수정
juunzzi Feb 23, 2022
0c6252a
test: 모델의 변경사항을 테스트 파일에 적용 및 상수화 진행
juunzzi Feb 23, 2022
a5f2a45
docs: todo.md 수정
juunzzi Feb 24, 2022
6851773
refactor: import css 문에 확장자 추가
juunzzi Feb 24, 2022
b4f543c
refactor: getter 함수는 복사된 값을 리턴, createLottoList의 로직을 수정, 에레메세지 텍스트 변경
juunzzi Feb 24, 2022
ae4be3c
refactor: LOTTO_NUMBER_LENGTH 상수 이름 변경
usageness Feb 25, 2022
8184bb9
refactor: createLottoList 로직의 for문을 map()으로 대체
usageness Feb 26, 2022
5b0faf9
chore: github pages 사용을 위한 세팅
usageness Feb 26, 2022
a2a8e71
refactor: randomNumber() 의 호출 횟수를 줄이도록 변경
usageness Feb 26, 2022
f3568c2
refactor: isValidNumber 로직 검색 효율 개선
usageness Feb 26, 2022
b9b9997
refactor: 필요없는 메서드 일원화
usageness Feb 26, 2022
b4724f9
chore: 깊은 복사 test 문법 변경
usageness Feb 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
env: {
browser: true,
es2021: true,
es6: true,
node: true,
},
extends: ['tui', 'prettier'],
parserOptions: {
sourceType: 'module',
/** spread eslint error - 최신버젼의 ecmaVersion*/
ecmaVersion: 'latest',
},
rules: {
'no-var': 'error',
'max-depth': ['error', 2],
'max-lines-per-function': ['error', 15],
'no-console': 'warn',
'no-param-reassign': 'error',
'padding-line-between-statements': 0,
'newline-before-return': 0,
'no-undefined': 0,
'no-constant-condition': 0,
'no-unused-private-class-members': 0,
},
};
19 changes: 19 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// NHN convention
module.exports = {
singleQuote: true,
printWidth: 100,
tabWidth: 2,
useTabs: false,
semi: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'es5',
arrowParens: 'always',
endOfLine: 'lf',
bracketSpacing: true,
jsxBracketSameLine: false,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
vueIndentScriptAndStyle: false,
};
21 changes: 21 additions & 0 deletions docs/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 투두 리스트

<!--
로또 구입 금액을 입력하면, 금액에 해당하는 로또를 발급해야 한다.
로또 1장의 가격은 1,000원이다.
소비자는 자동 구매를 할 수 있어야 한다.
번호 보기 토글 버튼을 클릭해 로또 번호를 볼 수 있어야 한다.
-->

**로또 모델**

- [✅] 로또 모델에 숫자 배열을 인자로 넣어서 인스턴스를 생성할 수 있다.
- [✅] 로또 모델의 배열에 들어갈 값은 1이상 45이하의 숫자여야 한다.
- [✅] 로또 모델에 들어갈 배열의 길이는 6이어야 한다.
- [✅] 로또 모델의 번호와 당첨 번호를 비교하여 등수를 반환할 수 있어야 한다.

**로또 게임 모델**

- [✅] 로또 게임 모델에 금액이 정상적으로 입력되면, 구매할 수 있는 로또의 수를 반환할 수 있어야 한다.
- [✅] 금액은 1000이상의 숫자여야한다.
- [✅] 로또 번호 배열들을 입력하여 로또 모델을 생성하고 관리할 수 있어야 한다.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

여기 있는 내용들은 모두 '나중에 할 일'을 정리해두신 거죠? 각각에 checked가 되어있어서 이미 구현하신줄 알았네요...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

앗 맞습니다 😅 step2 내용까지 실수로 체크 해버렸네요..

70 changes: 59 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,65 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<title>🎱 행운의 로또</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<head>
<meta charset="UTF-8" />
<title>🎱 행운의 로또</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<div id="app">
<h1 class="header-title">🎱 행운의 로또</h1>
<section id="charge-input-section" aria-labelledby="charge-input-section-title">
<h1 id="charge-input-section-title" hidden>금액을 입력하는 섹션입니다.</h1>
<p>구입할 금액을 입력해주세요</p>
<form id="charge-input-form">
<input id="charge-input" type="number" placeholder="금액" />
<button id="charge-button">구입</button>
</form>
</section>

<body>
<div id="app">
<h1>🎱 행운의 로또</h1>
</div>
<script type="module" src="./src/js/index.js"></script>
</body>
<section id="lotto-section" aria-labelledby="lotto-section-title">
<h1 id="lotto-section-title" hidden>구매한 로또를 확인하는 섹션입니다.</h1>
<div class="lotto-wrapper">
<span id="purchased-message"></span>
<div id="lotto-container" data-visible-state="false"></div>
</div>
<div id="align-converter-container">
<label for="align-converter">
<span>번호 보기</span>
<input id="align-converter" type="checkbox" class="converter" />
<span class="checkmark">
<span class="circle"></span>
</span>
</label>
</div>
</section>

<section id="win-number-input-section" aria-labelledby="win-number-input-title">
<h1 id="win-number-input-title" hidden>당첨 번호 입력 섹션</h1>
<p>지난 주 당첨번호 6개와 보너스 번호 1개를 입력해주세요.</p>
<form id="win-number-input-form">
<div class="win-number-input-wrapper">
<div>
<p>당첨 번호</p>
<input id="win-number-1" type="number" />
<input id="win-number-2" type="number" />
<input id="win-number-3" type="number" />
<input id="win-number-4" type="number" />
<input id="win-number-5" type="number" />
<input id="win-number-6" type="number" />
</div>

<div class="bonus-number-wrapper">
<p>보너스 번호</p>
<input id="bonus-number" type="number" />
</div>
</div>

<button id="result-button">결과 확인하기</button>
</form>
</section>
</div>
<script type="module" src="./src/index.js"></script>
</body>
</html>
Loading