Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,14 +21,13 @@ META_HEROES = {
|
|
| 21 |
# ========================================================
|
| 22 |
# 2. DAFTAR HERO BERDASARKAN ROLE JALUR LANE
|
| 23 |
# ========================================================
|
| 24 |
-
JUNGLER_POOL = sorted(["
|
| 25 |
-
ROAMER_POOL = sorted(["
|
| 26 |
-
MIDLANER_POOL = sorted(["
|
| 27 |
-
EXP_LANER_POOL = sorted(["
|
| 28 |
-
GOLD_LANER_POOL = sorted(["
|
| 29 |
|
| 30 |
ALL_HEROES_COMBINED = sorted(JUNGLER_POOL + ROAMER_POOL + MIDLANER_POOL + EXP_LANER_POOL + GOLD_LANER_POOL)
|
| 31 |
-
|
| 32 |
BLANK_IMG = "https://via.placeholder.com/65x65/0f172a/64748b?text=%3F"
|
| 33 |
|
| 34 |
def clean_name(name):
|
|
@@ -42,71 +41,118 @@ def update_hero_html(hero_name):
|
|
| 42 |
url = f"https://via.placeholder.com/65x65/1e293b/f8fafc?text={pure_name[:4]}"
|
| 43 |
return f'<div style="display:flex; justify-content:center; margin: 4px 0;"><img src="{url}" style="width:65px; height:65px; border-radius:8px; border:2px solid #475569; object-fit:cover;" /></div>'
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
def analyze_tournament_draft(rank, b1, b2, b3, b4, b5, r1, r2, r3, r4, r5, ban1, ban2, ban3, ban4, ban5, ban6, ban7, ban8, ban9, ban10):
|
| 46 |
blue_team = [clean_name(h) for h in [b1, b2, b3, b4, b5] if h]
|
| 47 |
red_team = [clean_name(h) for h in [r1, r2, r3, r4, r5] if h]
|
| 48 |
all_bans = [clean_name(h) for h in [ban1, ban2, ban3, ban4, ban5, ban6, ban7, ban8, ban9, ban10] if h]
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
if not red_team:
|
| 52 |
-
|
| 53 |
else:
|
| 54 |
-
has_meta_analysis = False
|
| 55 |
for hero in red_team:
|
| 56 |
if hero in META_HEROES:
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<b style='color: #f87171;'>⚠️ ANCAMAN META: {hero}</b> <span style='font-size:11px; color:#cbd5e1; background:#991b1b; padding:2px 6px; border-radius:4px;'>{data['meta']}</span>
|
| 62 |
-
<ul style='color: #94a3b8; font-size: 13px; margin: 4px 0 0 15px; padding:0;'>
|
| 63 |
-
"""
|
| 64 |
-
for c_hero, reason in data["counters"].items():
|
| 65 |
-
if c_hero not in blue_team and c_hero not in red_team and c_hero not in all_bans:
|
| 66 |
-
counter_html += f"<li><span style='color: #60a5fa; font-weight:bold;'>{c_hero}</span>: {reason}</li>"
|
| 67 |
-
counter_html += "</ul></div>"
|
| 68 |
-
if not has_meta_analysis:
|
| 69 |
-
counter_html += "<p style='color: #34d399; margin:0;'>✅ Musuh pick hero non-prioritas turnamen. Tekanan draf aman.</p>"
|
| 70 |
-
counter_html += "</div>"
|
| 71 |
-
|
| 72 |
-
meta_counts = {}
|
| 73 |
-
for h in blue_team:
|
| 74 |
-
if h in META_HEROES:
|
| 75 |
-
m_type = META_HEROES[h]["meta"]
|
| 76 |
-
meta_counts[m_type] = meta_counts.get(m_type, 0) + 1
|
| 77 |
-
|
| 78 |
-
meta_html = "<div style='background-color: #0f172a; padding: 15px; border-radius: 10px; border: 1px solid #334155;'>"
|
| 79 |
-
if not blue_team:
|
| 80 |
-
meta_html += "<p style='color: #94a3b8; margin:0;'>Rancang draf timmu...</p>"
|
| 81 |
-
else:
|
| 82 |
-
dominant_meta = max(meta_counts, key=meta_counts.get) if meta_counts else "Sustain/Balanced"
|
| 83 |
-
meta_html += f"<b style='color: #34d399; font-size:16px;'>🛡️ KECENDERUNGAN META TIM: {dominant_meta}</b>"
|
| 84 |
-
meta_html += "</div>"
|
| 85 |
|
| 86 |
-
return
|
| 87 |
|
| 88 |
# ========================================================
|
| 89 |
-
# INTERFACE DESIGN
|
| 90 |
# ========================================================
|
| 91 |
custom_css = """
|
| 92 |
body { background-color: #020617; }
|
| 93 |
.gradio-container { background-color: #020617 !important; color: white !important; }
|
| 94 |
-
.blue-side { border: 2px solid #3b82f6; padding: 15px; border-radius: 12px; background: rgba(59, 130, 246, 0.
|
| 95 |
-
.red-side { border: 2px solid #ef4444; padding: 15px; border-radius: 12px; background: rgba(239, 68, 68, 0.
|
| 96 |
.ban-panel { border: 1px dashed #475569; padding: 12px; border-radius: 10px; background: rgba(15, 23, 42, 0.6); margin-bottom: 15px; }
|
| 97 |
"""
|
| 98 |
|
| 99 |
with gr.Blocks(css=custom_css) as demo:
|
| 100 |
gr.HTML("""
|
| 101 |
<div style='text-align: center; padding: 10px 0;'>
|
| 102 |
-
<h1 style='color: #3b82f6; font-size:
|
| 103 |
-
<p style='color: #64748b; margin: 5px 0;'>
|
| 104 |
</div>
|
| 105 |
""")
|
| 106 |
|
| 107 |
-
# BAN SECTIONS
|
| 108 |
with gr.Group(elem_classes="ban-panel"):
|
| 109 |
-
gr.HTML("<b style='color: #94a3b8; display:block; text-align:center; margin-bottom:5px;'>🚫 TOURNAMENT BAN POOL
|
| 110 |
with gr.Row():
|
| 111 |
b_ban1 = gr.Dropdown([None] + ALL_HEROES_COMBINED, label="B-Ban 1")
|
| 112 |
b_ban2 = gr.Dropdown([None] + ALL_HEROES_COMBINED, label="B-Ban 2")
|
|
@@ -121,11 +167,10 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 121 |
r_ban5 = gr.Dropdown([None] + ALL_HEROES_COMBINED, label="R-Ban 5")
|
| 122 |
|
| 123 |
with gr.Row():
|
| 124 |
-
# BLUE TEAM
|
| 125 |
with gr.Column(elem_classes="blue-side", scale=1):
|
| 126 |
-
gr.HTML("<h3 style='color: #60a5fa; margin-top:0; text-align:center;'>🔵
|
| 127 |
rank_pick = gr.Dropdown(["Pro-Tournament", "Ranked Match"], value="Pro-Tournament", label="Format")
|
| 128 |
-
|
| 129 |
b1 = gr.Dropdown([None] + JUNGLER_POOL, label="⚔️ Jungler")
|
| 130 |
img_b1 = gr.HTML(update_hero_html(None))
|
| 131 |
b2 = gr.Dropdown([None] + ROAMER_POOL, label="🛡️ Roamer")
|
|
@@ -137,18 +182,19 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 137 |
b5 = gr.Dropdown([None] + GOLD_LANER_POOL, label="🏹 Gold Laner")
|
| 138 |
img_b5 = gr.HTML(update_hero_html(None))
|
| 139 |
|
| 140 |
-
#
|
| 141 |
-
with gr.Column(scale=1):
|
| 142 |
-
btn_analyze = gr.Button("
|
| 143 |
-
gr.HTML("<h3 style='color: #fbbf24; margin-top:15px;'>🔮 METALOGI & COMBO TIM</h3>")
|
| 144 |
-
meta_out = gr.HTML("<p style='color: #64748b;'>Menunggu draf...</p>")
|
| 145 |
-
gr.HTML("<h3 style='color: #4ade80; margin-top:15px;'>📊 STATUS ENGINE</h3>")
|
| 146 |
-
comp_out = gr.HTML("<p style='color: #64748b;'>Ready.</p>")
|
| 147 |
-
|
| 148 |
-
# RED TEAM PICKS (DIPISAH PER LANE / ROLE)
|
| 149 |
-
with gr.Column(elem_classes="red-side", scale=1):
|
| 150 |
-
gr.HTML("<h3 style='color: #f87171; margin-top:0; text-align:center;'>🔴 RED TEAM LANERS</h3>")
|
| 151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
r1 = gr.Dropdown([None] + JUNGLER_POOL, label="⚔️ Enemy Jungler")
|
| 153 |
img_r1 = gr.HTML(update_hero_html(None))
|
| 154 |
r2 = gr.Dropdown([None] + ROAMER_POOL, label="🛡️ Enemy Roamer")
|
|
@@ -160,8 +206,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 160 |
r5 = gr.Dropdown([None] + GOLD_LANER_POOL, label="🏹 Enemy Gold Laner")
|
| 161 |
img_r5 = gr.HTML(update_hero_html(None))
|
| 162 |
|
| 163 |
-
gr.HTML("<h2 style='color: #
|
| 164 |
-
counter_out = gr.HTML("<p style='color: #64748b;'>
|
| 165 |
|
| 166 |
# BINDING IMAGE CHANGES VIA HTML INJECTION
|
| 167 |
b1.change(fn=update_hero_html, inputs=b1, outputs=img_b1)
|
|
@@ -180,7 +226,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 180 |
btn_analyze.click(
|
| 181 |
fn=analyze_tournament_draft,
|
| 182 |
inputs=[rank_pick, b1, b2, b3, b4, b5, r1, r2, r3, r4, r5, b_ban1, b_ban2, b_ban3, b_ban4, b_ban5, r_ban1, r_ban2, r_ban3, r_ban4, r_ban5],
|
| 183 |
-
outputs=[counter_out,
|
| 184 |
)
|
| 185 |
|
| 186 |
if __name__ == "__main__":
|
|
|
|
| 21 |
# ========================================================
|
| 22 |
# 2. DAFTAR HERO BERDASARKAN ROLE JALUR LANE
|
| 23 |
# ========================================================
|
| 24 |
+
JUNGLER_POOL = sorted(["Aamon", "Alucard", "Balmond", "Bane", "Barats", "Baxia", "⭐ Fanny", "Fredrinn", "Gusion", "Hanzo", "Harley", "⭐ Hayabusa", "Helcurt", "Karina", "Lancelot", "⭐ Ling", "Martis", "⭐ Nolan", "Paquito", "Saber", "Yi Sun-shin", "Yin"])
|
| 25 |
+
ROAMER_POOL = sorted(["Akai", "Angela", "Atlas", "Belerick", "Carmilla", "Chou", "Diggie", "Estes", "Floryn", "Gatotkaca", "Gloo", "Grock", "⭐ Hylos", "Johnson", "Kaja", "Khufra", "Lolita", "⭐ Mathilda", "Minotaur", "Minsitthar", "Natalia", "Rafaela", "Selena", "⭐ Tigreal"])
|
| 26 |
+
MIDLANER_POOL = sorted(["Alice", "Aurora", "Cecilion", "Chang'e", "Cyclops", "Eudora", "Faramis", "Gord", "Kadita", "Kagura", "Lunox", "Luo Yi", "Nana", "Novaria", "Odette", "Pharsa", "Vale", "Valentina", "Valir", "Vexana", "Xavier", "Yve", "⭐ Zhuxin"])
|
| 27 |
+
EXP_LANER_POOL = sorted(["Aldous", "Alpha", "Argus", "Arlott", "Aulus", "Badang", "Benedetta", "Cici", "Dyrroth", "Esmeralda", "Freya", "Guinevere", "Jawhead", "Khaleed", "Leomord", "Masha", "Phoveus", "⭐ Ruby", "Silvanna", "Sun", "⭐ Terizla", "Thamuz", "Uranus", "X.Borg", "Yu Zhong", "Zilong"])
|
| 28 |
+
GOLD_LANER_POOL = sorted(["Beatrix", "Brody", "Bruno", "Claude", "Clint", "Hanabi", "⭐ Harith", "Irithel", "Ixia", "Layla", "Lesley", "Melissa", "Miya", "Moskov", "Natan", "Popol and Kupa", "⭐ Roger", "Wanwan"])
|
| 29 |
|
| 30 |
ALL_HEROES_COMBINED = sorted(JUNGLER_POOL + ROAMER_POOL + MIDLANER_POOL + EXP_LANER_POOL + GOLD_LANER_POOL)
|
|
|
|
| 31 |
BLANK_IMG = "https://via.placeholder.com/65x65/0f172a/64748b?text=%3F"
|
| 32 |
|
| 33 |
def clean_name(name):
|
|
|
|
| 41 |
url = f"https://via.placeholder.com/65x65/1e293b/f8fafc?text={pure_name[:4]}"
|
| 42 |
return f'<div style="display:flex; justify-content:center; margin: 4px 0;"><img src="{url}" style="width:65px; height:65px; border-radius:8px; border:2px solid #475569; object-fit:cover;" /></div>'
|
| 43 |
|
| 44 |
+
# HELPER GENERATE BLOK EVALUASI (CANDLE CARD STYLE)
|
| 45 |
+
def make_eval_card(title, items, is_positive=True):
|
| 46 |
+
bg_color = "rgba(16, 185, 129, 0.1)" if is_positive else "rgba(239, 68, 68, 0.1)"
|
| 47 |
+
border_color = "#10b981" if is_positive else "#ef4444"
|
| 48 |
+
title_color = "#34d399" if is_positive else "#f87171"
|
| 49 |
+
icon = "✅" if is_positive else "⚠️"
|
| 50 |
+
|
| 51 |
+
html = f"""
|
| 52 |
+
<div style='background: {bg_color}; border: 1px solid {border_color}; padding: 12px; border-radius: 8px; margin-bottom: 10px;'>
|
| 53 |
+
<b style='color: {title_color}; font-size: 14px; display: block; margin-bottom: 6px;'>{icon} {title}</b>
|
| 54 |
+
<ul style='margin: 0; padding-left: 18px; color: #cbd5e1; font-size: 13px;'>
|
| 55 |
+
"""
|
| 56 |
+
for item in items:
|
| 57 |
+
html += f"<li style='margin-bottom: 4px;'>{item}</li>"
|
| 58 |
+
html += "</ul></div>"
|
| 59 |
+
return html
|
| 60 |
+
|
| 61 |
def analyze_tournament_draft(rank, b1, b2, b3, b4, b5, r1, r2, r3, r4, r5, ban1, ban2, ban3, ban4, ban5, ban6, ban7, ban8, ban9, ban10):
|
| 62 |
blue_team = [clean_name(h) for h in [b1, b2, b3, b4, b5] if h]
|
| 63 |
red_team = [clean_name(h) for h in [r1, r2, r3, r4, r5] if h]
|
| 64 |
all_bans = [clean_name(h) for h in [ban1, ban2, ban3, ban4, ban5, ban6, ban7, ban8, ban9, ban10] if h]
|
| 65 |
|
| 66 |
+
# --- INITIAL EVALUATION STRINGS ---
|
| 67 |
+
blue_pos, blue_neg = [], []
|
| 68 |
+
red_pos, red_neg = [], []
|
| 69 |
+
|
| 70 |
+
# 1. EVALUASI BLUE TEAM (KELEBIHAN & KEKURANGAN)
|
| 71 |
+
if len(blue_team) < 3:
|
| 72 |
+
blue_pos.append("Menunggu draf blueprint selesai...")
|
| 73 |
+
blue_neg.append("Draf tim belum siap dianalisis.")
|
| 74 |
+
else:
|
| 75 |
+
# Deteksi META Prioritas
|
| 76 |
+
meta_count = sum(1 for h in blue_team if h in META_HEROES)
|
| 77 |
+
if meta_count >= 2:
|
| 78 |
+
blue_pos.append(f"Mengamankan {meta_count} Hero Prioritas tinggi di patch aktif.")
|
| 79 |
+
else:
|
| 80 |
+
blue_neg.append("Minim hero tier S+. Potensi kalah power hero saat skirmish.")
|
| 81 |
+
|
| 82 |
+
# Deteksi Sinergi
|
| 83 |
+
metas = [META_HEROES[h]["meta"] for h in blue_team if h in META_HEROES]
|
| 84 |
+
if "Dive" in metas:
|
| 85 |
+
blue_pos.append("Mobilitas tinggi, sangat kuat dalam skema pick-off & instant burst.")
|
| 86 |
+
if "Wombo Combo" in metas:
|
| 87 |
+
blue_pos.append("Kemampuan teamfight area besar sangat dominan di objektif Lord.")
|
| 88 |
+
if "Ube/Regen" in metas:
|
| 89 |
+
blue_pos.append("Sustain tinggi di lini depan, cocok untuk gameplay disiplin/late game.")
|
| 90 |
+
|
| 91 |
+
# Cek default defense
|
| 92 |
+
if not any(h in ["Hylos", "Tigreal", "Akai", "Khufra", "Grock", "Minotaur"] for h in blue_team):
|
| 93 |
+
blue_neg.append("Lini depan rapuh. Kurang inisiator pertahanan murni.")
|
| 94 |
+
|
| 95 |
+
# 2. EVALUASI RED TEAM (KELEBIHAN & KEKURANGAN)
|
| 96 |
+
if len(red_team) < 3:
|
| 97 |
+
red_pos.append("Menunggu musuh mengunci draf...")
|
| 98 |
+
red_neg.append("Data pergerakan musuh tidak mencukupi.")
|
| 99 |
+
else:
|
| 100 |
+
meta_count_red = sum(1 for h in red_team if h in META_HEROES)
|
| 101 |
+
if meta_count_red >= 2:
|
| 102 |
+
red_pos.append(f"Musuh berhasil mencuri {meta_count_red} Power Pick krusial.")
|
| 103 |
+
|
| 104 |
+
# Deteksi Countering langsung ke Blue Team
|
| 105 |
+
counter_terjadi = False
|
| 106 |
+
for r_hero in red_team:
|
| 107 |
+
if r_hero in META_HEROES:
|
| 108 |
+
for c_hero in META_HEROES[r_hero]["counters"]:
|
| 109 |
+
if c_hero in blue_team:
|
| 110 |
+
red_pos.append(f"Hero {r_hero} secara langsung mengunci ruang gerak {c_hero} di timmu.")
|
| 111 |
+
blue_neg.append(f"Lini krusial {c_hero} terancam akibat counter pick {r_hero}.")
|
| 112 |
+
counter_terjadi = True
|
| 113 |
+
if not counter_terjadi:
|
| 114 |
+
red_neg.append("Drafting musuh kurang agresif menargetkan kelemahan heromu.")
|
| 115 |
+
|
| 116 |
+
# GENERATE CANDLE BLOCKS HTML
|
| 117 |
+
blue_eval_html = "<div>" + make_eval_card("KELEBIHAN TIM KAMU", blue_pos, True) + make_eval_card("CELAH / KEKURANGAN", blue_neg, False) + "</div>"
|
| 118 |
+
red_eval_html = "<div>" + make_eval_card("POTENSI ANCAMAN MUSUH", red_pos, True) + make_eval_card("TITIK LEMAH MUSUH", red_neg, False) + "</div>"
|
| 119 |
+
|
| 120 |
+
# Deep Counter Report (Deteksi sisa alternatif counter)
|
| 121 |
+
counter_report = "<div style='background-color: #0f172a; padding: 15px; border-radius: 10px; border: 1px solid #334155;'>"
|
| 122 |
if not red_team:
|
| 123 |
+
counter_report += "<p style='color: #94a3b8; margin:0;'>Kalkulasi taktis menunggu pick lawan...</p>"
|
| 124 |
else:
|
|
|
|
| 125 |
for hero in red_team:
|
| 126 |
if hero in META_HEROES:
|
| 127 |
+
counter_report += f"<p style='color:#f87171; margin: 4px 0;'>⚠️ <b>Saran Tanggapan untuk {hero}:</b> Opsi tersisa di pool ban/pick: "
|
| 128 |
+
opts = [c for c in META_HEROES[hero]["counters"] if c not in blue_team and c not in all_bans]
|
| 129 |
+
counter_report += f"<span style='color:#60a5fa;'>{', '.join(opts) if opts else 'Habis'}</span></p>"
|
| 130 |
+
counter_report += "</div>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
+
return counter_report, blue_eval_html, red_eval_html
|
| 133 |
|
| 134 |
# ========================================================
|
| 135 |
+
# INTERFACE DESIGN
|
| 136 |
# ========================================================
|
| 137 |
custom_css = """
|
| 138 |
body { background-color: #020617; }
|
| 139 |
.gradio-container { background-color: #020617 !important; color: white !important; }
|
| 140 |
+
.blue-side { border: 2px solid #3b82f6; padding: 15px; border-radius: 12px; background: rgba(59, 130, 246, 0.02); }
|
| 141 |
+
.red-side { border: 2px solid #ef4444; padding: 15px; border-radius: 12px; background: rgba(239, 68, 68, 0.02); }
|
| 142 |
.ban-panel { border: 1px dashed #475569; padding: 12px; border-radius: 10px; background: rgba(15, 23, 42, 0.6); margin-bottom: 15px; }
|
| 143 |
"""
|
| 144 |
|
| 145 |
with gr.Blocks(css=custom_css) as demo:
|
| 146 |
gr.HTML("""
|
| 147 |
<div style='text-align: center; padding: 10px 0;'>
|
| 148 |
+
<h1 style='color: #3b82f6; font-size: 26px; margin:0;'>🏆 MLBB VISUAL STRATEGY CORE</h1>
|
| 149 |
+
<p style='color: #64748b; margin: 5px 0;'>Dashboard Evaluasi Komparasi Kekuatan Draf • Patch v2026</p>
|
| 150 |
</div>
|
| 151 |
""")
|
| 152 |
|
| 153 |
+
# BAN SECTIONS
|
| 154 |
with gr.Group(elem_classes="ban-panel"):
|
| 155 |
+
gr.HTML("<b style='color: #94a3b8; display:block; text-align:center; margin-bottom:5px;'>🚫 TOURNAMENT BAN POOL</b>")
|
| 156 |
with gr.Row():
|
| 157 |
b_ban1 = gr.Dropdown([None] + ALL_HEROES_COMBINED, label="B-Ban 1")
|
| 158 |
b_ban2 = gr.Dropdown([None] + ALL_HEROES_COMBINED, label="B-Ban 2")
|
|
|
|
| 167 |
r_ban5 = gr.Dropdown([None] + ALL_HEROES_COMBINED, label="R-Ban 5")
|
| 168 |
|
| 169 |
with gr.Row():
|
| 170 |
+
# BLUE TEAM
|
| 171 |
with gr.Column(elem_classes="blue-side", scale=1):
|
| 172 |
+
gr.HTML("<h3 style='color: #60a5fa; margin-top:0; text-align:center;'>🔵 TIM KAMU</h3>")
|
| 173 |
rank_pick = gr.Dropdown(["Pro-Tournament", "Ranked Match"], value="Pro-Tournament", label="Format")
|
|
|
|
| 174 |
b1 = gr.Dropdown([None] + JUNGLER_POOL, label="⚔️ Jungler")
|
| 175 |
img_b1 = gr.HTML(update_hero_html(None))
|
| 176 |
b2 = gr.Dropdown([None] + ROAMER_POOL, label="🛡️ Roamer")
|
|
|
|
| 182 |
b5 = gr.Dropdown([None] + GOLD_LANER_POOL, label="🏹 Gold Laner")
|
| 183 |
img_b5 = gr.HTML(update_hero_html(None))
|
| 184 |
|
| 185 |
+
# EVALUASI CANDLE BLOCKS (CENTER AREA)
|
| 186 |
+
with gr.Column(scale=1.2):
|
| 187 |
+
btn_analyze = gr.Button("⚡ HITUNG KEKUATAN SKENARIO DRAF", variant="primary", size="lg")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
+
gr.HTML("<h3 style='color: #3b82f6; margin-top:15px; text-align:center;'>📊 EVALUASI KONDISI TIM KAMU</h3>")
|
| 190 |
+
blue_eval_out = gr.HTML("<p style='color: #64748b;'>Rancang blueprint tim...</p>")
|
| 191 |
+
|
| 192 |
+
gr.HTML("<h3 style='color: #ef4444; margin-top:15px; text-align:center;'>📊 EVALUASI KONDISI TIM LAWAN</h3>")
|
| 193 |
+
red_eval_out = gr.HTML("<p style='color: #64748b;'>Rancang draf musuh...</p>")
|
| 194 |
+
|
| 195 |
+
# RED TEAM
|
| 196 |
+
with gr.Column(elem_classes="red-side", scale=1):
|
| 197 |
+
gr.HTML("<h3 style='color: #f87171; margin-top:0; text-align:center;'>🔴 TIM LAWAN</h3>")
|
| 198 |
r1 = gr.Dropdown([None] + JUNGLER_POOL, label="⚔️ Enemy Jungler")
|
| 199 |
img_r1 = gr.HTML(update_hero_html(None))
|
| 200 |
r2 = gr.Dropdown([None] + ROAMER_POOL, label="🛡️ Enemy Roamer")
|
|
|
|
| 206 |
r5 = gr.Dropdown([None] + GOLD_LANER_POOL, label="🏹 Enemy Gold Laner")
|
| 207 |
img_r5 = gr.HTML(update_hero_html(None))
|
| 208 |
|
| 209 |
+
gr.HTML("<h2 style='color: #fbbf24; border-bottom: 2px solid #fbbf24; padding-bottom: 5px; margin-top:20px;'>🕵️ DEEP RESPONSIVE COUNTER POOL ADVICE</h2>")
|
| 210 |
+
counter_out = gr.HTML("<p style='color: #64748b;'>Sistem siap menganalisis...</p>")
|
| 211 |
|
| 212 |
# BINDING IMAGE CHANGES VIA HTML INJECTION
|
| 213 |
b1.change(fn=update_hero_html, inputs=b1, outputs=img_b1)
|
|
|
|
| 226 |
btn_analyze.click(
|
| 227 |
fn=analyze_tournament_draft,
|
| 228 |
inputs=[rank_pick, b1, b2, b3, b4, b5, r1, r2, r3, r4, r5, b_ban1, b_ban2, b_ban3, b_ban4, b_ban5, r_ban1, r_ban2, r_ban3, r_ban4, r_ban5],
|
| 229 |
+
outputs=[counter_out, blue_eval_out, red_eval_out]
|
| 230 |
)
|
| 231 |
|
| 232 |
if __name__ == "__main__":
|