Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -456,37 +456,82 @@ def html(cards, pg, total):
|
|
456 |
# โโโโโโโโโโโโโโโโโโโโโ 7. Gradio Blocks UI โโโโโโโโโโโโโโโโโโโโโ
|
457 |
def build():
|
458 |
_init_best()
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
# ์ํ ๋ฐ ์ถ๋ ฅ
|
491 |
bp = gr.State(1)
|
492 |
out = gr.HTML()
|
|
|
456 |
# โโโโโโโโโโโโโโโโโโโโโ 7. Gradio Blocks UI โโโโโโโโโโโโโโโโโโโโโ
|
457 |
def build():
|
458 |
_init_best()
|
459 |
+
|
460 |
+
# --- 1) ํค๋์ฉ HTML ์ ์ ---------------------------------
|
461 |
+
header_html_snippet = """
|
462 |
+
<style>
|
463 |
+
.app-header{ text-align:center; margin-bottom:24px; }
|
464 |
+
.badge-row{
|
465 |
+
display:inline-flex; /* ๊ฐ๋ก ์ ๋ ฌ */
|
466 |
+
gap:8px; /* ๋ฐฐ์ง ์ฌ์ด ์ฌ๋ฐฑ */
|
467 |
+
margin:8px 0;
|
468 |
+
}
|
469 |
+
</style>
|
470 |
+
|
471 |
+
<div class="app-header">
|
472 |
+
<h1>๐ฎ Vibe Game Craft</h1>
|
473 |
+
|
474 |
+
<div class="badge-row">
|
475 |
+
<!-- โ Vibe-Game ๊ณต๊ฐ ๋ฐฐ์ง -->
|
476 |
+
<a href="https://huggingface.co/spaces/openfree/Vibe-Game" target="_blank">
|
477 |
+
<img src="https://img.shields.io/static/v1?label=huggingface&message=Vibe%20Game%20Craft&color=%23800080&labelColor=%23ffa500&logo=huggingface&logoColor=%23ffff00&style=for-the-badge" alt="HF Vibe badge">
|
478 |
+
</a>
|
479 |
+
|
480 |
+
<!-- โก Game Gallery ๋ฐฐ์ง -->
|
481 |
+
<a href="https://huggingface.co/spaces/openfree/Game-Gallery" target="_blank">
|
482 |
+
<img src="https://img.shields.io/static/v1?label=huggingface&message=Game%20Gallery&color=%23800080&labelColor=%23ffa500&logo=huggingface&logoColor=%23ffff00&style=for-the-badge" alt="HF Gallery badge">
|
483 |
+
</a>
|
484 |
+
|
485 |
+
<!-- โข Discord ๋ฐฐ์ง -->
|
486 |
+
<a href="https://discord.gg/openfreeai" target="_blank">
|
487 |
+
<img src="https://img.shields.io/static/v1?label=Discord&message=Openfree%20AI&color=%230000ff&labelColor=%23800080&logo=discord&logoColor=white&style=for-the-badge" alt="Discord badge">
|
488 |
+
</a>
|
489 |
+
</div>
|
490 |
+
|
491 |
+
<p>ํ๋กฌํํธ ์
๋ ฅ๋ง์ผ๋ก ์ต์ LLM๋ค๊ณผ Agent๊ฐ ํ์
ํ์ฌ ์น ๊ธฐ๋ฐ HTML5, JavaScript, CSS ๊ฒ์์ ์์ฑํฉ๋๋ค. ์ค์๊ฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์ ๋ฐฐํฌ ๊ธฐ๋ฅ๋ ์ง์๋ฉ๋๋ค.</p>
|
492 |
+
</div>
|
493 |
+
"""
|
494 |
+
|
495 |
+
# --- 2) Gradio Blocks ์์ --------------------------------
|
496 |
+
with gr.Blocks(
|
497 |
+
title="Vibe Game Craft",
|
498 |
+
css="""
|
499 |
+
footer{display:none !important;}
|
500 |
+
|
501 |
+
.button-row{
|
502 |
+
position:fixed !important;
|
503 |
+
bottom:0 !important;
|
504 |
+
left:0 !important;
|
505 |
+
right:0 !important;
|
506 |
+
height:60px !important;
|
507 |
+
background:#f0f0f0 !important;
|
508 |
+
padding:10px !important;
|
509 |
+
text-align:center !important;
|
510 |
+
box-shadow:0 -2px 10px rgba(0,0,0,0.05) !important;
|
511 |
+
margin:0 !important;
|
512 |
+
z-index:1000 !important;
|
513 |
+
}
|
514 |
+
|
515 |
+
.button-row button{
|
516 |
+
margin:0 10px !important;
|
517 |
+
padding:10px 20px !important;
|
518 |
+
font-size:16px !important;
|
519 |
+
font-weight:bold !important;
|
520 |
+
border-radius:50px !important;
|
521 |
+
}
|
522 |
+
|
523 |
+
/* Allow scrolling in the HTML component */
|
524 |
+
#component-0{
|
525 |
+
overflow-y:auto !important;
|
526 |
+
height:calc(100vh - 60px) !important;
|
527 |
+
}
|
528 |
+
"""
|
529 |
+
) as demo:
|
530 |
+
|
531 |
+
# (1) โจ ํค๋๋ฅผ ๊ฐ์ฅ ๋จผ์ ๋ ๋๋ง
|
532 |
+
gr.HTML(header_html_snippet)
|
533 |
+
|
534 |
+
|
535 |
# ์ํ ๋ฐ ์ถ๋ ฅ
|
536 |
bp = gr.State(1)
|
537 |
out = gr.HTML()
|