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
17 changes: 17 additions & 0 deletions Week2/counter/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
</head>

<body>
<h2 id="number">0</h2>
<div>
<button id="increase">+1</button>
<button id="decrease">-1</button>
</div>

<script src="./index.mjs" type="module"></script>
</body>
</html>
19 changes: 19 additions & 0 deletions Week2/counter/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const number = document.getElementById("number");
const increase = document.getElementById("increase");
const decrease = document.getElementById("decrease");

console.log(number);
console.log(increase);
console.log(decrease);

increase.addEventListener("click", () => {
console.log("increase가 출력됨");
const current = parseInt(number.innerText, 10);
number.innerText = current + 1;
});

decrease.addEventListener("click", ()=> {
console.log("decrease 가 클릭됨");
const current = parseInt(number.innerText, 10);
number.innerText = current - 1;
});
3 changes: 3 additions & 0 deletions Week2/counter/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
font-family: sans-serif;
}
9 changes: 9 additions & 0 deletions Week2/image/svg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions Week2/modal/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="./styles.css" />
</head>

<body>
<h1>안녕하세요!</h1>
<p>내용내용내용</p>
<button id="open">버튼 열기</button>
<div class="modal-wrapper" style="display: none;">
<div class="modal">
<h3>안녕하세요</h3>
<p>모달 내용은 어쩌고 저쩌고..</p>
<div class="close-wrapper">
<button id="close">닫기</button>
</div>
</div>
</div>

<script src="./index.mjs" type="module"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions Week2/modal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const open = document.getElementById("open");
const close = document.getElementById("close");
const modal = document.querySelector(".modal-wrapper");

open.addEventListener("click", () => {
modal.style.display = "flex";
});

close.addEventListener("click", () => {
modal.style.display = "none";
});
30 changes: 30 additions & 0 deletions Week2/modal/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
body {
font-family: sans-serif;
}

.modal-wrapper {
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
}

.modal-wrapper .modal {
background-color: white;
padding: 16px;
border-radius: 5px;
width: 320px;
}

.modal-wrapper .modal p {
font-size: 15px;
}

.close-wrapper {
text-align: right;
}