-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.html
More file actions
74 lines (73 loc) · 2.29 KB
/
base.html
File metadata and controls
74 lines (73 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- css 파일 불러오기 -->
<link rel="stylesheet" type="text/css" href="css/base.css" />
<title>base_page</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: flex-start;
align-items: flex-start;
min-height: 100vh;
background-color: #efefef;
}
article {
width: 430px;
height: 932px;
background-color: #191919;
border-radius: 10px;
position: relative;
top: 0;
left: 0;
}
</style>
</head>
<body>
<article>
<header>
<div class="logo">
<img src="img/base.html_logo.svg" alt="로고이미지" />
</div>
<div class="title_line">
<div class="date">7월 17일 수요일,</div>
<div class="checkbox">
오늘의 메세지 등록
<input type="checkbox" id="check" />
<label for="check"></label>
</div>
</div>
</header>
<footer>
<div class="button_box">
<button id="back"><img src="img/base.html_back.svg" alt="뒤로가기" /></button>
<button id="group"><img src="img/base.html_group.svg" alt="그룹" /></button>
<button id="ball"><img src="img/base.html_ball.svg" alt="알림" /></button>
<button id="home"><img src="img/base.html_home.svg" alt="홈화면" /></button>
</div>
</footer>
</article>
<script>
document.addEventListener("DOMContentLoaded", () => {
const buttons = document.querySelectorAll(".button_box button");
buttons.forEach((button) => {
button.addEventListener("click", () => {
buttons.forEach((btn) => {
btn.classList.remove("active");
const img = btn.querySelector("img");
const imgSrc = img.getAttribute("src").replace("_active", "");
img.setAttribute("src", imgSrc);
});
button.classList.add("active");
const img = button.querySelector("img");
const imgSrc = img.getAttribute("src").replace(".svg", "_active.svg");
img.setAttribute("src", imgSrc);
});
});
});
</script>
</body>
</html>