Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -263,17 +263,16 @@ def _render_leaderboard() -> str:
|
|
| 263 |
white-space:pre-wrap;">{full}</div>
|
| 264 |
</details>""" if has_more else f'<div style="font-size:.78rem;color:#555;line-height:1.45;margin-bottom:4px;">{preview}</div>'
|
| 265 |
|
| 266 |
-
# NEU:
|
| 267 |
btn_html = ""
|
| 268 |
if rank < 3:
|
| 269 |
-
# Strings sauber escapen, damit sie das JavaScript nicht kaputt machen
|
| 270 |
verdict_esc = e.get('verdict', '').replace("'", "\\'").replace('"', '"').replace('\n', ' ')
|
| 271 |
btn_html = f"""
|
| 272 |
<button onclick="exportBadgePNG('{side}', '{pct}', '{e['total']}/{e['max']}', '{verdict_esc}', '{medal}', '{e.get('date', '')}')"
|
| 273 |
-
style="margin-top:
|
| 274 |
-
onmouseover="this.style.background='#
|
| 275 |
-
onmouseout="this.style.background='#
|
| 276 |
-
📸
|
| 277 |
</button>
|
| 278 |
"""
|
| 279 |
|
|
|
|
| 263 |
white-space:pre-wrap;">{full}</div>
|
| 264 |
</details>""" if has_more else f'<div style="font-size:.78rem;color:#555;line-height:1.45;margin-bottom:4px;">{preview}</div>'
|
| 265 |
|
| 266 |
+
# NEU: Extrem dezenter Badge Export Button für die Top 3
|
| 267 |
btn_html = ""
|
| 268 |
if rank < 3:
|
|
|
|
| 269 |
verdict_esc = e.get('verdict', '').replace("'", "\\'").replace('"', '"').replace('\n', ' ')
|
| 270 |
btn_html = f"""
|
| 271 |
<button onclick="exportBadgePNG('{side}', '{pct}', '{e['total']}/{e['max']}', '{verdict_esc}', '{medal}', '{e.get('date', '')}')"
|
| 272 |
+
style="margin-top:10px; background:transparent; color:#888; border:1px solid #E0DFDC; border-radius:99px; padding:2px 10px; font-size:.68rem; font-weight:600; cursor:pointer; transition: all 0.15s;"
|
| 273 |
+
onmouseover="this.style.background='#EBF3FB'; this.style.color='#0A66C2'; this.style.borderColor='#70B5F9';"
|
| 274 |
+
onmouseout="this.style.background='transparent'; this.style.color='#888'; this.style.borderColor='#E0DFDC';">
|
| 275 |
+
📸 PNG Export
|
| 276 |
</button>
|
| 277 |
"""
|
| 278 |
|