-
Notifications
You must be signed in to change notification settings - Fork 11
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
[1주차] 김류원 미션 제출합니다. #10
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ const addBtn = document.querySelector('.addBtn'); | |
const TodoInput = document.querySelector('.TodoInput'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기서도 |
||
const todoList = document.querySelector('.todoList'); | ||
const todoForm = document.querySelector('.writeTodoForm'); | ||
const todoIcon = document.querySelector('.todoForm img'); | ||
|
||
|
||
function addTodo(e) { | ||
e.preventDefault(); | ||
|
@@ -20,16 +18,20 @@ function addTodo(e) { | |
|
||
todoForm.addEventListener('submit', addTodo); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
//투두 추가 함수 | ||
// 투두 추가 함수 | ||
function createTodoElement(Todo) { | ||
const listItem = document.createElement('li'); | ||
|
||
// 완료 토글 아이콘 | ||
const toggleIcon = document.createElement('img'); | ||
toggleIcon.src = './icon/notCheck.svg'; | ||
toggleIcon.src = './icon/notCheck.svg'; | ||
toggleIcon.alt = 'Toggle unComplete'; | ||
toggleIcon.classList.add('toggle-icon'); | ||
|
||
// 투두 텍스트 | ||
const todoText = document.createElement('span'); | ||
todoText.textContent = Todo; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기에서 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 변수명을 쓸 때, Todo보다 lowercamelcase 컨벤션에 맞추어 todo로 작성하는것이 좋을 것 같아요! |
||
|
||
toggleIcon.addEventListener('click', () => { | ||
listItem.classList.toggle('completed'); | ||
todoText.classList.toggle('completed-text'); | ||
|
@@ -42,10 +44,6 @@ function createTodoElement(Todo) { | |
} | ||
}); | ||
|
||
// 투두 텍스트 | ||
const todoText = document.createElement('span'); | ||
todoText.textContent = Todo; | ||
|
||
// 삭제 버튼 | ||
const deleteBtn = document.createElement('button'); | ||
deleteBtn.textContent = '삭제'; | ||
|
@@ -61,7 +59,6 @@ function createTodoElement(Todo) { | |
todoList.appendChild(listItem); | ||
} | ||
|
||
|
||
// 날짜 표시 함수 | ||
function formatDateKorean(date) { | ||
const days = ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일']; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/*라이브러리*/ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
|
@@ -11,13 +12,58 @@ | |
} | ||
|
||
/**/ | ||
|
||
.todoContainer { | ||
background-color: #f1f3ff;} | ||
header{ | ||
/**/ | ||
.container{ | ||
|
||
} | ||
/**/ | ||
header{ | ||
padding-left: 45px; | ||
|
||
height: 10vh; | ||
display: flex; | ||
align-items: center; | ||
background-color: #788bff; | ||
color: white; | ||
font-size: 2rem; | ||
box-shadow: inset 0 0 20px #7e8dea; | ||
border-bottom: 1px solid #7e8dea; | ||
|
||
} | ||
/**/ | ||
.todoContainer { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 류원님의 투투리스트에서 항목이 height을 초과하는 경우에, 컨테이너 밖으로 삐져나오게 되는 것 같아요. 이때 css의 overflow 속성을 사용하면, 컨텐츠가 컨테이너를 초과할 때 어떻게 처리할지 설정해줄 수 있을 것 같아요!! |
||
background-color: #f1f3ff; | ||
width: 50%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 모바일로 확인했을 때 너비가 너무 줄어든다는 느낌을 받았어요! |
||
height: 90vh; | ||
margin:0 auto; | ||
border-radius: 5px; | ||
padding: 30px; | ||
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5); | ||
} | ||
.todoContainer > .title { | ||
font-size: 23px; | ||
font-weight: 700; | ||
color: #788bff; | ||
} | ||
.todoContainer > #todayDate { | ||
margin-top: 5px; | ||
font-size: 13px; | ||
color:#8790ca; | ||
} | ||
/**/ | ||
.WriteForm{ | ||
width: 100%; | ||
border-radius: 10px; | ||
margin-top: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
background-color: #c3ccff; | ||
} | ||
.check_icon { | ||
width: 20px; | ||
height: 20px; | ||
margin: 0 15px 0 0px; | ||
fill: #788bff; | ||
|
||
|
||
|
||
.completed-text { | ||
|
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.
WriteForm
이나TodoInput
,check_icon
에서 네이밍 컨벤션이 다른 부분이 보이는데, 혹시 의도하신걸까요?!