Spaces:
Running
Running
Update index.html
Browse files- index.html +2 -48
index.html
CHANGED
@@ -222,25 +222,7 @@
|
|
222 |
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
223 |
|
224 |
<script type="text/babel">
|
225 |
-
const { useState
|
226 |
-
|
227 |
-
const StarBackground = () => {
|
228 |
-
useEffect(() => {
|
229 |
-
const starsContainer = document.querySelector('.stars');
|
230 |
-
const starCount = 200;
|
231 |
-
|
232 |
-
for (let i = 0; i < starCount; i++) {
|
233 |
-
const star = document.createElement('div');
|
234 |
-
star.classList.add('star');
|
235 |
-
star.style.left = `${Math.random() * 100}%`;
|
236 |
-
star.style.top = `${Math.random() * 100}%`;
|
237 |
-
star.style.animationDelay = `${Math.random() * 2}s`;
|
238 |
-
starsContainer.appendChild(star);
|
239 |
-
}
|
240 |
-
}, []);
|
241 |
-
|
242 |
-
return null;
|
243 |
-
};
|
244 |
|
245 |
const App = () => {
|
246 |
const videos = [
|
@@ -253,42 +235,14 @@
|
|
253 |
{ src: 'videos/Insta-VID1 (8).mp4', tag: ['After Effects'] },
|
254 |
];
|
255 |
|
256 |
-
const [filter, setFilter] = useState('all');
|
257 |
-
const [filteredVideos, setFilteredVideos] = useState(videos);
|
258 |
-
|
259 |
-
useEffect(() => {
|
260 |
-
setFilteredVideos(
|
261 |
-
filter === 'all'
|
262 |
-
? videos
|
263 |
-
: videos.filter(video => video.tag.includes(filter))
|
264 |
-
);
|
265 |
-
}, [filter]);
|
266 |
-
|
267 |
-
const uniqueTags = ['all', ...new Set(videos.flatMap(v => v.tag))];
|
268 |
-
|
269 |
return (
|
270 |
<>
|
271 |
-
<StarBackground />
|
272 |
<header>
|
273 |
<h1>Calvin Allen-Crawford's Gen AI Gallery</h1>
|
274 |
-
<div className="filters">
|
275 |
-
{uniqueTags.map(tag => (
|
276 |
-
<button
|
277 |
-
key={tag}
|
278 |
-
onClick={() => setFilter(tag)}
|
279 |
-
style={{
|
280 |
-
fontWeight: filter === tag ? 'bold' : 'normal',
|
281 |
-
backgroundColor: filter === tag ? 'rgba(0,255,255,0.2)' : 'transparent'
|
282 |
-
}}
|
283 |
-
>
|
284 |
-
{tag}
|
285 |
-
</button>
|
286 |
-
))}
|
287 |
-
</div>
|
288 |
</header>
|
289 |
<main>
|
290 |
<div className="gallery">
|
291 |
-
{
|
292 |
<div className="video-card" key={index}>
|
293 |
<video controls>
|
294 |
<source src={video.src} type="video/mp4" />
|
|
|
222 |
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
223 |
|
224 |
<script type="text/babel">
|
225 |
+
const { useState } = React;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
const App = () => {
|
228 |
const videos = [
|
|
|
235 |
{ src: 'videos/Insta-VID1 (8).mp4', tag: ['After Effects'] },
|
236 |
];
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
return (
|
239 |
<>
|
|
|
240 |
<header>
|
241 |
<h1>Calvin Allen-Crawford's Gen AI Gallery</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
</header>
|
243 |
<main>
|
244 |
<div className="gallery">
|
245 |
+
{videos.map((video, index) => (
|
246 |
<div className="video-card" key={index}>
|
247 |
<video controls>
|
248 |
<source src={video.src} type="video/mp4" />
|