Update index.html
Browse files- index.html +20 -39
index.html
CHANGED
|
@@ -21,25 +21,28 @@
|
|
| 21 |
useState
|
| 22 |
} = React;
|
| 23 |
function App() {
|
| 24 |
-
const [searchQuery, setSearchQuery] = useState("");
|
| 25 |
const [videos, setVideos] = useState([]);
|
| 26 |
const [teamDatasets, setTeamDatasets] = useState({});
|
| 27 |
useEffect(() => {
|
| 28 |
-
fetch("https://huggingface.co/api/
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
fetch("https://huggingface.co/api/datasets?author=maringetxway")
|
| 44 |
.then(res => res.json())
|
| 45 |
.then(data => {
|
|
@@ -83,36 +86,14 @@ fetch("https://huggingface.co/api/repos/LeRobot-worldwide-hackathon/submissions/
|
|
| 83 |
"π Worldwide", React.createElement("br", null),
|
| 84 |
"π
June 2025, 14 at 09:00 AM (UTC+2) β June 2025, 15 at 06:00 PM (UTC+2)"
|
| 85 |
),
|
| 86 |
-
|
| 87 |
React.createElement("div", {
|
| 88 |
className: "flex flex-wrap justify-center items-center gap-8 mb-10"
|
| 89 |
},
|
| 90 |
),
|
| 91 |
|
| 92 |
React.createElement("div", {
|
| 93 |
-
className: "flex justify-center mb-6"
|
| 94 |
-
},
|
| 95 |
-
|
| 96 |
-
React.createElement("input", {
|
| 97 |
-
type: "text",
|
| 98 |
-
placeholder: "Search videosβ¦",
|
| 99 |
-
className: "px-4 py-2 w-full max-w-md border rounded-md shadow-md",
|
| 100 |
-
value: searchQuery,
|
| 101 |
-
onChange: (e) => setSearchQuery(e.target.value.toLowerCase())
|
| 102 |
-
})
|
| 103 |
-
)
|
| 104 |
-
|
| 105 |
-
React.createElement("div", {
|
| 106 |
className: "columns-1 sm:columns-2 lg:columns-3 gap-4 space-y-4"
|
| 107 |
-
}, videos
|
| 108 |
-
.filter(video => {
|
| 109 |
-
return (
|
| 110 |
-
video.label.toLowerCase().includes(searchQuery) ||
|
| 111 |
-
video.url.toLowerCase().includes(searchQuery)
|
| 112 |
-
);
|
| 113 |
-
})
|
| 114 |
-
.map((video, i) =>
|
| 115 |
-
|
| 116 |
React.createElement("div", {
|
| 117 |
key: i,
|
| 118 |
className: "break-inside-avoid bg-white rounded-2xl shadow-md overflow-hidden"
|
|
|
|
| 21 |
useState
|
| 22 |
} = React;
|
| 23 |
function App() {
|
|
|
|
| 24 |
const [videos, setVideos] = useState([]);
|
| 25 |
const [teamDatasets, setTeamDatasets] = useState({});
|
| 26 |
useEffect(() => {
|
| 27 |
+
fetch("https://huggingface.co/api/datasets/LeRobot-worldwide-hackathon/submissions/tree/main")
|
| 28 |
+
.then(res => res.json())
|
| 29 |
+
.then(data => {
|
| 30 |
+
const videoFiles = data
|
| 31 |
+
.filter(file => file.path.endsWith(".mp4"))
|
| 32 |
+
.map(file => {
|
| 33 |
+
const url =
|
| 34 |
+
`https://huggingface.co/datasets/LeRobot-worldwide-hackathon/submissions/resolve/main/${encodeURIComponent(file.path)}`;
|
| 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 => {
|
|
|
|
| 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 flex-wrap justify-center items-center gap-8 mb-10"
|
| 91 |
},
|
| 92 |
),
|
| 93 |
|
| 94 |
React.createElement("div", {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
className: "columns-1 sm:columns-2 lg:columns-3 gap-4 space-y-4"
|
| 96 |
+
}, videos.map((video, i) =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
React.createElement("div", {
|
| 98 |
key: i,
|
| 99 |
className: "break-inside-avoid bg-white rounded-2xl shadow-md overflow-hidden"
|