maringetxway commited on
Commit
51dc661
Β·
verified Β·
1 Parent(s): 6f1fb0d

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +50 -61
index.html CHANGED
@@ -16,35 +16,39 @@
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=LeRobot-worldwide-hackathon")
43
  .then(res => res.json())
44
  .then(data => {
45
  const map = {};
46
  data.forEach(entry => {
47
- const match = entry.id.match(/LeRobot-worldwide-hackathon\/team[_-]?(\d+)/i);
48
  if (match) {
49
  const team = match[1];
50
  if (!map[team]) map[team] = [];
@@ -54,77 +58,63 @@
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,7 +128,6 @@
138
  ))
139
  );
140
  }
141
-
142
  ReactDOM.createRoot(document.getElementById("root")).render(React.createElement(App));
143
  </script>
144
  </body>
 
16
  <div id="root"></div>
17
 
18
  <script type="text/javascript">
19
+ const {
20
+ useEffect,
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 => {
49
  const map = {};
50
  data.forEach(entry => {
51
+ const match = entry.id.match(/maringetxway\/team[_-]?(\d+)/i);
52
  if (match) {
53
  const team = match[1];
54
  if (!map[team]) map[team] = [];
 
58
  setTeamDatasets(map);
59
  });
60
  }, []);
61
+ return React.createElement("div", {
62
+ className: "min-h-screen p-6",
63
+ style: {
64
+ backgroundColor: "#3A3B3C" // Dark gray color
65
+ }
66
+ },
 
 
 
 
 
 
67
  React.createElement("style", {
68
  dangerouslySetInnerHTML: {
69
  __html: `
70
+ @keyframes gradientBG {
71
+ 0% { background-position: 0% 50%; }
72
+ 50% { background-position: 100% 50%; }
73
+ 100% { background-position: 0% 50%; }
74
+ }
75
+ `
76
  }
77
  }),
78
+ React.createElement("h1", {
79
+ className: "text-3xl font-bold mb-2 text-center text-white" // Added text-white
80
+ },
81
+ "LeRobot Worldwide Hackathon"
82
+ ),
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 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"
100
+ },
101
  React.createElement("video", {
102
  src: video.url,
103
  controls: true,
 
 
 
 
104
  className: "w-full h-auto"
105
  }),
106
  React.createElement("div", {
107
+ className: "p-2 text-center text-sm font-medium text-gray"
108
+ },
109
  video.label,
110
  video.team && teamDatasets[video.team] &&
111
  React.createElement("div", {
112
+ className: "mt-1 space-y-1"
113
+ },
114
  teamDatasets[video.team].map((url, j) =>
115
  React.createElement("div", {
116
+ key: j
117
+ },
118
  React.createElement("a", {
119
  href: url,
120
  className: "text-blue-500 underline",
 
128
  ))
129
  );
130
  }
 
131
  ReactDOM.createRoot(document.getElementById("root")).render(React.createElement(App));
132
  </script>
133
  </body>