Spaces:
Running
Running
Update index.html
Browse files- index.html +3 -23
index.html
CHANGED
@@ -118,13 +118,12 @@
|
|
118 |
<script>
|
119 |
// 1. ํ๋ก์ ํธ URL ๋ชฉ๋ก: ํ๋ก์ ํธ ์ด๋ฆ -> URL
|
120 |
const projectList = {
|
121 |
-
|
122 |
"ginigen/Design": "https://huggingface.co/spaces/ginigen/Design",
|
123 |
"ginigen/Diagram": "https://huggingface.co/spaces/ginigen/Diagram",
|
124 |
"ginigen/Mockup": "https://huggingface.co/spaces/ginigen/Mockup",
|
125 |
"ginigen/Infographic": "https://huggingface.co/spaces/ginigen/Infographic",
|
126 |
"ginigen/Flowchart": "https://huggingface.co/spaces/ginigen/Flowchart",
|
127 |
-
|
128 |
"aiqcamp/FLUX-Vision": "https://huggingface.co/spaces/aiqcamp/FLUX-Vision",
|
129 |
"ginigen/VoiceClone-TTS": "https://huggingface.co/spaces/ginigen/VoiceClone-TTS",
|
130 |
"fantos/Panorama": "https://huggingface.co/spaces/fantos/Panorama",
|
@@ -241,9 +240,9 @@
|
|
241 |
"aiqtech/flxgif": "https://huggingface.co/spaces/aiqtech/flxgif",
|
242 |
"aiqtech/imaginpaint": "https://huggingface.co/spaces/aiqtech/imaginpaint"
|
243 |
};
|
244 |
-
|
245 |
// 2. ๋ณ๋ ๊ฐ์ฒด: ํ๋ก์ ํธ์ ๊ฐ๋ณ ์นดํ
๊ณ ๋ฆฌ ์ง์ (์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ "Image Gen" ์ฌ์ฉ)
|
246 |
const customCategories = {
|
|
|
247 |
"ginigen/Design": "Productivity",
|
248 |
"ginigen/Diagram": "Productivity",
|
249 |
"ginigen/Mockup": "Productivity",
|
@@ -368,9 +367,7 @@
|
|
368 |
"aiqtech/flxgif": "Image Gen",
|
369 |
"aiqtech/imaginpaint": "Image Edit"
|
370 |
|
371 |
-
|
372 |
};
|
373 |
-
|
374 |
const newProjects = [
|
375 |
"ginigen/Design",
|
376 |
"ginigen/Diagram",
|
@@ -441,8 +438,8 @@ const newProjects = [
|
|
441 |
"ginigen/cartoon",
|
442 |
"ginigen/Book-Cover"
|
443 |
];
|
444 |
-
|
445 |
const bestProjects = [
|
|
|
446 |
"ginigen/VoiceClone-TTS",
|
447 |
"openfree/VisionOCR-Chat",
|
448 |
"ginigen/3D-LLAMA",
|
@@ -477,8 +474,6 @@ const bestProjects = [
|
|
477 |
"ginigen/FLUXllama-Multilingual",
|
478 |
"ginipick/FitGen"
|
479 |
];
|
480 |
-
|
481 |
-
|
482 |
// 4. URL ๋ณํ ํจ์
|
483 |
function transformUrl(url) {
|
484 |
const prefix = "https://huggingface.co/spaces/";
|
@@ -488,7 +483,6 @@ const bestProjects = [
|
|
488 |
}
|
489 |
return url;
|
490 |
}
|
491 |
-
|
492 |
// 5. ํ๋ก์ ํธ ๋ฐฐ์ด ์์ฑ
|
493 |
const keys = Object.keys(projectList);
|
494 |
const projects = keys.map(key => {
|
@@ -497,14 +491,12 @@ const bestProjects = [
|
|
497 |
|
498 |
if (newProjects.includes(key)) categories.push("NEW");
|
499 |
if (bestProjects.includes(key)) categories.push("BEST");
|
500 |
-
|
501 |
return {
|
502 |
name: primaryCategory + "/" + key.split("/")[1],
|
503 |
url: transformUrl(projectList[key]),
|
504 |
categories: categories
|
505 |
};
|
506 |
});
|
507 |
-
|
508 |
// 6. ์นดํ
๊ณ ๋ฆฌ๋ณ ๊ทธ๋ฃนํ
|
509 |
const grouped = {};
|
510 |
projects.forEach(proj => {
|
@@ -513,17 +505,14 @@ const bestProjects = [
|
|
513 |
grouped[cat].push(proj);
|
514 |
});
|
515 |
});
|
516 |
-
|
517 |
// 7. ํํฐ ๋ฒํผ ์์ฑ
|
518 |
const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
|
519 |
const filterGroupDiv = document.getElementById("filter-group");
|
520 |
-
|
521 |
const allButton = document.createElement("button");
|
522 |
allButton.className = "toggle-button active";
|
523 |
allButton.setAttribute("data-filter", "all");
|
524 |
allButton.textContent = "All";
|
525 |
filterGroupDiv.appendChild(allButton);
|
526 |
-
|
527 |
fixedGroups.forEach(category => {
|
528 |
const btn = document.createElement("button");
|
529 |
btn.className = "toggle-button";
|
@@ -531,7 +520,6 @@ const bestProjects = [
|
|
531 |
btn.textContent = category;
|
532 |
filterGroupDiv.appendChild(btn);
|
533 |
});
|
534 |
-
|
535 |
// 8. ์ฌ์ด๋๋ฐ ๊ฐฑ์ ํจ์
|
536 |
function updateSidebar(filter) {
|
537 |
const sidebar = document.getElementById("sidebar");
|
@@ -539,16 +527,13 @@ const bestProjects = [
|
|
539 |
let items = (filter === "all")
|
540 |
? projects
|
541 |
: projects.filter(p => p.categories.includes(filter));
|
542 |
-
|
543 |
const ul = document.createElement("ul");
|
544 |
items.forEach(item => {
|
545 |
const li = document.createElement("li");
|
546 |
-
|
547 |
// ์ด๋ฆ ํ์
|
548 |
const nameSpan = document.createElement("span");
|
549 |
nameSpan.textContent = item.name;
|
550 |
li.appendChild(nameSpan);
|
551 |
-
|
552 |
// "๋งํฌ ํด๋ฆญ" ๋ฒํผ
|
553 |
const linkButton = document.createElement("button");
|
554 |
linkButton.textContent = "๋งํฌ ํด๋ฆญ";
|
@@ -557,23 +542,19 @@ const bestProjects = [
|
|
557 |
window.open(item.url, "_blank"); // ์ ํญ(์ฐฝ) ์ด๊ธฐ
|
558 |
});
|
559 |
li.appendChild(linkButton);
|
560 |
-
|
561 |
// li ์์ฒด ํด๋ฆญํ๋ฉด iframe ๋ณ๊ฒฝ
|
562 |
li.addEventListener("click", () => {
|
563 |
document.getElementById("embed-frame").src = item.url;
|
564 |
});
|
565 |
-
|
566 |
ul.appendChild(li);
|
567 |
});
|
568 |
sidebar.appendChild(ul);
|
569 |
-
|
570 |
if (items.length > 0) {
|
571 |
document.getElementById("embed-frame").src = items[0].url;
|
572 |
} else {
|
573 |
document.getElementById("embed-frame").src = "";
|
574 |
}
|
575 |
}
|
576 |
-
|
577 |
// 9. ๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ
|
578 |
document.querySelectorAll(".toggle-button").forEach(button => {
|
579 |
button.addEventListener("click", function() {
|
@@ -582,7 +563,6 @@ const bestProjects = [
|
|
582 |
updateSidebar(this.getAttribute("data-filter"));
|
583 |
});
|
584 |
});
|
585 |
-
|
586 |
// 10. ํ์ด์ง ๋ก๋ ์ All ํํฐ
|
587 |
updateSidebar("all");
|
588 |
</script>
|
|
|
118 |
<script>
|
119 |
// 1. ํ๋ก์ ํธ URL ๋ชฉ๋ก: ํ๋ก์ ํธ ์ด๋ฆ -> URL
|
120 |
const projectList = {
|
121 |
+
"ginigen/Workflow-Canvas": "https://huggingface.co/spaces/ginigen/Workflow-Canvas",
|
122 |
"ginigen/Design": "https://huggingface.co/spaces/ginigen/Design",
|
123 |
"ginigen/Diagram": "https://huggingface.co/spaces/ginigen/Diagram",
|
124 |
"ginigen/Mockup": "https://huggingface.co/spaces/ginigen/Mockup",
|
125 |
"ginigen/Infographic": "https://huggingface.co/spaces/ginigen/Infographic",
|
126 |
"ginigen/Flowchart": "https://huggingface.co/spaces/ginigen/Flowchart",
|
|
|
127 |
"aiqcamp/FLUX-Vision": "https://huggingface.co/spaces/aiqcamp/FLUX-Vision",
|
128 |
"ginigen/VoiceClone-TTS": "https://huggingface.co/spaces/ginigen/VoiceClone-TTS",
|
129 |
"fantos/Panorama": "https://huggingface.co/spaces/fantos/Panorama",
|
|
|
240 |
"aiqtech/flxgif": "https://huggingface.co/spaces/aiqtech/flxgif",
|
241 |
"aiqtech/imaginpaint": "https://huggingface.co/spaces/aiqtech/imaginpaint"
|
242 |
};
|
|
|
243 |
// 2. ๋ณ๋ ๊ฐ์ฒด: ํ๋ก์ ํธ์ ๊ฐ๋ณ ์นดํ
๊ณ ๋ฆฌ ์ง์ (์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ "Image Gen" ์ฌ์ฉ)
|
244 |
const customCategories = {
|
245 |
+
"ginigen/Workflow-Canvas": "Productivity",
|
246 |
"ginigen/Design": "Productivity",
|
247 |
"ginigen/Diagram": "Productivity",
|
248 |
"ginigen/Mockup": "Productivity",
|
|
|
367 |
"aiqtech/flxgif": "Image Gen",
|
368 |
"aiqtech/imaginpaint": "Image Edit"
|
369 |
|
|
|
370 |
};
|
|
|
371 |
const newProjects = [
|
372 |
"ginigen/Design",
|
373 |
"ginigen/Diagram",
|
|
|
438 |
"ginigen/cartoon",
|
439 |
"ginigen/Book-Cover"
|
440 |
];
|
|
|
441 |
const bestProjects = [
|
442 |
+
"ginigen/Workflow-Canvas",
|
443 |
"ginigen/VoiceClone-TTS",
|
444 |
"openfree/VisionOCR-Chat",
|
445 |
"ginigen/3D-LLAMA",
|
|
|
474 |
"ginigen/FLUXllama-Multilingual",
|
475 |
"ginipick/FitGen"
|
476 |
];
|
|
|
|
|
477 |
// 4. URL ๋ณํ ํจ์
|
478 |
function transformUrl(url) {
|
479 |
const prefix = "https://huggingface.co/spaces/";
|
|
|
483 |
}
|
484 |
return url;
|
485 |
}
|
|
|
486 |
// 5. ํ๋ก์ ํธ ๋ฐฐ์ด ์์ฑ
|
487 |
const keys = Object.keys(projectList);
|
488 |
const projects = keys.map(key => {
|
|
|
491 |
|
492 |
if (newProjects.includes(key)) categories.push("NEW");
|
493 |
if (bestProjects.includes(key)) categories.push("BEST");
|
|
|
494 |
return {
|
495 |
name: primaryCategory + "/" + key.split("/")[1],
|
496 |
url: transformUrl(projectList[key]),
|
497 |
categories: categories
|
498 |
};
|
499 |
});
|
|
|
500 |
// 6. ์นดํ
๊ณ ๋ฆฌ๋ณ ๊ทธ๋ฃนํ
|
501 |
const grouped = {};
|
502 |
projects.forEach(proj => {
|
|
|
505 |
grouped[cat].push(proj);
|
506 |
});
|
507 |
});
|
|
|
508 |
// 7. ํํฐ ๋ฒํผ ์์ฑ
|
509 |
const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
|
510 |
const filterGroupDiv = document.getElementById("filter-group");
|
|
|
511 |
const allButton = document.createElement("button");
|
512 |
allButton.className = "toggle-button active";
|
513 |
allButton.setAttribute("data-filter", "all");
|
514 |
allButton.textContent = "All";
|
515 |
filterGroupDiv.appendChild(allButton);
|
|
|
516 |
fixedGroups.forEach(category => {
|
517 |
const btn = document.createElement("button");
|
518 |
btn.className = "toggle-button";
|
|
|
520 |
btn.textContent = category;
|
521 |
filterGroupDiv.appendChild(btn);
|
522 |
});
|
|
|
523 |
// 8. ์ฌ์ด๋๋ฐ ๊ฐฑ์ ํจ์
|
524 |
function updateSidebar(filter) {
|
525 |
const sidebar = document.getElementById("sidebar");
|
|
|
527 |
let items = (filter === "all")
|
528 |
? projects
|
529 |
: projects.filter(p => p.categories.includes(filter));
|
|
|
530 |
const ul = document.createElement("ul");
|
531 |
items.forEach(item => {
|
532 |
const li = document.createElement("li");
|
|
|
533 |
// ์ด๋ฆ ํ์
|
534 |
const nameSpan = document.createElement("span");
|
535 |
nameSpan.textContent = item.name;
|
536 |
li.appendChild(nameSpan);
|
|
|
537 |
// "๋งํฌ ํด๋ฆญ" ๋ฒํผ
|
538 |
const linkButton = document.createElement("button");
|
539 |
linkButton.textContent = "๋งํฌ ํด๋ฆญ";
|
|
|
542 |
window.open(item.url, "_blank"); // ์ ํญ(์ฐฝ) ์ด๊ธฐ
|
543 |
});
|
544 |
li.appendChild(linkButton);
|
|
|
545 |
// li ์์ฒด ํด๋ฆญํ๋ฉด iframe ๋ณ๊ฒฝ
|
546 |
li.addEventListener("click", () => {
|
547 |
document.getElementById("embed-frame").src = item.url;
|
548 |
});
|
|
|
549 |
ul.appendChild(li);
|
550 |
});
|
551 |
sidebar.appendChild(ul);
|
|
|
552 |
if (items.length > 0) {
|
553 |
document.getElementById("embed-frame").src = items[0].url;
|
554 |
} else {
|
555 |
document.getElementById("embed-frame").src = "";
|
556 |
}
|
557 |
}
|
|
|
558 |
// 9. ๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ
|
559 |
document.querySelectorAll(".toggle-button").forEach(button => {
|
560 |
button.addEventListener("click", function() {
|
|
|
563 |
updateSidebar(this.getAttribute("data-filter"));
|
564 |
});
|
565 |
});
|
|
|
566 |
// 10. ํ์ด์ง ๋ก๋ ์ All ํํฐ
|
567 |
updateSidebar("all");
|
568 |
</script>
|