def get_rank_badge(rank):
"""Generate HTML for rank badge with appropriate styling"""
badge_styles = {
1: ("1st", "linear-gradient(145deg, #ffd700, #ffc400)", "#000"),
2: ("2nd", "linear-gradient(145deg, #9ca3af, #787C7E)", "#fff"),
3: ("3rd", "linear-gradient(145deg, #CD7F32, #b36a1d)", "#fff"),
}
if rank in badge_styles:
label, gradient, text_color = badge_styles[rank]
return f"""
{label}
"""
return f"""
{rank}
"""
def get_type_badge(model_type):
"""Generate HTML for model type badge"""
colors = {"Private": "#4F46E5", "Open source": "#16A34A"}
bg_color = colors.get(model_type, "#4F46E5")
return f"""
{model_type}
"""
def get_score_bar(score):
"""Generate HTML for score bar"""
width = score * 100
return f"""
"""
def get_output_type_badge(output_type):
"""Generate HTML for output type badges with different colors, supporting both light and dark themes"""
type_styles = {
"Normal": {
"light": {"bg": "#F3F4F6", "color": "#374151"},
"dark": {"bg": "#374151", "color": "#F3F4F6"},
},
"Reasoning": {
"light": {"bg": "#DBEAFE", "color": "#1E40AF"},
"dark": {"bg": "#1E40AF", "color": "#DBEAFE"},
},
}
style = type_styles.get(output_type, type_styles["Normal"])
return f"""
{output_type}
"""