-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
341 lines (322 loc) · 12.9 KB
/
Copy pathindex.html
File metadata and controls
341 lines (322 loc) · 12.9 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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chicken Across Africa · The African Gourmet Foodways Archive</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #faf7f2;
color: #2c3e2f;
line-height: 1.6;
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1100px;
margin: 0 auto;
}
header {
text-align: center;
margin: 0 0 40px;
}
.gourmet-link {
font-size: 1.6rem;
color: #c44536;
text-decoration: none;
font-weight: 600;
letter-spacing: 1px;
border-bottom: 2px solid #e6b89c;
padding-bottom: 4px;
}
.gourmet-link:hover { color: #a33b2f; }
.tagline {
color: #6b4f3c;
margin-top: 8px;
font-style: italic;
font-size: 1.1rem;
}
.recipe-card {
background: white;
border-radius: 16px;
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
margin: 40px auto;
max-width: 600px;
padding: 24px;
display: none;
}
.recipe-card.active {
display: block;
}
.close-btn {
float: right;
background: none;
border: none;
font-size: 28px;
cursor: pointer;
color: #6b4f3c;
line-height: 1;
}
.close-btn:hover { color: #c44536; }
#dishImage {
width: 100%;
height: 220px;
object-fit: cover;
border-radius: 10px;
margin: 16px 0 20px;
}
#dishTitle {
font-size: 1.9rem;
color: #2c3e2f;
margin-bottom: 6px;
}
.dish-region {
color: #c44536;
font-weight: 600;
font-size: 0.95rem;
text-transform: uppercase;
letter-spacing: 1px;
margin-bottom: 16px;
}
#dishDescription {
margin-bottom: 20px;
}
.game-area {
display: flex;
flex-direction: column;
align-items: center;
gap: 50px;
margin: 40px 0 80px;
}
.chicken-container {
width: 260px;
height: 260px;
display: flex;
align-items: center;
justify-content: center;
}
.chicken {
max-width: 100%;
max-height: 100%;
object-fit: contain;
transition: transform 0.25s ease;
cursor: pointer;
}
.chicken:hover { transform: scale(1.04); }
.region-circle {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
max-width: 620px;
}
.region-btn {
width: 110px;
height: 110px;
border-radius: 50%;
border: none;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
cursor: pointer;
transition: all 0.25s ease;
box-shadow: 0 3px 8px rgba(0,0,0,0.1);
font-family: inherit;
}
.region-btn.north { background: #e6b89c; }
.region-btn.west { background: #c44536; }
.region-btn.central { background: #6b4f3c; }
.region-btn.east { background: #2c3e2f; }
.region-btn.south { background: #d4a59a; }
.region-btn:hover {
transform: translateY(-4px);
box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}
.region-letter {
font-size: 2.2rem;
font-weight: bold;
color: white;
text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}
.region-name {
font-size: 0.85rem;
color: white;
text-transform: uppercase;
letter-spacing: 1px;
text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
footer {
text-align: center;
color: #6b4f3c;
font-size: 0.95rem;
margin-top: 60px;
}
@media (max-width: 600px) {
.region-btn { width: 90px; height: 90px; }
.region-letter { font-size: 1.8rem; }
.region-name { font-size: 0.75rem; }
.chicken-container { width: 220px; height: 220px; }
#dishTitle { font-size: 1.6rem; }
.recipe-card { padding: 20px; }
}
@media (max-width: 400px) {
.region-circle { gap: 12px; }
.region-btn { width: 80px; height: 80px; }
}
</style>
</head>
<body>
<div class="container">
<header>
<a href="https://chicafricanculture.github.io/african-foodways-data/" target="_blank" class="gourmet-link">
Chicken Adventures · The African Gourmet
</a>
<p class="tagline">Click a region — discover one iconic chicken dish from the continent</p>
</header>
<div id="recipeCard" class="recipe-card" role="dialog" aria-modal="true" aria-labelledby="dishTitle">
<button class="close-btn" id="closeCard" aria-label="Close dish details">×</button>
<img id="dishImage" src="" alt="" loading="lazy">
<h2 id="dishTitle"></h2>
<p id="dishRegion" class="dish-region"></p>
<p id="dishDescription"></p>
</div>
<div class="game-area">
<div class="chicken-container">
<img id="chicken" src="images/neutral-chicken.png" alt="Curious chicken in African print feathers" class="chicken">
</div>
<div class="region-circle">
<button class="region-btn north" data-region="north" aria-label="Explore North African chicken dish">
<span class="region-letter">N</span>
<span class="region-name">North</span>
</button>
<button class="region-btn west" data-region="west" aria-label="Explore West African chicken dish">
<span class="region-letter">W</span>
<span class="region-name">West</span>
</button>
<button class="region-btn central" data-region="central" aria-label="Explore Central African chicken dish">
<span class="region-letter">C</span>
<span class="region-name">Central</span>
</button>
<button class="region-btn east" data-region="east" aria-label="Explore East African chicken dish">
<span class="region-letter">E</span>
<span class="region-name">East</span>
</button>
<button class="region-btn south" data-region="south" aria-label="Explore Southern African chicken dish">
<span class="region-letter">S</span>
<span class="region-name">South</span>
</button>
</div>
</div>
<footer>
<p>Part of <a href="https://www.theafricangourmet.com" target="_blank">The African Gourmet Foodways Archive</a> · Documenting living food traditions</p>
</footer>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const chicken = document.getElementById('chicken');
const recipeCard = document.getElementById('recipeCard');
const closeBtn = document.getElementById('closeCard');
const dishImage = document.getElementById('dishImage');
const dishTitle = document.getElementById('dishTitle');
const dishRegion = document.getElementById('dishRegion');
const dishDescription = document.getElementById('dishDescription');
let animationTimer = null;
const regions = {
north: {
name: 'Chicken Tagine',
region: 'North Africa — Morocco',
description: 'Slow-simmered chicken with preserved lemon, green olives, saffron, ginger, and cumin. The tagine pot traps moisture and layers aroma — eaten with khobz or couscous. Signature home and street dish.',
image: 'images/north.jpg',
alt: 'Moroccan chicken tagine with preserved lemons, olives, and spices'
},
west: {
name: 'Chicken Yassa',
region: 'West Africa — Senegal & Gambia',
description: 'Chicken marinated overnight in lemon, lime, mustard, and massive amounts of onions, then grilled and stewed until the onions caramelize into sweet-savory sauce. National pride dish of Senegal.',
image: 'images/west.jpg',
alt: 'Senegalese poulet yassa with caramelized onions and lemon'
},
central: {
name: 'Poulet Moambé / Moambe',
region: 'Central Africa — DRC, Congo, Angola',
description: 'Chicken cooked in rich red palm nut sauce with garlic, chili, tomato, and often okra or greens. Deep, nutty, slightly tangy — a Sunday or celebration staple across the region.',
image: 'images/central.jpg',
alt: 'Central African chicken moambé in palm nut sauce'
},
east: {
name: 'Doro Wat',
region: 'East Africa — Ethiopia',
description: 'Intensely spiced chicken stew made with berbere, niter kibbeh, onions, garlic, and ginger. Hard-boiled eggs added near the end. Served on injera — Ethiopia’s festive centerpiece.',
image: 'images/east.jpg',
alt: 'Ethiopian doro wat chicken stew with berbere and eggs'
},
south: {
name: 'Chicken Bunny Chow',
region: 'Southern Africa — South Africa (Durban)',
description: 'Curry-spiced chicken (often tomato-based with Durban masala) ladled into a hollowed half-loaf of white bread. Street food born in Indian-descended communities, now nationwide.',
image: 'images/south.jpg',
alt: 'South African chicken bunny chow in hollowed bread'
}
};
function setChickenState(src) {
if (animationTimer) clearTimeout(animationTimer);
chicken.src = src;
}
function showDish(regionKey) {
const dish = regions[regionKey];
if (!dish) return;
setChickenState('images/questioning-chicken.jpg');
dishImage.src = dish.image;
dishImage.alt = dish.alt;
dishTitle.textContent = dish.name;
dishRegion.textContent = dish.region;
dishDescription.textContent = dish.description;
recipeCard.classList.add('active');
recipeCard.scrollIntoView({ behavior: 'smooth', block: 'center' });
// Focus close button for keyboard users
closeBtn.focus();
}
function closeDish() {
recipeCard.classList.remove('active');
setChickenState('images/happy-chicken.png');
animationTimer = setTimeout(() => {
setChickenState('images/neutral-chicken.png');
}, 1800);
}
// Region buttons
document.querySelectorAll('.region-btn').forEach(btn => {
btn.addEventListener('click', () => {
showDish(btn.dataset.region);
});
});
// Close actions
closeBtn.addEventListener('click', closeDish);
chicken.addEventListener('click', () => {
if (recipeCard.classList.contains('active')) {
closeDish();
} else {
setChickenState('images/surprised-chicken.png');
animationTimer = setTimeout(() => {
setChickenState('images/neutral-chicken.png');
}, 1200);
}
});
// Close on Escape key
document.addEventListener('keydown', e => {
if (e.key === 'Escape' && recipeCard.classList.contains('active')) {
closeDish();
}
});
console.log('Africa chicken explorer ready');
});
</script>
</body>
</html>