Update index.html
Browse files- index.html +18 -9
index.html
CHANGED
@@ -92,7 +92,7 @@
|
|
92 |
<a href="https://discord.gg/openfreeai" target="_blank">Community</a>
|
93 |
</div>
|
94 |
|
95 |
-
<!-- ํํฐ ๋ฒํผ ์์ญ (๋ฏธ๋ฆฌ ์ ์ํ 10๊ฐ์ง ๊ทธ๋ฃน
|
96 |
<div class="filter-group" id="filter-group">
|
97 |
<!-- JavaScript๋ก ๋์ ์ผ๋ก ๋ฒํผ ์์ฑ -->
|
98 |
</div>
|
@@ -241,18 +241,27 @@
|
|
241 |
return url;
|
242 |
}
|
243 |
|
244 |
-
// 3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
const keys = Object.keys(projectList);
|
246 |
const projects = keys.map((key) => {
|
|
|
247 |
const projectName = key.split("/").slice(1).join("/");
|
248 |
return {
|
249 |
-
name: "
|
250 |
url: transformUrl(projectList[key]),
|
251 |
-
category:
|
252 |
};
|
253 |
});
|
254 |
|
255 |
-
//
|
256 |
const grouped = {};
|
257 |
projects.forEach(project => {
|
258 |
const cat = project.category;
|
@@ -262,7 +271,7 @@
|
|
262 |
grouped[cat].push(project);
|
263 |
});
|
264 |
|
265 |
-
//
|
266 |
const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
|
267 |
const filterGroupDiv = document.getElementById("filter-group");
|
268 |
const allButton = document.createElement("button");
|
@@ -278,7 +287,7 @@
|
|
278 |
filterGroupDiv.appendChild(btn);
|
279 |
});
|
280 |
|
281 |
-
//
|
282 |
function updateSidebar(filter) {
|
283 |
const sidebar = document.getElementById("sidebar");
|
284 |
sidebar.innerHTML = "";
|
@@ -300,7 +309,7 @@
|
|
300 |
}
|
301 |
}
|
302 |
|
303 |
-
//
|
304 |
document.querySelectorAll(".toggle-button").forEach(button => {
|
305 |
button.addEventListener("click", function() {
|
306 |
document.querySelectorAll(".toggle-button").forEach(btn => btn.classList.remove("active"));
|
@@ -309,7 +318,7 @@
|
|
309 |
});
|
310 |
});
|
311 |
|
312 |
-
//
|
313 |
updateSidebar("all");
|
314 |
</script>
|
315 |
</body>
|
|
|
92 |
<a href="https://discord.gg/openfreeai" target="_blank">Community</a>
|
93 |
</div>
|
94 |
|
95 |
+
<!-- ํํฐ ๋ฒํผ ์์ญ (๋ฏธ๋ฆฌ ์ ์ํ 10๊ฐ์ง ๊ทธ๋ฃน ์ฌ์ฉ: NEW, BEST, Text, Image Gen, Image Edit, Audio, Video, Productivity, Utility, Vision) -->
|
96 |
<div class="filter-group" id="filter-group">
|
97 |
<!-- JavaScript๋ก ๋์ ์ผ๋ก ๋ฒํผ ์์ฑ -->
|
98 |
</div>
|
|
|
241 |
return url;
|
242 |
}
|
243 |
|
244 |
+
// 3. ์ฌ์ฉ์ ๊ฐ๋ณ ์ง์ ์ฉ ๊ฐ์ฒด (์ํ๋ ๊ฒฝ์ฐ ํญ๋ชฉ๋ณ ์นดํ
๊ณ ๋ฆฌ๋ฅผ ์ง์ ์ง์ ํ ์ ์์ต๋๋ค)
|
245 |
+
// ํค๋ ์๋ ํ๋ก์ ํธ ํค๋ฅผ ์ฌ์ฉํ๊ณ , ๊ฐ์ ์ํ๋ ์นดํ
๊ณ ๋ฆฌ๋ก ์ง์ ํ์ธ์.
|
246 |
+
const customCategories = {
|
247 |
+
// ์: "fantos/x-mas": "Image Gen"
|
248 |
+
// ํ์์ ๋ฐ๋ผ ์ฌ๊ธฐ์ ํญ๋ชฉ๋ณ๋ก ์ง์ ํ ์ ์์ต๋๋ค.
|
249 |
+
};
|
250 |
+
|
251 |
+
// 4. ๊ฐ ํญ๋ชฉ์ ์นดํ
๊ณ ๋ฆฌ๋ฅผ customCategories์์ ์ง์ ๋ ๊ฐ์ด ์์ผ๋ฉด ์ฌ์ฉํ๊ณ , ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ "Image Gen"์ ์ฌ์ฉํ์ฌ
|
252 |
+
// ํ๋ก์ ํธ ์ด๋ฆ์ "์นดํ
๊ณ ๋ฆฌ/ํ๋ก์ ํธ๋ช
" ํํ๋ก ๋ณ๊ฒฝํฉ๋๋ค.
|
253 |
const keys = Object.keys(projectList);
|
254 |
const projects = keys.map((key) => {
|
255 |
+
const category = customCategories[key] || "Image Gen";
|
256 |
const projectName = key.split("/").slice(1).join("/");
|
257 |
return {
|
258 |
+
name: category + "/" + projectName,
|
259 |
url: transformUrl(projectList[key]),
|
260 |
+
category: category
|
261 |
};
|
262 |
});
|
263 |
|
264 |
+
// 5. (๋ชจ๋ ํญ๋ชฉ์ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ฐ๋ณ ์ง์ ๋๋๋ผ๋ ํํฐ๋ฅผ ์ํด) ์นดํ
๊ณ ๋ฆฌ๋ณ ๊ทธ๋ฃนํ
|
265 |
const grouped = {};
|
266 |
projects.forEach(project => {
|
267 |
const cat = project.category;
|
|
|
271 |
grouped[cat].push(project);
|
272 |
});
|
273 |
|
274 |
+
// 6. ํํฐ ๋ฒํผ์ ๋ฏธ๋ฆฌ ์ ์ํ 10๊ฐ์ง ๊ทธ๋ฃน(NEW, BEST, Text, Image Gen, Image Edit, Audio, Video, Productivity, Utility, Vision)๊ณผ All ๋ฒํผ์ผ๋ก ์์ฑ
|
275 |
const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
|
276 |
const filterGroupDiv = document.getElementById("filter-group");
|
277 |
const allButton = document.createElement("button");
|
|
|
287 |
filterGroupDiv.appendChild(btn);
|
288 |
});
|
289 |
|
290 |
+
// 7. ์ฌ์ด๋๋ฐ ์
๋ฐ์ดํธ ํจ์: ์ ํํ ํํฐ์ ํญ๋ชฉ ์ถ๋ ฅ
|
291 |
function updateSidebar(filter) {
|
292 |
const sidebar = document.getElementById("sidebar");
|
293 |
sidebar.innerHTML = "";
|
|
|
309 |
}
|
310 |
}
|
311 |
|
312 |
+
// 8. ํํฐ ๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ ์ฒ๋ฆฌ
|
313 |
document.querySelectorAll(".toggle-button").forEach(button => {
|
314 |
button.addEventListener("click", function() {
|
315 |
document.querySelectorAll(".toggle-button").forEach(btn => btn.classList.remove("active"));
|
|
|
318 |
});
|
319 |
});
|
320 |
|
321 |
+
// 9. ํ์ด์ง ๋ก๋ ์ ๊ธฐ๋ณธ "all" ํํฐ ์ ์ฉ
|
322 |
updateSidebar("all");
|
323 |
</script>
|
324 |
</body>
|