Skip to content
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주차 기본 과제] 가계부 #7

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions Week1/Ledger/constants/CATEGORY.js
Copy link
Member

Choose a reason for hiding this comment

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

category도 따로 상수처리를 할 생각은 전혀 못했는데!! 역시⭐️

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const CATEGORY = [
{
category: "식비",
type: "지출",
},
{
category: "생활용품",
type: "지출",
},
{
category: "문화생활",
type: "지출",
},
{
category: "알바",
type: "수입",
},
{
category: "장학금",
type: "수입",
},
];
26 changes: 26 additions & 0 deletions Week1/Ledger/constants/HISTORY.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const HISTORY_LIST = [
{
category: "식비",
subject: "김밥천국",
amount: 4500,
type: "지출",
},
{
category: "생활용품",
subject: "다이소",
amount: 15000,
type: "지출",
},
{
category: "문화생활",
subject: "CGV",
amount: 20000,
type: "지출",
},
{
category: "알바",
subject: "월급",
amount: 300000,
type: "수입",
},
];
200 changes: 83 additions & 117 deletions Week1/Ledger/index.html
Original file line number Diff line number Diff line change
@@ -1,124 +1,90 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<title>지뮤 가계부</title>
</head>
<body>
<h1>지뮤의 가계부</h1>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<title>지뮤 가계부</title>
<script type="module" src="./constants/HISTORY.js"></script>
<script type="module" src="./constants/CATEGORY.js"></script>
</head>
<body>
<header><h1>지뮤의 가계부</h1></header>

<!-- 총액 보여주는 영역 -->
<section class="summary-section">
<article class="summary-article">
<h2>나의 자산</h2>
<span class="total">500000</span>
<div class="summary-article__details">
<div class="summary-article__details-minus">
<img src="./images/minus.png" alt="마이너스" /><span>30000</span>
</div>
<div class="summary-article__details-plus">
<img
class="summary-article__details-plus"
src="./images/plus.png"
alt="플러스"
/><span>60000</span>
</div>
</div>
</article>
</section>
<div class="first-line"></div>
<!-- 총액 보여주는 영역 -->
<section class="summary-section">
<article class="summary-article">
<h2>나의 자산</h2>
<span class="total"></span>
<div class="summary-article__details">
<div class="summary-article__details-minus">
<img src="./images/minus.png" alt="마이너스" /><span></span>
</div>
<div class="summary-article__details-plus">
<img
class="summary-article__details-plus"
src="./images/plus.png"
alt="플러스"
/><span></span>
</div>
</div>
</article>
</section>
<div class="first-line"></div>

<!-- 세부 리스트 영역 -->
<section>
<header class="details-container">
<div class="date-container">
<button type="button"><</button>
<h3>10월 13일</h3>
<button type="button">></button>
</div>
<div class="h4-checkbox-container">
<h4>내역 리스트</h4>
<div class="checkbox-container">
<input type="checkbox" id="income" checked />
<label class="checkbox__income" for="income">수입</label>
<input type="checkbox" id="expense" checked />
<label class="checkbox__expense" for="expense"> 지출 </label>
</div>
</div>
<div class="second-line"></div>
</header>
<!-- 세부 리스트 영역 -->
<section>
<header class="details-container">
<div class="date-container">
<button type="button">&lt;</button>
Copy link
Member

Choose a reason for hiding this comment

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

아차차 HTML 특수문자 처리.....습관적으로 그냥 썼는데 리팩토링때 명심해야겠어요

<h3>10월 13일</h3>
<button type="button">&gt;</button>
</div>
<div class="h4-checkbox-container">
<h4>내역 리스트</h4>
<div class="checkbox-container">
<input type="checkbox" id="income" checked />
<label class="checkbox__income" for="income">수입</label>
<input type="checkbox" id="expense" checked />
<label class="checkbox__expense" for="expense"> 지출 </label>
</div>
</div>
<div class="second-line"></div>
</header>

<!-- 내역 리스트 항목들 -->
<ul class="list-container">
<li>
<span class="list__category">식비</span>
<span class="subject">너무배고파서아이스크림을먹었다</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">알바</span>
<span class="amount_plus">+500000</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
<li>
<span class="list__category">식비</span>
<span class="subject">학식</span>
<span class="amount_minus">-3500</span>
<button type="button">X</button>
</li>
</ul>
</section>
<!-- 내역 리스트 항목들 -->
<ul class="list-container"></ul>
</section>

<footer>
<button type="button">
<img src="./images/addition.png" alt="내역-추가-버튼" />
</button>
</footer>
</body>
<section class="modal-container">
<div class="modal-header">
<h2>내역 추가</h2>
<div class="checkbox-container">
<input type="checkbox" id="modalIncome" checked />
<label class="modal-income" for="modalIncome">수입</label>
<input type="checkbox" id="modalExpense" />
<label class="modal-expense" for="modalExpense"> 지출 </label>
</div>
</div>
<div class="modal-body">
<label for="category">종류</label>
<select name="category" id="category"></select>
<label for="amount">금액</label>
<input type="text" name="amount" id="amount" />
<label for="subject">내용</label>
<input type="text" name="subject" id="subject" />
</div>
<div class="modal-footer">
<button class="modal-button save" type="button">저장하기</button>
<button class="modal-button close" type="button">닫기</button>
</div>
</section>

<footer>
<button type="button" id="addition">
<img src="./images/addition.png" alt="내역-추가-버튼" />
</button>
</footer>
<script type="module" src="index.js"></script>
</body>
</html>
Loading