-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyquest.html
More file actions
226 lines (212 loc) · 7.27 KB
/
myquest.html
File metadata and controls
226 lines (212 loc) · 7.27 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="generator" content="Hugo 0.88.1">
<title>Yum-QUEST!</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<style>
.navbar-custom {
background-color: #ff4500;
}
.btn-custom {
background-color: #f0ad4e;
border-color: #f0ad4e;
}
.card-title {
font-size: 1.25rem;
font-weight: bold;
}
.card-text {
font-size: 0.875rem;
color: #777;
}
.quest-button {
background-color: #ff4500;
border: none;
color: white;
}
.card-img-top {
height: 150px;
object-fit: cover;
}
.header {
background-color: #ff4500;
color: white;
padding: 10px 0;
}
.navbar {
background-color: #ff4500;
padding: 10px 0;
}
.nav-center {
display: flex;
justify-content: center;
}
.small-text {
font-size: 1.25rem;
}
.header .navbar-brand {
font-size: 2rem;
}
.header-container {
display: flex;
justify-content: center;
align-items: center;
}
.header .login-button {
position: absolute;
right: 10px;
}
.quest-log {
background-color: #f0ad4e;
/*padding: 10px;
margin-bottom: 5px;
border-radius: 5px;*/
list-style-type: none;
padding-left: 0;
}
.quest-log li {
cursor: pointer;
}
.categories, .locations {
display: flex;
flex-wrap: wrap;
}
.category, .location {
flex: 1 1 30%;
background-color: #f0ad4e;
margin: 5px;
padding: 10px;
text-align: center;
cursor: pointer;
border-radius: 5px;
}
</style>
</head>
<body>
<header class="header">
<div class="container header-container">
<a href="#" class="navbar-brand text-white">
<strong>Yum-QUEST!</strong>
</a>
<button class="btn btn-sm btn-outline-light login-button">로그인</button>
</div>
</header>
<nav class="navbar">
<div class="container d-flex justify-content-center">
<div class="d-flex">
<a href="#" class="btn btn-sm btn-outline-light me-2">지도바로가기</a>
<a href="#" class="btn btn-sm btn-outline-light me-2">내리뷰확인하기</a>
<a href="#" class="btn btn-sm btn-outline-light">리뷰작성하기</a>
</div>
</div>
</nav>
<main class="container">
<section class="my-4">
<div class="row">
<div class="col-md-4">
<h2>MY QUEST!</h2>
<form id="questForm">
<div class="mb-3">
<input type="text" class="form-control" id="restaurantName" placeholder="맛집 이름" required>
</div>
<div class="mb-3">
<input type="text" class="form-control" id="restaurantLocation" placeholder="맛집 위치" required>
</div>
<div class="mb-3">
<select class="form-select" id="restaurantCategory" required>
<option value="" disabled selected>카테고리를 선택하세요</option>
<option value="한식">한식</option>
<option value="중식">중식</option>
<option value="일식">일식</option>
<option value="양식">양식</option>
<option value="디저트">디저트</option>
<option value="다이어트">다이어트</option>
</select>
</div>
<button type="submit" class="btn btn-custom">추가하기</button>
</form>
<h3 class="mt-4">QUEST-LOG:</h3>
<ul id="questLog" class="quest-log">
</ul>
</div>
<div class="col-md-8">
<h2>카테고리별 한눈보기</h2>
<div class="categories">
<div class="category" data-category="한식">한식</div>
<div class="category" data-category="중식">중식</div>
<div class="category" data-category="일식">일식</div>
<div class="category" data-category="양식">양식</div>
<div class="category" data-category="디저트">디저트</div>
<div class="category" data-category="다이어트">다이어트</div>
</div>
<h2 class="mt-4">위치별 한눈보기</h2>
<div class="locations">
<div class="location" data-location="분당동">분당동</div>
<div class="location" data-location="서현동">서현동</div>
<div class="location" data-location="백현동">백현동</div>
<div class="location" data-location="정자동">정자동</div>
<div class="location" data-location="수내동">수내동</div>
<div class="location" data-location="청파동">청파동</div>
</div>
</div>
</div>
</section>
</main>
<footer class="text-muted py-5">
<div class="container">
<p class="float-end mb-1">
<a href="#">Back to top</a>
</p>
<p class="mb-1">Yum-QUEST! © eugene2065@sookmyung.ac.kr</p>
</div>
</footer>
<script>
document.getElementById('questForm').addEventListener('submit', function(event) {
event.preventDefault();
const restaurantName = document.getElementById('restaurantName').value;
const restaurantLocation = document.getElementById('restaurantLocation').value;
const restaurantCategory = document.getElementById('restaurantCategory').value;
if (restaurantName && restaurantLocation && restaurantCategory) {
const li = document.createElement('li');
li.textContent = restaurantName;
li.setAttribute('data-category', restaurantCategory);
li.setAttribute('data-location', restaurantLocation);
li.addEventListener('click', function() {
this.classList.toggle('completed');
});
document.getElementById('questLog').appendChild(li);
document.getElementById('questForm').reset();
}
});
document.querySelectorAll('.category').forEach(function(category) {
category.addEventListener('click', function() {
const selectedCategory = this.getAttribute('data-category');
document.querySelectorAll('#questLog li').forEach(function(item) {
if (item.getAttribute('data-category') === selectedCategory) {
item.style.display = 'list-item';
} else {
item.style.display = 'none';
}
});
});
});
document.querySelectorAll('.location').forEach(function(location) {
location.addEventListener('click', function() {
const selectedLocation = this.getAttribute('data-location');
document.querySelectorAll('#questLog li').forEach(function(item) {
if (item.getAttribute('data-location') === selectedLocation) {
item.style.display = 'list-item';
} else {
item.style.display = 'none';
}
});
});
});
document.styleSheets[0].insertRule('.completed { text-decoration: line-through; }', 0);
</script>
<script src="https://cdn.jsdelivr