openfree commited on
Commit
d9b6335
ยท
verified ยท
1 Parent(s): fdb1677

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +55 -49
index.html CHANGED
@@ -48,7 +48,7 @@
48
  }
49
  .main-container {
50
  display: flex;
51
- height: calc(100vh - 100px);
52
  }
53
  #sidebar {
54
  width: 25%;
@@ -91,8 +91,10 @@
91
  <a href="https://discord.gg/openfreeai" target="_blank">Community</a>
92
  </div>
93
 
94
- <!-- ํ•„ํ„ฐ ๋ฒ„ํŠผ ์˜์—ญ (๋ฏธ๋ฆฌ ์ •์˜ํ•œ 10๊ฐ€์ง€ ๊ทธ๋ฃน: NEW, BEST, Text, Image Gen, Image Edit, Audio, Video, Productivity, Utility, Vision) -->
95
- <div class="filter-group" id="filter-group"></div>
 
 
96
 
97
  <div class="main-container">
98
  <div id="sidebar"></div>
@@ -338,13 +340,36 @@
338
  "aiqtech/FLUX-Ghibli-Studio-LoRA": "Image Gen",
339
  "aiqtech/flxgif": "Image Gen",
340
  "aiqtech/imaginpaint": "Image Edit",
341
-
342
- // ์˜ˆ์‹œ๋กœ NEW/BEST ํ•ญ๋ชฉ ๋”ฐ๋กœ ์ง€์ • (ํ‚ค ๋’ค์— _NEW, _BEST ๋ถ™์ž„)
343
- "fantos/Panorama_NEW": "NEW",
344
- "ginigen/Multi-LoRAgen_BEST": "BEST"
345
  };
346
 
347
- // 3. URL ๋ณ€ํ™˜ ํ•จ์ˆ˜: "https://huggingface.co/spaces/{namespace}/{project}" โ†’ "https://{namespace}-{project}.hf.space"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  function transformUrl(url) {
349
  const prefix = "https://huggingface.co/spaces/";
350
  if (url.startsWith(prefix)) {
@@ -354,59 +379,41 @@
354
  return url;
355
  }
356
 
357
- // 4. ํ”„๋กœ์ ํŠธ ๊ฐ์ฒด ์ƒ์„ฑ
358
- // projectList์˜ ๋ชจ๋“  key์— ๋Œ€ํ•ด customCategories์—์„œ ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์ฝ๊ณ , ์—†์œผ๋ฉด ๊ธฐ๋ณธ "Image Gen"
359
  const keys = Object.keys(projectList);
360
  const projects = keys.map(key => {
361
- const url = projectList[key];
362
- // primaryCategory๊ฐ€ ์—†์œผ๋ฉด "Image Gen"
363
- let primaryCategory = customCategories[key] || "Image Gen";
364
-
365
- // ์ค‘๋ณต ์นดํ…Œ๊ณ ๋ฆฌ ๊ฐ€๋Šฅ (NEW, BEST)
366
  let categories = [primaryCategory];
367
- if (key.endsWith("_NEW")) {
368
- categories.push("NEW");
369
- }
370
- if (key.endsWith("_BEST")) {
371
- categories.push("BEST");
372
- }
373
-
374
- // ์‹ค์ œ ํ”„๋กœ์ ํŠธ๋ช…: "/" ๋’ค์˜ ๋ถ€๋ถ„
375
- let projectName = key;
376
- if (!key.endsWith("_NEW") && !key.endsWith("_BEST")) {
377
- projectName = key.split("/").slice(1).join("/");
378
- }
379
 
380
  return {
381
- name: primaryCategory + "/" + projectName,
382
- url: transformUrl(url),
383
  categories: categories
384
  };
385
  });
386
 
387
- // 5. ์นดํ…Œ๊ณ ๋ฆฌ๋ณ„ ๊ทธ๋ฃนํ™”
388
  const grouped = {};
389
- projects.forEach(project => {
390
- project.categories.forEach(cat => {
391
- if (!grouped[cat]) {
392
- grouped[cat] = [];
393
- }
394
- grouped[cat].push(project);
395
  });
396
  });
397
 
398
- // 6. ํ•„ํ„ฐ ๋ฒ„ํŠผ ์ƒ์„ฑ (10๊ฐ€์ง€ + All)
399
  const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
400
  const filterGroupDiv = document.getElementById("filter-group");
