Skip to content

Commit 5f1f16f

Browse files
committed
init: 기본 구조 세팅
1 parent 69080bb commit 5f1f16f

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

project1-colors/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="ko">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>랜덤 색상 생성기</title>
8+
<link rel="stylesheet" href="./src/style.css" />
9+
</head>
10+
<body>
11+
<main id="app"></main>
12+
<script src="./src/main.js" type="module"></script>
13+
</body>
14+
</html>

project1-colors/src/Button.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default function Button({ $target, onClick }) {
2+
const $button = document.createElement("button");
3+
$target.append($button);
4+
$button.textContent = "Click Me!";
5+
}

project1-colors/src/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Button from "./Button.js";
2+
3+
const $app = document.querySelector("#app");
4+
5+
new Button({
6+
$target: $app,
7+
});

project1-colors/src/style.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
}
5+
6+
#app {
7+
display: flex;
8+
justify-content: center;
9+
align-items: center;
10+
height: 100vh;
11+
background-color: transparent;
12+
}
13+
14+
button {
15+
padding: 10px 15px;
16+
background-color: transparent;
17+
border-radius: 5px;
18+
cursor: pointer;
19+
outline: 0;
20+
color: rgb(52, 58, 64);
21+
font-size: 16px;
22+
border: 1px solid rgb(52, 58, 64);
23+
transition: all 0.2s;
24+
box-shadow: 0px 0px 0px 5px rgb(255, 255, 255, 0.8);
25+
}
26+
27+
button:hover {
28+
color: white;
29+
font-weight: 500;
30+
background-color: rgb(52, 58, 64);
31+
}

0 commit comments

Comments
 (0)