-
Notifications
You must be signed in to change notification settings - Fork 1
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
[2주차 기본/생각 과제] 웨비의 사진관 😋, 가계부 💸 #2
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.
진짜 코드 너무 가독성있고 직관적이다!!!!! 나 진짜 반성하구가,,, 리팩토링할 때 많이 참고할게! ❤️
week2/assignment1/index.js
Outdated
}); | ||
content.addEventListener("mouseleave", function () { | ||
selectedImg.classList.remove("bg_brightness"); | ||
selectedEx.classList.add("hidden"); |
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.
완전 깔끔티비!!! 이건 그냥 꿀팁인데 "hidden"과 같이 많이 쓰이는 css는 상수와 시켜서 바로 불러올 수도 있어요!
const HIDDEN_CLASS = "hidden";
이러면 자동완성이 바로 되니까 더 편하더라구요!
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.
헐 완전 꿀팁.. 맨날 hidden 하나씩 다 치고 있던 제 모습이 떠오릅니다 ....
document.addEventListener("scroll", () => { | ||
const scrollY = document.documentElement.scrollTop; // | ||
const heightDiff = | ||
bottomElm.getBoundingClientRect().bottom - |
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.
오와 나 이거 처음봐!!
덕분에 알아간다!!!! 신기신기
덕분에 알아가는
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 heightDiff = | ||
bottomElm.getBoundingClientRect().bottom - | ||
topElm.getBoundingClientRect().height; | ||
|
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.
더 간단해 진것같아,,, 👍
|
||
contentList.forEach((content) => { | ||
const selectedImg = content.querySelector("img"); | ||
const selectedEx = content.querySelector(".explanation"); |
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.
혹시 길어지면 생성되는 더보기 버튼은 어디 있나용,,,?
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.
심화과제는 아직 하지 못했답니다..하하........
week2/assignment2/index.html
Outdated
<!-- 나의 자산 부분 --> | ||
<section class="total_budget_section"> | ||
<div class="total_budget_wrapper"> | ||
<h1>나의 자산</h1> |
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.
h1
태그는 하나만 있는게 좋다고 들어써요!! @seobbang
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.
앗 그러면 html문서 내에 h1
태그가 하나만 있는게 좋다고 .. 생각하면 될까용?!
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.
각 페이지는 하나의 H1 태그만 가져야 하며, 이를 무시하고 중복해서 사용하면 SEO에 부정적인 영향을 미칠 수 있다고 한다!!!
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.
오.. SEO 때문이였구나.. 알려줘서 고마워용🫶
week2/assignment2/index.js
Outdated
if (elm.checked) { | ||
inExID = elm.id; | ||
} |
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.
if (elm.checked) { | |
inExID = elm.id; | |
} | |
if (elm.checked) && inExID = elm.id; |
이렇게 변환할 수 있겠죵?
}); | ||
|
||
//초기 렌더링 함수 실행 | ||
screenRendering(HISTORY_LIST); |
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.
귯!
week2/assignment1/index.html
Outdated
<title>📸도리의 사진관📸</title> | ||
</head> | ||
<body> | ||
<header id="page_top">📸 ✈️ 도리의 2023 여행기 ✈️ 📸</header> |
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.
<header><h1>제목</h1></header>
이 더 좋을 것 같아요!
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.
고쳐보겠습니당!!!!!!
<div class="explanation hidden"> | ||
<h1 class="img_title">후쿠오카 밤 길거리</h1> | ||
<p class="img_exp"> | ||
분홍색 구름 너무 이쁘지 않나요? 다시 돌아가고 싶습니다 |
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.
귀여웤ㅋㅋㅋ
</p> | ||
</div> | ||
</div> | ||
<div class="img_hover_wrapper"> |
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.
요런 거 다 시멘틱으로 바꿔보는 거 추천드려용!
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.
코드리뷰 하면서 다른 태그들도 많이 알게되어서 고것들 반영하면서 바꿔볼게용🫶
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.
너무 고생했어 도윤언니 !! 변수 네이밍이나 주석 같은 디테일이 너무 인상적이였어용 🤓🖤!!
week2/assignment2/index.html
Outdated
<!-- 수입/지출 내역 --> | ||
<section class="budget_list"> | ||
<ul></ul> | ||
</section> | ||
|
||
<!-- 리스트 삭제 모달 --> | ||
<section class="modal_background delete_modal_section hidden"> | ||
<div class="delete_modal modal hidden"> | ||
<h1>정말 삭제하시겠습니까?</h1> | ||
<div class="del_btn_wrap"> | ||
<button type="button" class="yes_delete">예</button> | ||
<button type="button" class="no_delete">아니요</button> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<!-- 리스트 추가 모달 --> |
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.
주석 너무 좋다 보기 너무 편하자나 💖
week2/assignment2/index.html
Outdated
<!-- 나의 자산 부분 --> | ||
<section class="total_budget_section"> | ||
<div class="total_budget_wrapper"> | ||
<h1>나의 자산</h1> |
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.
각 페이지는 하나의 H1 태그만 가져야 하며, 이를 무시하고 중복해서 사용하면 SEO에 부정적인 영향을 미칠 수 있다고 한다!!!
@@ -0,0 +1,13 @@ | |||
const topBtn = document.getElementById("top_btn"); |
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.
저도 칭찬스티커 하나 붙이고 갑니다 🙌🏻
week2/assignment2/style.css
Outdated
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 2.9rem; | ||
text-align: center; | ||
background-color: lightsalmon; |
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.
1주차 리뷰에서 팟장님이 얘기해주셨던 부분이긴한데 속성 간 개행이 있으면 가독성이 더 좋을 것 같아 😊
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.
사실 CSS에는 개행을 왜 넣지? 싶었는데 이렇게 보니까 속성들이 빽빽해보이긴 하는구나....... 한번 반영해볼게 고마워!!
}); | ||
} | ||
} | ||
return newList.sort((a, b) => a.id - b.id); |
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.
정렬까지 야무지구만!
deleteBtn.onclick = () => { | ||
detectDelete(deleteBtn.id, LIST); | ||
}; |
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.
addEventLister
로 안하고 이렇게 바로 하는 방법도 있구나!!! 대박대박 깔끔하당..
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.
근데 생각해보니까 나머지는 다 addEventListener로 했는데 얘만 왜 onClick으로 했을까..
찾아보니까 onClick은 하나의 콜백을, addEventListener는 여러개의 콜백 이벤트를 줄 수 있다네.. 그래서 중복해서 사용하려면 addEventListener로 해야한대.. 이벤트 캡쳐링이랑 버블링을 할 땐 addEventListener를 사용하는게 좋다는걸 공유해드려요~
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.
혜인이랑 수빈이가 진짜 너무 잘해줬지만!.. 나도 조금은 도움이 됬으면 좋겠다!
week2/assignment1/index.js
Outdated
content.addEventListener("mouseover", function () { | ||
selectedEx.classList.remove("hidden"); | ||
selectedImg.classList.add("bg_brightness"); | ||
}); |
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.
mouseover시에 hidden이 사라지고 brightness를 추가하는 방식으로 하는 아이디어가 좋은 것 같아요!
document.addEventListener("scroll", () => { | ||
const scrollY = document.documentElement.scrollTop; // | ||
const heightDiff = | ||
bottomElm.getBoundingClientRect().bottom - |
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.
나도나도 진짜 대부분 처음보는거지만
그중에서도 생소해 ♥
@@ -0,0 +1,13 @@ | |||
const topBtn = document.getElementById("top_btn"); |
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.
나도나도 두개를 분리하니까 처음하는 나도 되게 보기편했오!
case "income": { | ||
li.classList.add("income_elm"); | ||
amount.classList.add("add"); | ||
amount.innerText = `+${elm.amount}`; |
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.
템플릿 리터럴로 백틱과 ${}써서 표현한게 좋아요!
} | ||
case "expense": { | ||
initExpense += Number(elm.amount); | ||
break; |
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.
둘다 아닌경우를 대비해서 있는 거니까 비워둬도 괜찮지 않을까..?
아니면 가계부니까 default를 전부 반영하는 걸로 표시하는건 무리가 있겠지?
LIST.forEach((elm) => { | ||
switch (elm.InOrExpense) { |
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.
단어를 축약했을때 헷갈리지만 않는다면 보기 편할거같아!
<form name="list_add_form" action=""> | ||
<div class="in_ex_btns"> |
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.
처음보는 form 태그! 덕분에 알게됬어요!
✨ 구현 기능 명세
[ 웨비의 사진관 😋]
기본과제
1. 이미지 (첫번째 섹션만 해당)
이미지 호버시 백그라운드가 어둡게 처리되고, 해당 사진에 대한 제목과 설명이 나타납니다.
이미지에서 벗어나면 사라집니다.
→ 한번에 반드시 하나의 이미지의 설명만 나타납니다.
2. top버튼
[가계부 💸]
1. 최초 데이터
상수로
INIT_BALANCE
,HISTORY_LIST
데이터를 가집니다. (상수명은 자유)INIT_BALANCE
= 0HISTORY_LIST
: 입출금 내역 리스트 (4개
)최초 실행시 위 상수 데이터들 이용해 렌더링합니다. (즉, html에 직접 박아놓는 하드코딩 ❌)
→ 나의 자산은
INIT_BALANCE
로부터 4개의 입출금 내역 리스트를 반영하여 보여줍니다.2. 총수입 / 총지출
HISTORY_LIST
에 있는 수입 내역과 지출 내역을 계산해서 총수입, 총지출을 보여줍니다.3. 수입/지출 필터링
4. 리스트 삭제
X
버튼을 누르면 해당 리스트가 삭제됩니다.5. 리스트 추가
수입
지출
버튼카테고리
를 선택수입
을 선택하면 수입 관련된 항목들이,지출
을 선택하면 종류에 지출 관련된 항목들이 나옵니다.금액
과내용
입력 input저장하기
버튼닫기
버튼생각 과제
💎 PR Point
웨비의 사진관 - 기본과제 2번 관련(topBtn opacity 조절)
가게부 - 기본과제 4번 관련
가게부 - 기본과제 5번 관련 (리스트 추가 중 수입 지출 toggle)
🥺 소요 시간, 어려웠던 점
2h
12h
🌈 구현 결과물
https://six-puppy-7ec.notion.site/2-bcf3839f87874070a92b7cc4867c3f73?pvs=4