401
 
402
- // All ๋ฒ„ํŠผ
403
  const allButton = document.createElement("button");
404
  allButton.className = "toggle-button active";
405
  allButton.setAttribute("data-filter", "all");
406
  allButton.textContent = "All";
407
  filterGroupDiv.appendChild(allButton);
408
 
409
- // ๋‚˜๋จธ์ง€ 10๊ฐœ ์นดํ…Œ๊ณ ๋ฆฌ ๋ฒ„ํŠผ
410
  fixedGroups.forEach(category => {
411
  const btn = document.createElement("button");
412
  btn.className = "toggle-button";
@@ -415,44 +422,43 @@
415
  filterGroupDiv.appendChild(btn);
416
  });
417
 
418
- // 7. ์‚ฌ์ด๋“œ๋ฐ” ๊ฐฑ์‹  ํ•จ์ˆ˜
419
  function updateSidebar(filter) {
420
  const sidebar = document.getElementById("sidebar");
421
  sidebar.innerHTML = "";
422
  let items = (filter === "all")
423
  ? projects
424
- : projects.filter(project => project.categories.includes(filter));
425
 
426
  const ul = document.createElement("ul");
427
  items.forEach(item => {
428
  const li = document.createElement("li");
429
  li.textContent = item.name;
430
  li.addEventListener("click", () => {
431
- document.getElementById("embed-frame").setAttribute("src", item.url);
432
  });
433
  ul.appendChild(li);
434
  });
435
  sidebar.appendChild(ul);
436
 
437
- // ์ฒซ ๋ฒˆ์งธ ํ•ญ๋ชฉ ์ž๋™ ํ‘œ์‹œ
438
  if (items.length > 0) {
439
- document.getElementById("embed-frame").setAttribute("src", items[0].url);
440
  } else {
441
- document.getElementById("embed-frame").setAttribute("src", "");
442
  }
443
  }
444
 
445
- // 8. ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ํ•„ํ„ฐ ์ ์šฉ
446
  document.querySelectorAll(".toggle-button").forEach(button => {
447
  button.addEventListener("click", function() {
448
- document.querySelectorAll(".toggle-button").forEach(btn => btn.classList.remove("active"));
449
  this.classList.add("active");
450
  updateSidebar(this.getAttribute("data-filter"));
451
  });
452
  });
453
 
454
- // 9. ์ดˆ๊ธฐ ๋กœ๋”ฉ: All ํ•„ํ„ฐ ์ ์šฉ
455
  updateSidebar("all");
456
  </script>
457
  </body>
458
- </html>
 
48
  }
49
  .main-container {
50
  display: flex;
51
+ height: calc(100vh - 100px); /* ์ƒ๋‹จ ์˜์—ญ ์ œ์™ธ ์ „์ฒด ๋†’์ด */
52
  }
53
  #sidebar {
54
  width: 25%;
 
91
  <a href="https://discord.gg/openfreeai" target="_blank">Community</a>
92
  </div>
93
 
94
+ <!-- ํ•„ํ„ฐ ๋ฒ„ํŠผ ์˜์—ญ -->
95
+ <div class="filter-group" id="filter-group">
96
+ <!-- JavaScript๋กœ ๋™์ ์œผ๋กœ ๋ฒ„ํŠผ ์ƒ์„ฑ -->
97
+ </div>
98
 
99
  <div class="main-container">
100
  <div id="sidebar"></div>
 
340
  "aiqtech/FLUX-Ghibli-Studio-LoRA": "Image Gen",
341
  "aiqtech/flxgif": "Image Gen",
342
  "aiqtech/imaginpaint": "Image Edit",
 
 
 
 
343
  };
344
 
