-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsua5.html
414 lines (256 loc) · 9.08 KB
/
sua5.html
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ApproVideo Aug 2024</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<style>
:root {
--bg-light: #f0f4f8;
--text-light: #2d3748;
--card-bg-light: #ffffff;
--card-text-light: #4a5568;
--bg-dark: #1a202c;
--text-dark: #e2e8f0;
--card-bg-dark: #2d3748;
--card-text-dark: #e2e8f0;
}
body {
transition: background-color 0.3s, color 0.3s;
}
body.light {
background-color: var(--bg-light);
color: var(--text-light);
}
body.dark {
background-color: var(--bg-dark);
color: var(--text-dark);
}
.header {
background: linear-gradient(45deg, #4CAF50, #2196F3);
padding: 20px;
text-align: center;
color: white;
font-size: 2.5rem;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.subheader {
font-size: 1.2rem;
margin-top: 10px;
}
.video-card {
background-color: var(--card-bg-light);
color: var(--card-text-light);
transition: background-color 0.3s, color 0.3s;
}
body.dark .video-card {
background-color: var(--card-bg-dark);
color: var(--card-text-dark);
}
.theme-toggle {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 50%;
padding: 10px;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
body.dark .theme-toggle {
background-color: rgba(0, 0, 0, 0.5);
}
.panel-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
margin-top: 2rem;
}
.info-panel {
background-color: #f0f4f8;
border-radius: 8px;
padding: 1rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.info-panel h3 {
color: #2c5282;
margin-bottom: 0.5rem;
}
.info-panel p {
color: #4a5568;
font-size: 0.9rem;
line-height: 1.4;
}
body.dark .info-panel {
background-color: #2d3748;
}
body.dark .info-panel h3 {
color: #90cdf4;
}
body.dark .info-panel p {
color: #e2e8f0;
}
.menu-sidebar {
position: fixed;
top: 0;
left: -300px;
width: 300px;
height: 100%;
background-color: white;
z-index: 50;
transition: left 0.3s ease-in-out;
overflow-y: auto;
padding: 1rem;
}
body.dark .menu-sidebar {
background-color: #2d3748;
color: white;
}
.menu-sidebar.open {
left: 0;
}
.menu-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 40;
}
.menu-sidebar {
position: fixed;
top: 0;
left: -300px; /* Initially hidden */
width: 300px;
height: 100%;
background-color: white;
z-index: 50; /* Ensure it's above other content */
transition: left 0.3s ease-in-out; /* Smooth transition */
overflow-y: auto; /* Add scrollbar if content overflows */
padding: 1rem;
}
body.dark .menu-sidebar {
background-color: #2d3748;
color: white;
}
.menu-sidebar.open {
left: 0; /* Slide in when open */
}
.menu-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 40; /* Below the sidebar */
opacity: 0; /* Initially hidden */
visibility: hidden;
transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
body.menu-open .menu-overlay {
opacity: 1;
visibility: visible;
}
</style>
</head>
<body class="light">
<div class="menu-overlay"></div>
<div class="menu-sidebar p-4">
<button id="close-menu" class="mb-4 text-2xl">×</button>
<a href="#" class="block mb-2 hover:underline" onclick="loadPage('about')">About</a>
<a href="#" class="block mb-2 hover:underline" onclick="loadPage('account')">Account</a>
</div>
<div class="flex flex-col min-h-screen">
<header class="bg-gradient-to-r from-green-500 to-blue-500 p-4 text-white">
<div class="container mx-auto flex justify-between items-center">
<button id="menu-toggle" class="text-2xl">☰</button>
<h1 class="text-3xl font-bold">ApproVideo</h1>
<div class="flex items-center">
<button id="theme-toggle" class="text-2xl mr-4">
<i class="fas fa-sun" id="theme-toggle-light-icon"></i>
<i class="fas fa-moon hidden" id="theme-toggle-dark-icon"></i>
</button>
</div>
</div>
</header>
<main class="flex-grow container mx-auto px-4 py-8">
<div class="mb-4 text-center">
<div class="subheader">Appropriate Technology Videos for the DIY Sector</div>
</div>
<div class="mb-4 flex justify-center space-x-4 category-links">
</div>
<div class="mb-4">
<input type="text" id="search" placeholder="Search videos..." class="w-full p-2 border rounded dark:bg-gray-700 dark:text-white">
</div>
<div id="categories" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"></div>
<div id="page-content" class="mt-8 hidden"></div>
</main>
<footer class="bg-gray-200 dark:bg-gray-800 p-4 text-center">
<p>© 2024 ApproVideo. All rights reserved.</p>
</footer>
</div>
<div id="video-detail" class="fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full hidden">
<div class="relative top-20 mx-auto p-5 border w-11/12 md:w-3/4 lg:w-1/2 shadow-lg rounded-md bg-white dark:bg-gray-800">
<div id="video-content"></div>
<div class="text-center mt-4">
<button id="close-detail" class="px-4 py-2 bg-gray-500 text-white text-base font-medium rounded-md shadow-sm hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-300">
Close
</button>
</div>
</div>
</div>
<script>
const videoData = [
{
"id": "1",
"title": "DIY Gravity-Based Water Filter",
"categories": ["Drinking Water", "Health"],
"description": "A simple gravity water filter using easily sourced materials like sand, gravel, and activated charcoal.",
"youtubeId": "v6O6jFs5DrQ",
"tags": ["water", "filter", "DIY", "purification"],
"rating": 4.5,
"date": "2023-05-15",
"transcript": "This is a dummy transcript for the DIY Gravity-Based Water Filter video...",
"materials": ["Sand", "Gravel", "Activated Charcoal", "Large Plastic Containers", "PVC Pipe"],
"steps": [
"Prepare the containers",
"Layer the filtering materials",
"Set up the water flow system",
"Test the filter",
"Maintain and clean regularly"
]
},
// ... (rest of the video data) ...
];
// ... (rest of your existing JavaScript code) ...
// Add the missing renderCategoryLinks function here
function renderCategoryLinks(videos) {
const uniqueCategories = [...new Set(videos.flatMap(video => video.categories))];
const categoriesContainer = document.querySelector('.category-links');
categoriesContainer.innerHTML = uniqueCategories.map(category => `
<a href="#" class="category-link flex items-center p-2 text-base font-normal rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700" data-category="${category}">
<i class="fas fa-tint w-6 h-6 text-blue-500"></i>
<span class="ml-3">${category}</span>
</a>
`).join('');
// Attach event listeners after rendering
document.querySelectorAll('.category-link').forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
const category = this.getAttribute('data-category');
history.pushState(null, '', `?category=${category}`);
filterAndSortVideos();
});
});
}
// Call renderCategoryLinks when the page loads
renderCategoryLinks(videoData);
// ... (rest of your JavaScript code) ...
</script>
</body>
</html>