diff --git a/README.md b/README.md
index 502436de..78eb3d80 100644
--- a/README.md
+++ b/README.md
@@ -39,9 +39,9 @@
## ๐ฏ ์๊ตฌ์ฌํญ
-- [ ] todo list์ todoItem์ ํค๋ณด๋๋ก ์
๋ ฅํ์ฌ ์ถ๊ฐํ๊ธฐ
-- [ ] todo list์ ์ฒดํฌ๋ฐ์ค๋ฅผ ํด๋ฆญํ์ฌ complete ์ํ๋ก ๋ณ๊ฒฝ (li tag ์ completed class ์ถ๊ฐ, input ํ๊ทธ์ checked ์์ฑ ์ถ๊ฐ)
-- [ ] todo list์ x๋ฒํผ์ ์ด์ฉํด์ ํด๋น ์๋ฆฌ๋จผํธ๋ฅผ ์ญ์
+- [x] todo list์ todoItem์ ํค๋ณด๋๋ก ์
๋ ฅํ์ฌ ์ถ๊ฐํ๊ธฐ
+- [x] todo list์ ์ฒดํฌ๋ฐ์ค๋ฅผ ํด๋ฆญํ์ฌ complete ์ํ๋ก ๋ณ๊ฒฝ (li tag ์ completed class ์ถ๊ฐ, input ํ๊ทธ์ checked ์์ฑ ์ถ๊ฐ)
+- [x] todo list์ x๋ฒํผ์ ์ด์ฉํด์ ํด๋น ์๋ฆฌ๋จผํธ๋ฅผ ์ญ์
- [ ] todo list๋ฅผ ๋๋ธํด๋ฆญํ์ ๋ input ๋ชจ๋๋ก ๋ณ๊ฒฝ (li tag ์ editing class ์ถ๊ฐ) ๋จ ์ด๋ ์์ ์ ์๋ฃํ์ง ์์ ์ํ์์ escํค๋ฅผ ๋๋ฅด๋ฉด ์์ ๋์ง ์์ ์ฑ๋ก ๋ค์ view ๋ชจ๋๋ก ๋ณต๊ท
- [ ] todo list์ item๊ฐฏ์๋ฅผ countํ ๊ฐฏ์๋ฅผ ๋ฆฌ์คํธ์ ํ๋จ์ ๋ณด์ฌ์ฃผ๊ธฐ
- [ ] todo list์ ์ํ๊ฐ์ ํ์ธํ์ฌ, ํด์ผํ ์ผ๊ณผ, ์๋ฃํ ์ผ์ ํด๋ฆญํ๋ฉด ํด๋น ์ํ์ ์์ดํ
๋ง ๋ณด์ฌ์ฃผ๊ธฐ
diff --git a/src/css/style.css b/css/style.css
similarity index 100%
rename from src/css/style.css
rename to css/style.css
diff --git a/index.html b/index.html
index 13a02fdb..162d063e 100644
--- a/index.html
+++ b/index.html
@@ -1,10 +1,10 @@
-
+
์ด๋ฒคํธ - TODOS
-
+
@@ -22,7 +22,7 @@
TODOS
์ด 0 ๊ฐ
+
diff --git a/src/App.js b/src/App.js
new file mode 100644
index 00000000..993f530b
--- /dev/null
+++ b/src/App.js
@@ -0,0 +1,18 @@
+import { ToDoInput,ToDoList } from "./component/index.js";
+class App {
+ $todoInput;
+ $todoList;
+ constructor(){
+ const toDoInputTarget = document.querySelector("#new-todo-title");
+ const toDoListTarget = document.querySelector('#todo-list');
+ this.$todoInput = new ToDoInput(toDoInputTarget,{
+ addToDoItem: itemTitle => this.addToDoItem(itemTitle)
+ });
+ this.$todoList = new ToDoList(toDoListTarget);
+ }
+ addToDoItem(itemTitle){
+ this.$todoList.addItem(itemTitle);
+ }
+}
+
+const app = new App();
\ No newline at end of file
diff --git a/src/component/ToDoInput.js b/src/component/ToDoInput.js
new file mode 100644
index 00000000..615d275a
--- /dev/null
+++ b/src/component/ToDoInput.js
@@ -0,0 +1,37 @@
+export class ToDoInput {
+ state;
+ $target;
+ props;
+ constructor(target,props){
+ this.$target = target;
+ this.props = props;
+ this.state = {
+ toDoItem : ""
+ }
+ this.initEventListener();
+ }
+
+ render () {
+
+ }
+
+ initEventListener () {
+ this.$target.addEventListener('input',({target})=>{
+ this.setState({toDoItem: target.value})
+ })
+ this.$target.addEventListener('keydown',({key})=>{
+ if(key === "Enter") {
+ this.props.addToDoItem(this.state.toDoItem);
+ this.reset();
+ };
+ })
+ }
+
+ setState (payload) {
+ this.state={...this.state,...payload}
+ }
+ reset(){
+ this.setState({toDoItem:""});
+ this.$target.value = "";
+ }
+}
\ No newline at end of file
diff --git a/src/component/ToDoList.js b/src/component/ToDoList.js
new file mode 100644
index 00000000..bc1b3aa4
--- /dev/null
+++ b/src/component/ToDoList.js
@@ -0,0 +1,74 @@
+import { TODO_STATE } from "../constant/index.js";
+const getStateClass = (state) => {
+ return state === TODO_STATE.COMPLETED ? 'class="completed"' :
+ state === TODO_STATE.EDITING ? 'class="editing"' :
+ '';
+ }
+export class ToDoList {
+ state;
+ $target;
+ constructor(target){
+ this.$target = target;
+ this.setState({
+ items:[]
+ })
+ }
+ render(){
+ const {items} = this.state;
+ this.$target.innerHTML = items.map(({state,title})=>`
+
+
+
+
+
+
+ ${ state === TODO_STATE.EDITING ? `` : '' }
+
+ `).join('')
+
+ }
+ initEventListener(){
+ this.addToggleEvent();
+ this.removeToggleEvent();
+
+ }
+
+ addToggleEvent(){
+ const toggleComponents = this.$target.querySelectorAll('.toggle');
+ const {items} = this.state;
+ toggleComponents.forEach((element,idx) => {
+ element.addEventListener('change',(({target})=>{
+ const todoItem = items[idx];
+ todoItem.state = target.checked ? TODO_STATE.COMPLETED : TODO_STATE.TODO
+ items[idx] = {...todoItem};
+ this.setState({items:[...items]});
+ })
+ )});
+ }
+
+ removeToggleEvent(){
+ const destroyComponents = this.$target.querySelectorAll('.destroy');
+ const {items} = this.state;
+ destroyComponents.forEach((element,idx)=>{
+ element.addEventListener('click',()=>{
+ items.splice(idx,1);
+ this.setState({items:[...items]})
+ })
+ })
+ }
+
+ setState(payload){
+ this.state = {...this.state, ...payload};
+ this.render();
+ this.initEventListener();
+ }
+ addItem(itemTitle){
+ this.setState({
+ items: [...this.state.items,
+ {
+ title:itemTitle, state: TODO_STATE.TODO
+ }]
+ })
+ }
+}
+
diff --git a/src/component/index.js b/src/component/index.js
new file mode 100644
index 00000000..6b33ca06
--- /dev/null
+++ b/src/component/index.js
@@ -0,0 +1,2 @@
+export {ToDoList} from "./ToDoList.js"
+export {ToDoInput} from "./ToDoInput.js"
\ No newline at end of file
diff --git a/src/constant/index.js b/src/constant/index.js
new file mode 100644
index 00000000..2c071e84
--- /dev/null
+++ b/src/constant/index.js
@@ -0,0 +1,5 @@
+export const TODO_STATE = {
+ TODO: 0,
+ COMPLETED: 1,
+ EDITING: 2,
+ }
\ No newline at end of file
diff --git a/src/service/index.js b/src/service/index.js
new file mode 100644
index 00000000..e69de29b
diff --git a/src/storage/index.js b/src/storage/index.js
new file mode 100644
index 00000000..e69de29b