345
+ const newProjects = [
346
+ "fantos/Panorama",
347
+ "ginigen/Multi-LoRAgen",
348
+ "ginipick/Fashion-Stylegen",
349
+ "ginipick/Time-Stream",
350
+ "ginipick/AccuVision-Diffusion",
351
+ "fantos/Magic-Drawings",
352
+ "ginigen/Lumina-Image-PLUS",
353
+ "fantaxy/fantasy-novel",
354
+ "VIDraft/mouse-webgen",
355
+ "immunobiotech/MUSIC-Jukebox"
356
+ ];
357
+
358
+ const bestProjects = [
359
+ "ginigen/canvas-studio",
360
+ "ginipick/Time-Stream",
361
+ "ginipick/AccuVision-Diffusion",
362
+ "fantos/Magic-Drawings",
363
+ "ginigen/Lumina-Image-PLUS",
364
+ "fantaxy/fantasy-novel",
365
+ "VIDraft/mouse-webgen",
366
+ "immunobiotech/MUSIC-Jukebox",
367
+ "seawolf2357/Flowise-AI",
368
+ "ginigen/Flux-LayerDiffuse"
369
+ ];
370
+
371
+
372
+ // 4. URL ๋ณ€ํ™˜ ํ•จ์ˆ˜
373
  function transformUrl(url) {
374
  const prefix = "https://huggingface.co/spaces/";
375
  if (url.startsWith(prefix)) {
 
379
  return url;
380
  }
381
 
382
+ // 5. ํ”„๋กœ์ ํŠธ ๋ฐฐ์—ด ์ƒ์„ฑ
 
383
  const keys = Object.keys(projectList);
384
  const projects = keys.map(key => {
385
+ const primaryCategory = customCategories[key] || "Image Gen";
 
 
 
 
386
  let categories = [primaryCategory];
387
+
388
+ if (newProjects.includes(key)) categories.push("NEW");
389
+ if (bestProjects.includes(key)) categories.push("BEST");
 
 
 
 
 
 
 
 
 
390
 
391
  return {
392
+ name: primaryCategory + "/" + key.split("/")[1],
393
+ url: transformUrl(projectList[key]),
394
  categories: categories
395
  };
396
  });
397
 
398
+ // 6. ์นดํ…Œ๊ณ ๋ฆฌ๋ณ„ ๊ทธ๋ฃนํ™”
399
  const grouped = {};
400
+ projects.forEach(proj => {
401
+ proj.categories.forEach(cat => {
402
+ if (!grouped[cat]) grouped[cat] = [];
403
+ grouped[cat].push(proj);
 
 
404
  });
405
  });
406
 
407
+ // 7. ํ•„ํ„ฐ ๋ฒ„ํŠผ ์ƒ์„ฑ
408
  const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
409
  const filterGroupDiv = document.getElementById("filter-group");
410
 
 
411
  const allButton = document.createElement("button");
412
  allButton.className = "toggle-button active";
413
  allButton.setAttribute("data-filter", "all");
414
  allButton.textContent = "All";
415
  filterGroupDiv.appendChild(allButton);
416
 
 
417
  fixedGroups.forEach(category => {
418
  const btn = document.createElement("button");
419
  btn.className = "toggle-button";
 
422
  filterGroupDiv.appendChild(btn);
423
  });
424
 
425
+ // 8. ์‚ฌ์ด๋“œ๋ฐ” ๊ฐฑ์‹  ํ•จ์ˆ˜
426
  function updateSidebar(filter) {
427
  const sidebar = document.getElementById("sidebar");
428
  sidebar.innerHTML = "";
429
  let items = (filter === "all")
430
  ? projects
431
+ : projects.filter(p => p.categories.includes(filter));
432
 
433
  const ul = document.createElement("ul");
434
  items.forEach(item => {
435
  const li = document.createElement("li");
436
  li.textContent = item.name;
437
  li.addEventListener("click", () => {
438
+ document.getElementById("embed-frame").src = item.url;
439
  });
440
  ul.appendChild(li);
441
  });
442
  sidebar.appendChild(ul);
443
 
 
444
  if (items.length > 0) {
445
+ document.getElementById("embed-frame").src = items[0].url;
446
  } else {
447
+ document.getElementById("embed-frame").src = "";
448
  }
449
  }
450
 
451
+ // 9. ๋ฒ„ํŠผ ํด๋ฆญ ์ด๋ฒคํŠธ
452
  document.querySelectorAll(".toggle-button").forEach(button => {
453
  button.addEventListener("click", function() {
454
+ document.querySelectorAll(".toggle-button").forEach(b => b.classList.remove("active"));
455
  this.classList.add("active");
456
  updateSidebar(this.getAttribute("data-filter"));
457
  });
458
  });
459
 
460
+ // 10. ํŽ˜์ด์ง€ ๋กœ๋“œ ์‹œ All ํ•„ํ„ฐ
461
  updateSidebar("all");
462
  </script>
463
  </body>
464
+ </html>