Skip to content
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
Binary file added .DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<title>vanilla-todo</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<button class="menuButton">&#9776;</button>
<h1 class="title">To Do</h1>
</header>
<aside>
<div class="menuList">
<span class="closeMenu">X</span>
<button class="week" id="previousWeek">이전 주</button>
<button class="week" id="nextWeek">다음 주</button>
<input type="date" id="calendar" />
<button class="darkMode">🌙</button>
</div>
</aside>
<div>
<button class="date" id="previousDate">◀</button>
<span id="currentDateText"></span>
<button class="date" id="nextDate">▶</button>
</div>
<main>
<input class="input" placeholder="오늘의 할 일을 적어주세요!" />
<button class="enter">등록</button>
<span id="total"></span>
<ul id="todoList"></ul>
</main>
<script src="vanilla.js"></script>
</body>
</html>
241 changes: 241 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

/* 기본 설정 */
* {
text-align: center;
font-family: "Pretendard";
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
min-height: 100vh;
background-color: rgb(133, 173, 198);
color: #000;

display: flex;
flex-direction: column;
align-items: center;
}

/* 상단 영역 */
header {
width: 100%;
padding: 16px 0;
position: relative;

display: flex;
justify-content: center;
align-items: center;
}

.title {
font-size: 2rem;
font-weight: 700;
cursor: pointer;
}

.menuButton {
position: absolute;
left: 1rem;
border: none;
background-color: transparent;
font-size: 2rem;
cursor: pointer;
}

/* 사이드바 디자인 */
.menuList {
position: fixed;
top: 0;
left: -100%;
width: 70%;
max-width: 320px;
height: 100vh;
padding: 24px 0;
background-color: #f5f5f5;
transition: left 0.3s ease;
z-index: 1000;

display: flex;
flex-direction: column;
align-items: center;
gap: 60px;
}

.closeMenu {
align-self: flex-start;
margin-left: 16px;
font-size: 2rem;
cursor: pointer;
background: transparent;
}

.week {
border: none;
background: transparent;
font-size: 2rem;
color: #3b1f1f;
cursor: pointer;
}

#calendar {
border: none;
background: transparent;
font-size: 2rem;
color: #3b1f1f;
text-align: center;
}

.darkMode {
border: none;
background: transparent;
font-size: 2rem;
cursor: pointer;
}

/* 날짜 표시 영역 */
.dateBox {
margin-top: 8px;

display: flex;
justify-content: center;
align-items: center;
gap: 16px;
}
Comment on lines +99 to +106
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

요 css가 적용되는 html요소가 없네용!


.date {
border: none;
background: transparent;
font-size: 1.5rem;
cursor: pointer;
}

#currentDateText {
font-size: 1.5rem;
font-weight: 600;
}

/* 메인 영역 */
main {
width: 100%;
max-width: 600px;
margin-top: 24px;

display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}

.inputArea {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
}
Comment on lines +132 to +137
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

해당 css도 사용되지 않네용!


.input {
width: 280px;
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 8px;
background-color: white;
text-align: left;
font-size: 1rem;
}

.enter {
padding: 10px 16px;
border: none;
border-radius: 8px;
background-color: white;
cursor: pointer;
font-size: 1rem;
}

#total {
font-size: 1rem;
font-weight: 600;
}

#todoList {
width: 100%;
list-style: none;

display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
}

#todoList li {
width: 100%;
max-width: 500px;
padding: 10px 14px;
border-radius: 10px;
background-color: white;

display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
}

#todoList li input[type="checkbox"] {
width: 18px;
height: 18px;
flex-shrink: 0;
}

#todoList span {
flex: 1;
background: transparent;
font-size: 1.1rem;
word-break: break-word;
}

#todoList li button {
border: none;
background: transparent;
color: red;
cursor: pointer;
font-size: 0.95rem;
flex-shrink: 0;
}

/* 다크모드 디자인 */
body.darkTheme {
background-color: black;
color: white;
}

body.darkTheme .menuList {
background-color: gray;
}

body.darkTheme .title,
body.darkTheme .menuButton,
body.darkTheme .closeMenu,
body.darkTheme .week,
body.darkTheme #calendar,
body.darkTheme .darkMode,
body.darkTheme .date,
body.darkTheme #currentDateText,
body.darkTheme #total,
body.darkTheme #todoList span {
color: white;
}

body.darkTheme .input,
body.darkTheme .enter,
body.darkTheme #todoList li {
background-color: #2d2c2c;
color: white;
border: 1px solid #555;
}

body.darkTheme .deleteButton {
color: white;
}
Loading