forked from JANCOOKWebProject/Web-Programming-Projectt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
288 lines (266 loc) · 13.2 KB
/
main.html
File metadata and controls
288 lines (266 loc) · 13.2 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>잔쿡 메인</title>
<!-- 간단한 JS (버튼 클릭 시 해당 하위카테고리만 보여주기) -->
<script>
function toggleSub(id) {
const subs = document.querySelectorAll('.subcategory');
subs.forEach(sub => sub.style.display = 'none'); // ✅ 모두 숨기고
const target = document.getElementById(id);
if (target) {
target.style.display = 'block'; // ✅ 클릭된 것만 표시
}
}
document.addEventListener('DOMContentLoaded', () => {
const checkboxes = document.querySelectorAll('.subcategory input[type="checkbox"]');
checkboxes.forEach(cb => {
cb.addEventListener('change', () => {
// 체크 상태일 때만 이동 (선택적으로)
if (cb.checked) {
window.location.href = 'ingredients.html';
}
});
});
});
</script>
</head>
<body>
<div class="container"> <!-- 상단 헤더 -->
<header>
<div class="logo">
<a href="main.html"><img class="logo-image" src="icon-image/Logo.png" alt="잔쿡"></a>
</div>
<div class="search-box">
<input type="text" placeholder="재료를 넣어주세요..." />
</div>
<div class="icons">
<a href="/signup" title="회원가입"><img src="icon-image/014-add.png" alt="회원가입"></a>
<a href="/login" title="로그인"><img src="icon-image/015-user-1.png" alt="로그인"></a>
</div>
</header>
<!-- 메뉴 바 -->
<nav>
<ul class="nav-menu">
<li><a href="#">종류별 음식</a></li>
<li><a href="ingredients.html">재료로 검색</a></li>
<li><a href="#">초보용 음식</a></li>
<li><a href="#">조리 시간별</a></li>
</ul>
</nav>
<!-- 광고 배너 -->
<div class="banner">광고 배너</div>
<!-- 재료 카테고리 (원형 아이콘 형태) -->
<div class="category-icons">
<button onclick="toggleSub('meat')" href="ingredients.html">
<img src="icon-image/002-beef.png" alt="소고기"><br>
<span>소고기</span>
</button>
<button onclick="toggleSub('pork')">
<img src="icon-image/003-pork.png" alt="돼지고기"><br>
<span>돼지고기</span>
</button>
<button onclick="toggleSub('chicken')">
<img src="icon-image/001-hen.png" alt="닭고기"><br>
<span>닭고기</span>
</button>
<button onclick="toggleSub('veggie')">
<img src="icon-image/005-vegetable.png" alt="채소류"><br>
<span>채소류</span>
</button>
<button onclick="toggleSub('seafood')">
<img src="icon-image/008-seafood.png" alt="해물류"><br>
<span>해물류</span>
</button>
<button onclick="toggleSub('noodle')">
<img src="icon-image/spaghetti.png" alt="면류"><br>
<span>면류</span>
</button>
<button onclick="toggleSub('grain')">
<img src="icon-image/bread.png" alt="곡류"><br>
<span>곡류</span>
</button>
<button onclick="toggleSub('dairy')">
<img src="icon-image/010-dairy-products.png" alt="유제품"><br>
<span>유제품</span>
</button>
<button onclick="toggleSub('mushroom')">
<img src="icon-image/006-mushrooms.png" alt="버섯류"><br>
<span>버섯류</span>
</button>
<button onclick="toggleSub('etc')">
<img src="icon-image/007-seasoning.png" alt="기타"><br>
<span>기타</span>
</button>
</div>
<!-- 상세 재료 선택창 -->
<div class="subcategory" id="meat">
<div class="subcategory-title">소고기 종류</div>
<label><input type="checkbox"> 등심</label>
<label><input type="checkbox"> 안심</label>
<label><input type="checkbox"> 갈비</label>
<label><input type="checkbox"> 차돌박이</label>
<label><input type="checkbox"> 사태</label>
<label><input type="checkbox"> 우둔살</label>
</div>
<div class="subcategory" id="pork">
<div class="subcategory-title">돼지고기 종류</div>
<label><input type="checkbox"> 삼겹살</label>
<label><input type="checkbox"> 목살</label>
<label><input type="checkbox"> 앞다리살</label>
<label><input type="checkbox"> 갈비살</label>
<label><input type="checkbox"> 항정살</label>
<label><input type="checkbox"> 가브리살</label>
</div>
<div class="subcategory" id="chicken">
<div class="subcategory-title">닭고기 종류</div>
<label><input type="checkbox"> 닭가슴살</label>
<label><input type="checkbox"> 닭다리살</label>
<label><input type="checkbox"> 통닭</label>
<label><input type="checkbox"> 닭날개</label>
<label><input type="checkbox"> 닭근위</label>
</div>
<div class="subcategory" id="veggie">
<div class="subcategory-title">채소류</div>
<label><input type="checkbox"> 당근</label>
<label><input type="checkbox"> 브로콜리</label>
<label><input type="checkbox"> 양파</label>
<label><input type="checkbox"> 대파</label>
<label><input type="checkbox"> 호박</label>
<label><input type="checkbox"> 감자</label>
<label><input type="checkbox"> 고구마</label>
<label><input type="checkbox"> 배추</label>
</div>
<div class="subcategory" id="seafood">
<div class="subcategory-title">해물류</div>
<label><input type="checkbox"> 고등어</label>
<label><input type="checkbox"> 굴비</label>
<label><input type="checkbox"> 장어</label>
<label><input type="checkbox"> 연어</label>
<label><input type="checkbox"> 오징어</label>
<label><input type="checkbox"> 새우</label>
<label><input type="checkbox"> 홍합</label>
<label><input type="checkbox"> 바지락</label>
<label><input type="checkbox"> 문어</label>
<label><input type="checkbox"> 게</label>
</div>
<div class="subcategory" id="noodle">
<div class="subcategory-title">면류</div>
<label><input type="checkbox"> 우동면</label>
<label><input type="checkbox"> 스파게티면</label>
<label><input type="checkbox"> 라면사리</label>
<label><input type="checkbox"> 소면</label>
<label><input type="checkbox"> 냉면사리</label>
</div>
<div class="subcategory" id="dairy">
<div class="subcategory-title">유제품</div>
<label><input type="checkbox"> 우유</label>
<label><input type="checkbox"> 치즈</label>
<label><input type="checkbox"> 버터</label>
<label><input type="checkbox"> 생크림</label>
<label><input type="checkbox"> 요거트</label>
<label><input type="checkbox"> 계란</label>
</div>
<div class="subcategory" id="grain">
<div class="subcategory-title">곡류</div>
<label><input type="checkbox"> 밥</label>
<label><input type="checkbox"> 보리</label>
<label><input type="checkbox"> 귀리</label>
<label><input type="checkbox"> 현미</label>
<label><input type="checkbox"> 찹쌀</label>
<label><input type="checkbox"> 빵</label>
</div>
<div class="subcategory" id="mushroom">
<div class="subcategory-title">버섯류</div>
<label><input type="checkbox"> 표고버섯</label>
<label><input type="checkbox"> 느타리버섯</label>
<label><input type="checkbox"> 새송이버섯</label>
<label><input type="checkbox"> 팽이버섯</label>
<label><input type="checkbox"> 양송이버섯</label>
</div>
<div class="subcategory" id="etc">
<div class="subcategory-title">기타 / 양념</div>
<label><input type="checkbox"> 고추장</label>
<label><input type="checkbox"> 된장</label>
<label><input type="checkbox"> 간장</label>
<label><input type="checkbox"> 설탕</label>
<label><input type="checkbox"> 참기름</label>
<label><input type="checkbox"> 마늘</label>
<label><input type="checkbox"> 생강</label>
<label><input type="checkbox"> 소금</label>
<label><input type="checkbox"> 식초</label>
<label><input type="checkbox"> 후추</label>
<label><input type="checkbox"> 고춧가루</label>
<label><input type="checkbox"> 식용유</label>
</div>
<div class="recommendation-box">
<!-- 추천메뉴 타이틀 -->
<h2 class="recommendation-title">오늘의 추천메뉴</h2>
<main class="main-content">
<section class="recommendation-section">
<!-- 왼쪽: 추천 음식 목록 -->
<div class="food-grid">
<div class="food-card">
<a href="recipe.html">
<img src="food-image/kimchi-rice.jpg" alt="음식1">
<p>김치볶음밥</p>
</a>
</div>
<div class="food-card">
<img src="food-image/grilled-steak-with-salt-herbs-grilled-tomato-served-wooden-board.jpg" alt="음식2">
<p>스테이크</p>
</div>
<div class="food-card">
<img src="food-image/sauteed-mushrooms-with-pumpkin-sweet-pepper.jpg" alt="음식3">
<p>호박버섯 볶음</p>
</div>
<div class="food-card">
<img src="food-image/soybean-soup.jpg" alt="음식4">
<p>매콤 된장찌개</p>
</div>
<div class="food-card">
<img src="food-image/pepper-paste-fork.jpg" alt="음식5">
<p>제육볶음</p>
</div>
<div class="food-card">
<img src="food-image/stir-fry-spaghetti-put-pork-bowl.jpg" alt="음식6">
<p>돼지고기 볶음 스파게티</p>
</div>
<div class="food-card">
<img src="food-image/front-view-fried-meat-with-vegetables-inside-plate-brown-wooden-desk-food-meal-meat.jpg"
alt="음식7">
<p>스테이크 샐러드</p>
</div>
<div class="food-card">
<img src="food-image/tasty-appetizing-classic-italian-spaghetti-pasta-with-tomato-sauce-cheese-parmesan-basil-plate-ingredients-cooking-pasta-white-marble-table.jpg"
alt="음식8">
<p>토마토 파스타</p>
</div>
</div>
</section>
</main>
</div>
<!-- 오른쪽: 인기 메뉴 랭킹 -->
<aside class="sidebar">
<aside class="ranking-box">
<h3>이번 주 인기메뉴</h3>
<div class="top-rank">
<div class="rank-item first">🥇 1등: 불고기</div>
<div class="rank-item second">🥈 2등: 김치찌개</div>
<div class="rank-item third">🥉 3등: 돈까스</div>
</div>
<ul class="rank-list">
<li>4등: 떡볶이</li>
<li>5등: 비빔밥</li>
<li>6등: 제육볶음</li>
<li>7등: 카레</li>
</ul>
</aside>
</aside>
</div>
<footer class="footer">잔쿡</footer>
</body>
</html>