Update index.html
Browse files- index.html +60 -48
index.html
CHANGED
|
@@ -16,33 +16,29 @@
|
|
| 16 |
<div id="root"></div>
|
| 17 |
|
| 18 |
<script type="text/javascript">
|
| 19 |
-
const {
|
| 20 |
-
|
| 21 |
-
useState
|
| 22 |
-
} = React;
|
| 23 |
function App() {
|
| 24 |
const [videos, setVideos] = useState([]);
|
| 25 |
const [teamDatasets, setTeamDatasets] = useState({});
|
|
|
|
|
|
|
| 26 |
useEffect(() => {
|
| 27 |
-
fetch("https://huggingface.co/
|
| 28 |
.then(res => res.json())
|
| 29 |
.then(data => {
|
| 30 |
-
const videoFiles = data
|
| 31 |
-
.
|
| 32 |
-
.
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
const match = file.path.match(/(?:team|group)[-_ ]?(\d+)/i);
|
| 36 |
const team = match ? match[1] : null;
|
| 37 |
const label = team ? `Team ${team}` : "Unknown Team";
|
| 38 |
-
return {
|
| 39 |
-
url,
|
| 40 |
-
label,
|
| 41 |
-
team
|
| 42 |
-
};
|
| 43 |
});
|
| 44 |
setVideos(videoFiles);
|
| 45 |
});
|
|
|
|
| 46 |
fetch("https://huggingface.co/api/datasets?author=maringetxway")
|
| 47 |
.then(res => res.json())
|
| 48 |
.then(data => {
|
|
@@ -58,63 +54,77 @@
|
|
| 58 |
setTeamDatasets(map);
|
| 59 |
});
|
| 60 |
}, []);
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
React.createElement("style", {
|
| 68 |
dangerouslySetInnerHTML: {
|
| 69 |
__html: `
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
}
|
| 77 |
}),
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
"LeRobot Worldwide Hackathon"
|
| 82 |
-
),
|
| 83 |
React.createElement("p", {
|
| 84 |
-
|
| 85 |
-
|
| 86 |
"π Worldwide", React.createElement("br", null),
|
| 87 |
"π
June 2025, 14 at 09:00 AM (UTC+2) β June 2025, 15 at 06:00 PM (UTC+2)"
|
| 88 |
),
|
| 89 |
React.createElement("div", {
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
),
|
| 93 |
-
|
| 94 |
React.createElement("div", {
|
| 95 |
className: "columns-1 sm:columns-2 lg:columns-3 gap-4 space-y-4"
|
| 96 |
-
},
|
| 97 |
React.createElement("div", {
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
React.createElement("video", {
|
| 102 |
src: video.url,
|
| 103 |
controls: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
className: "w-full h-auto"
|
| 105 |
}),
|
| 106 |
React.createElement("div", {
|
| 107 |
-
|
| 108 |
-
|
| 109 |
video.label,
|
| 110 |
video.team && teamDatasets[video.team] &&
|
| 111 |
React.createElement("div", {
|
| 112 |
-
|
| 113 |
-
|
| 114 |
teamDatasets[video.team].map((url, j) =>
|
| 115 |
React.createElement("div", {
|
| 116 |
-
|
| 117 |
-
|
| 118 |
React.createElement("a", {
|
| 119 |
href: url,
|
| 120 |
className: "text-blue-500 underline",
|
|
@@ -128,9 +138,11 @@
|
|
| 128 |
))
|
| 129 |
);
|
| 130 |
}
|
|
|
|
| 131 |
ReactDOM.createRoot(document.getElementById("root")).render(React.createElement(App));
|
| 132 |
</script>
|
| 133 |
</body>
|
| 134 |
|
| 135 |
</html>
|
| 136 |
|
|
|
|
|
|
| 16 |
<div id="root"></div>
|
| 17 |
|
| 18 |
<script type="text/javascript">
|
| 19 |
+
const { useEffect, useState } = React;
|
| 20 |
+
|
|
|
|
|
|
|
| 21 |
function App() {
|
| 22 |
const [videos, setVideos] = useState([]);
|
| 23 |
const [teamDatasets, setTeamDatasets] = useState({});
|
| 24 |
+
const [searchQuery, setSearchQuery] = useState("");
|
| 25 |
+
|
| 26 |
useEffect(() => {
|
| 27 |
+
fetch("https://datasets-server.huggingface.co/rows?dataset=LeRobot-worldwide-hackathon%2Fsubmissions&config=default&split=train&offset=0&limit=100")
|
| 28 |
.then(res => res.json())
|
| 29 |
.then(data => {
|
| 30 |
+
const videoFiles = data.rows
|
| 31 |
+
.map(row => row.row.video)
|
| 32 |
+
.filter(url => typeof url === "string" && url.endsWith(".mp4"))
|
| 33 |
+
.map(url => {
|
| 34 |
+
const match = url.match(/(?:team|group)[-_ ]?(\d+)/i);
|
|
|
|
| 35 |
const team = match ? match[1] : null;
|
| 36 |
const label = team ? `Team ${team}` : "Unknown Team";
|
| 37 |
+
return { url, label, team };
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
});
|
| 39 |
setVideos(videoFiles);
|
| 40 |
});
|
| 41 |
+
|
| 42 |
fetch("https://huggingface.co/api/datasets?author=maringetxway")
|
| 43 |
.then(res => res.json())
|
| 44 |
.then(data => {
|
|
|
|
| 54 |
setTeamDatasets(map);
|
| 55 |
});
|
| 56 |
}, []);
|
| 57 |
+
|
| 58 |
+
const filteredVideos = videos.filter(video => {
|
| 59 |
+
return (
|
| 60 |
+
video.label.toLowerCase().includes(searchQuery) ||
|
| 61 |
+
video.url.toLowerCase().includes(searchQuery)
|
| 62 |
+
);
|
| 63 |
+
});
|
| 64 |
+
|
| 65 |
+
return React.createElement("div", {
|
| 66 |
+
className: "min-h-screen p-6",
|
| 67 |
+
style: { backgroundColor: "#3A3B3C" }
|
| 68 |
+
},
|
| 69 |
React.createElement("style", {
|
| 70 |
dangerouslySetInnerHTML: {
|
| 71 |
__html: `
|
| 72 |
+
@keyframes gradientBG {
|
| 73 |
+
0% { background-position: 0% 50%; }
|
| 74 |
+
50% { background-position: 100% 50%; }
|
| 75 |
+
100% { background-position: 0% 50%; }
|
| 76 |
+
}
|
| 77 |
+
`
|
| 78 |
}
|
| 79 |
}),
|
| 80 |
+
React.createElement("h1", {
|
| 81 |
+
className: "text-3xl font-bold mb-2 text-center text-white"
|
| 82 |
+
}, "LeRobot Worldwide Hackathon"),
|
|
|
|
|
|
|
| 83 |
React.createElement("p", {
|
| 84 |
+
className: "text-white text-center mb-6"
|
| 85 |
+
},
|
| 86 |
"π Worldwide", React.createElement("br", null),
|
| 87 |
"π
June 2025, 14 at 09:00 AM (UTC+2) β June 2025, 15 at 06:00 PM (UTC+2)"
|
| 88 |
),
|
| 89 |
React.createElement("div", {
|
| 90 |
+
className: "flex justify-center mb-6"
|
| 91 |
+
},
|
| 92 |
+
React.createElement("input", {
|
| 93 |
+
type: "text",
|
| 94 |
+
placeholder: "Search videosβ¦",
|
| 95 |
+
className: "px-4 py-2 w-full max-w-md border rounded-md shadow-md",
|
| 96 |
+
value: searchQuery,
|
| 97 |
+
onChange: (e) => setSearchQuery(e.target.value.toLowerCase())
|
| 98 |
+
})
|
| 99 |
),
|
|
|
|
| 100 |
React.createElement("div", {
|
| 101 |
className: "columns-1 sm:columns-2 lg:columns-3 gap-4 space-y-4"
|
| 102 |
+
}, filteredVideos.map((video, i) =>
|
| 103 |
React.createElement("div", {
|
| 104 |
+
key: i,
|
| 105 |
+
className: "break-inside-avoid bg-white rounded-2xl shadow-md overflow-hidden"
|
| 106 |
+
},
|
| 107 |
React.createElement("video", {
|
| 108 |
src: video.url,
|
| 109 |
controls: true,
|
| 110 |
+
autoplay: true,
|
| 111 |
+
muted: true,
|
| 112 |
+
loop: true,
|
| 113 |
+
playsInline: true,
|
| 114 |
className: "w-full h-auto"
|
| 115 |
}),
|
| 116 |
React.createElement("div", {
|
| 117 |
+
className: "p-2 text-center text-sm font-medium text-gray-700"
|
| 118 |
+
},
|
| 119 |
video.label,
|
| 120 |
video.team && teamDatasets[video.team] &&
|
| 121 |
React.createElement("div", {
|
| 122 |
+
className: "mt-1 space-y-1"
|
| 123 |
+
},
|
| 124 |
teamDatasets[video.team].map((url, j) =>
|
| 125 |
React.createElement("div", {
|
| 126 |
+
key: j
|
| 127 |
+
},
|
| 128 |
React.createElement("a", {
|
| 129 |
href: url,
|
| 130 |
className: "text-blue-500 underline",
|
|
|
|
| 138 |
))
|
| 139 |
);
|
| 140 |
}
|
| 141 |
+
|
| 142 |
ReactDOM.createRoot(document.getElementById("root")).render(React.createElement(App));
|
| 143 |
</script>
|
| 144 |
</body>
|
| 145 |
|
| 146 |
</html>
|
| 147 |
|
| 148 |
+
|