Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 5,776 Bytes
0061e14 70a0e60 967ec13 0061e14 005b269 260568f 4d77847 1bed249 e30b579 005b269 e30b579 70a0e60 1bed249 70a0e60 005b269 70a0e60 1bed249 e30b579 70a0e60 1bed249 70a0e60 4d77847 1bed249 70a0e60 967ec13 4d77847 70a0e60 967ec13 260568f 967ec13 70a0e60 97d33e1 70a0e60 967ec13 e30b579 967ec13 e30b579 967ec13 e30b579 967ec13 e30b579 70a0e60 967ec13 97d33e1 967ec13 97d33e1 e30b579 967ec13 e30b579 97d33e1 70a0e60 967ec13 260568f e30b579 260568f e30b579 967ec13 260568f 967ec13 97d33e1 e30b579 97d33e1 e30b579 260568f 97d33e1 e30b579 967ec13 e30b579 967ec13 e30b579 260568f 967ec13 e30b579 97d33e1 1bed249 70a0e60 1bed249 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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
custom_css = """
:root, [data-theme="light"] {
--f1-text: #111827;
--f1-subtle: #6b7280;
--f1-border: #e5e7eb;
--f1-bg: #ffffff;
--f1-bg-muted: #f9fafb;
/* Disable Gradio block chrome that was bleeding into the Examples switcher */
--block-border-color: transparent !important;
--background-fill-primary: transparent !important;
}
/* Readable width everywhere */
.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; }
#f1-examples { max-width: 800px; margin: 0 auto; }
/* Body 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, problem name */
.f1-figcaption { margin-top: 0.5rem; font-size: 0.875rem; color: #111827; text-align: center; }
.f1-problem-name { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-weight: 600; text-align: center; }
/* ===== Clean "table" (equal column widths per column; compact first two, flexible third) ===== */
.f1-grid-wrap { text-align: center; margin: 10px auto 8px auto; }
.f1-grid-table {
display: inline-grid; /* center + shrink-to-fit */
grid-template-columns: max-content max-content minmax(360px, auto);
border: 1px solid var(--f1-border); /* full border */
background: var(--f1-bg);
border-radius: 8px;
overflow: hidden;
}
.f1-grid-row { display: contents; } /* rows share the same columns */
.f1-grid-cell {
padding: 8px 12px;
text-align: left;
border-left: 1px solid var(--f1-border);
border-top: 1px solid var(--f1-border);
}
.f1-grid-cell:nth-child(3n+1) { border-left: none; } /* first column cells: no left border */
.f1-grid-head .f1-grid-cell {
font-weight: 600;
text-align: center;
border-top: none; /* top edge of the grid */
}
/* ===== Examples block ===== */
#f1-examples {
background: var(--f1-bg-muted); /* #f9fafb */
border: 1px solid var(--f1-border);
border-radius: 10px;
box-shadow: 0 1px 2px rgba(0,0,0,0.04);
margin-bottom: 12px;
}
.f1-tabs-body { padding-top: 12px; text-align: center; }
.f1-examples-chip {
display: inline-block;
background: #e5e7eb; /* slightly darker than #f9fafb */
color: #111827;
padding: 6px 12px;
border-radius: 999px;
font-weight: 700;
}
/* Problem content: consistent background + padding + spacing above the 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 12px 14px; /* bottom margin creates padding before tabs */
}
/* Pills (Radio) — hide bullets, light gray inactive, darker selected */
#f1-example-radio { border-top: 1px solid var(--f1-border); padding: 8px 10px 10px 10px; margin: 0 8px 8px; }
#f1-example-radio input[type="radio"] { display: none; }
#f1-example-radio .wrap { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
#f1-example-radio label {
border: 1px solid var(--f1-border);
border-radius: 999px;
padding: 6px 12px;
cursor: pointer;
background: #f3f4f6; /* inactive pills */
}
#f1-example-radio input[type="radio"]:checked + span {
background: #e5e7eb; /* active pill */
border-color: var(--f1-border);
border-radius: 999px;
padding: 6px 12px;
}
/* Gradio video styling (centered, rounded, subtle shadow) */
.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); }
/* 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; } /* exact chain rule */
#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 */
#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;
}
#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;
}
"""
|