File size: 6,719 Bytes
0061e14
70a0e60
 
 
 
 
 
967ec13
e5e5305
967ec13
 
0061e14
005b269
e5e5305
4d77847
1bed249
e30b579
ad81b69
 
fdc7723
d7db717
 
 
06f2a09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7db717
e5e5305
 
005b269
70a0e60
1bed249
e5e5305
70a0e60
 
 
 
 
e5e5305
ad81b69
 
70a0e60
e5e5305
ad81b69
61bdf51
ad81b69
 
fdc7723
 
d9b5156
61bdf51
ad81b69
 
e5e5305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260568f
 
fdc7723
e5e5305
fdc7723
70a0e60
97d33e1
 
70a0e60
fdc7723
e5e5305
fdc7723
 
70a0e60
1cde003
afb90fb
967ec13
 
e5e5305
97d33e1
1bed249
70a0e60
e5e5305
1bed249
e5e5305
 
70a0e60
1bed249
0061e14
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
custom_css = """
:root, [data-theme="light"] {
  --f1-text: #111827;
  --f1-subtle: #6b7280;
  --f1-border: #e5e7eb;
  --f1-bg: #ffffff;
  --f1-bg-muted: #f9fafb;

  /* Nuke Gradio chrome that interfered with colors */
  --block-border-color: transparent !important;
  --background-fill-primary: transparent !important;
}

/* Width caps */
.f1-container { max-width: 800px; margin: 0 auto; padding: 0 16px; }
.markdown-text { font-size: 16px !important; max-width: 800px; margin: 0 auto; }
#what-is-tab { max-width: 800px; margin-left: auto; margin-right: auto; }
/* requested 710px */
#f1-examples { max-width: 710px; margin: 0 auto; }

/* NEW: landing tab width + tier selector alignment */
#landing-accuracy-tab { max-width: 800px; margin-left: auto; margin-right: auto; }
#f1-tier-select-row { justify-content: flex-end; margin-bottom: 6px; }
#f1-tier-select-row { justify-content: flex-end; margin-bottom: 6px; }
#f1-tier-select .wrap {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid var(--f1-border);
  border-radius: 999px;
}
#f1-tier-select input[type="radio"] { display: none; }
#f1-tier-select label {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  cursor: pointer;
}
#f1-tier-select input[type="radio"]:checked + span {
  background: #eef2ff; /* subtle non-white for selected pill */
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Text */
.f1-p, .f1-li { line-height: 1.75; color: #374151; text-wrap: pretty; overflow-wrap: break-word; hyphens: auto; }

/* Headings */
.f1-h1 { font-weight: 700; font-size: 2.25rem; line-height: 2.5rem; color: var(--f1-text); text-align: center; margin-bottom: 1.25rem !important; }
.f1-h2 { font-weight: 700; border-bottom: 1px solid var(--f1-border); padding-bottom: 0.45rem; margin-top: 1.75rem; margin-bottom: 0.9rem; color: var(--f1-text); font-size: 1.5rem; line-height: 2rem; }

/* Links */
.f1-a { color: #2563eb; text-decoration: none; font-weight: 500; }
.f1-a:hover { text-decoration: underline; }

/* Captions (centered + dark) */
.f1-figcaption { margin-top: 4px; font-size: 0.875rem; color: #111827; text-align: center; }
.f1-figcaption-video { margin-top: 2px; } /* tighter under the video */

/* Problem name — force center from first render; code bg color #f9fafb */
#f1-examples .f1-problem-markdown .markdown p:first-child { text-align: center !important; margin: 0 0 8px 0; }
.f1-problem-markdown p code,
#f1-examples .f1-problem-markdown .markdown p:first-child code {
  display: inline-block; background: #f9fafb !important; padding: 2px 8px; border-radius: 6px; margin-left: auto; margin-right: auto;
}

.f1-problem-markdown > * { margin-top: 7px; margin-bottom: 7px; line-height: 1.8; }

/* Problem body: padding + comfortable line-height inside Markdown + small space before tabs */
#f1-examples .f1-problem-markdown .markdown { background: var(--f1-bg-muted); border: 1px solid var(--f1-border); border-radius: 8px; padding: 18px; margin: 10px 14px 10px 14px; line-height: 1.8; }
#f1-examples .f1-problem-markdown .markdown p { margin: 0.35rem 0; }

/* Pills (Radio) — compact spacing at bottom */
#f1-example-radio { border-top: 1px solid var(--f1-border); padding: 8px 10px 4px 10px; margin: 0 8px 2px; }
#f1-example-radio input[type="radio"] { display: none; }
#f1-example-radio .wrap { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
#f1-example-radio label { border: 1px solid var(--f1-border); border-radius: 999px; padding: 6px 10px; cursor: pointer; background: #f3f4f6; }
#f1-example-radio input[type="radio"]:checked + span { background: #e5e7eb; border-color: var(--f1-border); border-radius: 999px; padding: 6px 10px; }

/* Examples card chrome */
#f1-examples { background: var(--f1-bg-muted); border: 1px solid var(--f1-border); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); margin-bottom: 12px; }
#f1-examples .form { background: transparent !important; }  /* no bg on inner form container */
.f1-tabs-body { padding-top: 12px; text-align: center; }
.f1-examples-chip { display: inline-block; background: #e5e7eb; color: #111827; padding: 6px 12px; border-radius: 999px; font-weight: 700; }

/* Figures via Gradio components (centered, rounded, shadow) */
.f1-image img, .f1-video video { width: 100%; max-width: 42rem; display: block; margin: 0 auto; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* Categories "table" — equal width per column set; compact first two, flexible third */
.f1-grid-wrap { text-align: center; margin: 10px auto 8px auto; }
.f1-grid-table {
  display: inline-grid;
  grid-template-columns: max-content 12ch minmax(360px, 1fr);  /* 2nd col fixed width; 3rd grows */
  border: 1px solid var(--f1-border);
  background: var(--f1-bg);
  border-radius: 8px;
  overflow: hidden;
}
.f1-grid-row { display: contents; }
.f1-grid-cell { padding: 8px 12px; text-align: left; border-left: 1px solid var(--f1-border); border-top: 1px solid var(--f1-border); white-space: normal; }
.f1-grid-cell:nth-child(3n+1) { border-left: none; }
.f1-grid-head .f1-grid-cell { font-weight: 600; text-align: center; border-top: none; }

#f1-login-box { width: 800px; margin: auto; }

/* Leaderboard: cap width at 800px and center; keep your chain rule */
#formulaone-leaderboard-tab-table { max-width: 800px; margin-left: auto; margin-right: auto; }
#formulaone-leaderboard-tab-table .column .row .column { min-width: 80% !important; }
#formulaone-leaderboard-tab-table .row, #formulaone-leaderboard-tab-table .column { width: 100% !important; max-width: 100% !important; }
#formulaone-leaderboard-tab-table [data-testid="dropdown"], #formulaone-leaderboard-tab-table input[type="text"] { width: 100% !important; }

/* Login button: force light and width cap */
#hf-login-btn, #hf-login-btn button, button[data-testid="login-button"], [data-testid="login-button"] button, div[data-testid="login-button"] > button {
  background: #ffffff !important; color: #1f2937 !important; border: 1px solid var(--f1-border) !important; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04) !important;
  max-width: 800px !important; width: 100% !important; margin-left: auto !important; margin-right: auto !important;
}
#hf-login-btn:hover, #hf-login-btn button:hover, button[data-testid="login-button"]:hover, [data-testid="login-button"] button:hover, div[data-testid="login-button"] > button:hover { background: #f9fafb !important; }
"""

get_window_url_params = """
    function(url_params) {
        const params = new URLSearchParams(window.location.search);
        url_params = Object.fromEntries(params);
        return url_params;
    }
    """