Update index.html
Browse files- index.html +2 -21
index.html
CHANGED
@@ -227,17 +227,6 @@
|
|
227 |
"aiqtech/FLUX-Ghibli-Studio-LoRA": "https://huggingface.co/spaces/aiqtech/FLUX-Ghibli-Studio-LoRA",
|
228 |
"aiqtech/flxgif": "https://huggingface.co/spaces/aiqtech/flxgif",
|
229 |
"aiqtech/imaginpaint": "https://huggingface.co/spaces/aiqtech/imaginpaint"
|
230 |
-
};
|
231 |
-
|
232 |
-
// 2. URL ๋ณํ ํจ์: "https://huggingface.co/spaces/{namespace}/{project}" โ "https://{namespace}-{project}.hf.space"
|
233 |
-
function transformUrl(url) {
|
234 |
-
const prefix = "https://huggingface.co/spaces/";
|
235 |
-
if (url.startsWith(prefix)) {
|
236 |
-
const rest = url.substring(prefix.length);
|
237 |
-
return "https://" + rest.replace("/", "-") + ".hf.space";
|
238 |
-
}
|
239 |
-
return url;
|
240 |
-
}
|
241 |
|
242 |
|
243 |
// 3. ์ฌ์ฉ์ ๊ฐ๋ณ ์ง์ ์ฉ ๊ฐ์ฒด
|
@@ -381,14 +370,9 @@
|
|
381 |
}
|
382 |
|
383 |
// 4. ๊ฐ ํญ๋ชฉ์ ์นดํ
๊ณ ๋ฆฌ๋ฅผ customCategories์์ ์ง์ ๋ ๊ฐ์ด ์์ผ๋ฉด ์ฌ์ฉํ๊ณ , ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ "Image Gen" ์ฌ์ฉ
|
384 |
-
// ํ๋ก์ ํธ ์ด๋ฆ์ "๊ธฐ๋ณธ์นดํ
๊ณ ๋ฆฌ/ํ๋ก์ ํธ๋ช
" ํํ๋ก ํ์ํฉ๋๋ค.
|
385 |
const keys = Object.keys(projectList);
|
386 |
const projects = keys.map((key) => {
|
387 |
-
// ๊ธฐ๋ณธ ์นดํ
๊ณ ๋ฆฌ (customCategories์ ์ง์ ๋ ๊ฐ์ด ์์ผ๋ฉด ์ฌ์ฉ, ์์ผ๋ฉด "Image Gen")
|
388 |
let primaryCategory = customCategories[key] || "Image Gen";
|
389 |
-
|
390 |
-
// NEW์ BEST ์นดํ
๊ณ ๋ฆฌ๋ ๋ณ๋๋ก ์ถ๊ฐํ ์ ์๋๋ก ํฉ๋๋ค.
|
391 |
-
// ์์: ๋ง์ฝ ์๋ key์ ๋ณ๋๋ก "_NEW"๋ "_BEST"๊ฐ ๋ถ์ ํค๊ฐ ์๋ค๋ฉด ์ด๋ฅผ NEW ๋๋ BEST๋ก ์ฒ๋ฆฌํฉ๋๋ค.
|
392 |
let categories = [primaryCategory];
|
393 |
if (key.endsWith("_NEW")) {
|
394 |
categories.push("NEW");
|
@@ -396,13 +380,10 @@
|
|
396 |
if (key.endsWith("_BEST")) {
|
397 |
categories.push("BEST");
|
398 |
}
|
399 |
-
|
400 |
-
// ์๋ ํ๋ก์ ํธ๋ช
์ key์์ "/" ์ดํ ๋ถ๋ถ์ ์ฌ์ฉ (๋จ, NEW/BEST ์์๋ ๊ทธ๋๋ก ์ฌ์ฉ)
|
401 |
let projectName = key;
|
402 |
if (!key.endsWith("_NEW") && !key.endsWith("_BEST")) {
|
403 |
projectName = key.split("/").slice(1).join("/");
|
404 |
}
|
405 |
-
|
406 |
return {
|
407 |
name: primaryCategory + "/" + projectName,
|
408 |
url: transformUrl(projectList[key]),
|
@@ -421,7 +402,7 @@
|
|
421 |
});
|
422 |
});
|
423 |
|
424 |
-
// 6. ํํฐ
|
425 |
const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
|
426 |
const filterGroupDiv = document.getElementById("filter-group");
|
427 |
const allButton = document.createElement("button");
|
@@ -437,7 +418,7 @@
|
|
437 |
filterGroupDiv.appendChild(btn);
|
438 |
});
|
439 |
|
440 |
-
// 7. ์ฌ์ด๋๋ฐ ์
๋ฐ์ดํธ ํจ์: ์ ํํ ํํฐ์
|
441 |
function updateSidebar(filter) {
|
442 |
const sidebar = document.getElementById("sidebar");
|
443 |
sidebar.innerHTML = "";
|
|
|
227 |
"aiqtech/FLUX-Ghibli-Studio-LoRA": "https://huggingface.co/spaces/aiqtech/FLUX-Ghibli-Studio-LoRA",
|
228 |
"aiqtech/flxgif": "https://huggingface.co/spaces/aiqtech/flxgif",
|
229 |
"aiqtech/imaginpaint": "https://huggingface.co/spaces/aiqtech/imaginpaint"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
|
231 |
|
232 |
// 3. ์ฌ์ฉ์ ๊ฐ๋ณ ์ง์ ์ฉ ๊ฐ์ฒด
|
|
|
370 |
}
|
371 |
|
372 |
// 4. ๊ฐ ํญ๋ชฉ์ ์นดํ
๊ณ ๋ฆฌ๋ฅผ customCategories์์ ์ง์ ๋ ๊ฐ์ด ์์ผ๋ฉด ์ฌ์ฉํ๊ณ , ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ "Image Gen" ์ฌ์ฉ
|
|
|
373 |
const keys = Object.keys(projectList);
|
374 |
const projects = keys.map((key) => {
|
|
|
375 |
let primaryCategory = customCategories[key] || "Image Gen";
|
|
|
|
|
|
|
376 |
let categories = [primaryCategory];
|
377 |
if (key.endsWith("_NEW")) {
|
378 |
categories.push("NEW");
|
|
|
380 |
if (key.endsWith("_BEST")) {
|
381 |
categories.push("BEST");
|
382 |
}
|
|
|
|
|
383 |
let projectName = key;
|
384 |
if (!key.endsWith("_NEW") && !key.endsWith("_BEST")) {
|
385 |
projectName = key.split("/").slice(1).join("/");
|
386 |
}
|
|
|
387 |
return {
|
388 |
name: primaryCategory + "/" + projectName,
|
389 |
url: transformUrl(projectList[key]),
|
|
|
402 |
});
|
403 |
});
|
404 |
|
405 |
+
// 6. ํํฐ ๋ฒํผ ์์ฑ (๋ฏธ๋ฆฌ ์ ์ํ 10๊ฐ์ง ๊ทธ๋ฃน ๋ฐ All)
|
406 |
const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
|
407 |
const filterGroupDiv = document.getElementById("filter-group");
|
408 |
const allButton = document.createElement("button");
|
|
|
418 |
filterGroupDiv.appendChild(btn);
|
419 |
});
|
420 |
|
421 |
+
// 7. ์ฌ์ด๋๋ฐ ์
๋ฐ์ดํธ ํจ์: ์ ํํ ํํฐ์ ํญ๋ชฉ ์ถ๋ ฅ (ํด๋น ํญ๋ชฉ์ categories ๋ฐฐ์ด์ ์ ํํ ํํฐ๊ฐ ํฌํจ๋์ด ์์ผ๋ฉด ํ์)
|
422 |
function updateSidebar(filter) {
|
423 |
const sidebar = document.getElementById("sidebar");
|
424 |
sidebar.innerHTML = "";
|