Commit ·
b7e9e0a
1
Parent(s): bb0f4d9
Mobile responsive layout (≤768px and ≤480px breakpoints)
Browse files- Tag the main controls/outputs row with elem_classes='ovc-main'
so we can target it specifically.
- At ≤768px: collapse the two-column layout into a single stacked
column (controls then outputs); shrink hero h1 (2.7rem → 2.05rem),
tagline, by-line chip, link pills, and description pills; tighten
pipeline-flow strip and hide its '›' arrows so the six steps wrap
naturally; reduce card padding; cap the visualization video at
280px tall; trim Run button to 48px.
- At ≤480px: shrink hero further (h1 1.7rem), trim links and step
chips a notch, drop Run button to 46px.
No JS changes; pure CSS.
app.py
CHANGED
|
@@ -1091,6 +1091,64 @@ CUSTOM_CSS = """
|
|
| 1091 |
margin-top: 4px;
|
| 1092 |
font-weight: 600;
|
| 1093 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1094 |
"""
|
| 1095 |
|
| 1096 |
THEME = gr.themes.Soft(
|
|
@@ -1178,7 +1236,7 @@ with gr.Blocks(**_BLOCK_KW) as demo:
|
|
| 1178 |
gr.HTML(HERO_HTML)
|
| 1179 |
gr.HTML(FLOW_HTML)
|
| 1180 |
|
| 1181 |
-
with gr.Row(equal_height=False):
|
| 1182 |
# ─── Controls (narrow column) ────────────────────────────────────
|
| 1183 |
with gr.Column(scale=4, min_width=320):
|
| 1184 |
with gr.Group(elem_classes="ovc-card"):
|
|
|
|
| 1091 |
margin-top: 4px;
|
| 1092 |
font-weight: 600;
|
| 1093 |
}
|
| 1094 |
+
|
| 1095 |
+
/* ─── Mobile / narrow viewport adjustments ─────────────────────────── */
|
| 1096 |
+
@media (max-width: 768px) {
|
| 1097 |
+
.gradio-container { padding: 6px !important; }
|
| 1098 |
+
|
| 1099 |
+
/* Force the controls/outputs row to stack vertically on phones */
|
| 1100 |
+
.gradio-container .ovc-main {
|
| 1101 |
+
flex-direction: column !important;
|
| 1102 |
+
gap: 12px !important;
|
| 1103 |
+
}
|
| 1104 |
+
.gradio-container .ovc-main > div {
|
| 1105 |
+
width: 100% !important;
|
| 1106 |
+
min-width: 0 !important;
|
| 1107 |
+
max-width: 100% !important;
|
| 1108 |
+
flex: 1 1 100% !important;
|
| 1109 |
+
}
|
| 1110 |
+
|
| 1111 |
+
/* Hero scales down */
|
| 1112 |
+
#ovc-hero { padding: 28px 14px 16px; border-radius: 16px; margin-bottom: 12px; }
|
| 1113 |
+
#ovc-hero h1 { font-size: 2.05rem; letter-spacing: -0.02em; }
|
| 1114 |
+
#ovc-hero p.tagline { font-size: 0.96rem; line-height: 1.5; margin-bottom: 12px; }
|
| 1115 |
+
#ovc-hero .by-line { font-size: 0.72rem; padding: 2px 9px; }
|
| 1116 |
+
.ovc-links { gap: 6px; margin-top: 10px; }
|
| 1117 |
+
.ovc-links a { font-size: 0.78rem; padding: 5px 10px; }
|
| 1118 |
+
#ovc-hero .pills { gap: 5px; }
|
| 1119 |
+
#ovc-hero .pill { font-size: 0.72rem; padding: 4px 9px; }
|
| 1120 |
+
|
| 1121 |
+
/* Pipeline flow: tight wrap, drop arrows */
|
| 1122 |
+
#ovc-flow { padding: 10px 12px; gap: 5px; margin-bottom: 12px; }
|
| 1123 |
+
#ovc-flow .step { font-size: 0.74rem; padding: 4px 10px; }
|
| 1124 |
+
#ovc-flow .arrow { display: none; }
|
| 1125 |
+
|
| 1126 |
+
/* Cards tighter */
|
| 1127 |
+
.ovc-card { padding: 12px 14px !important; border-radius: 14px !important; }
|
| 1128 |
+
.ovc-card h3 { font-size: 0.70rem !important; margin-bottom: 8px !important; }
|
| 1129 |
+
|
| 1130 |
+
/* Run button */
|
| 1131 |
+
#ovc-run button { height: 48px !important; font-size: 0.98rem !important; }
|
| 1132 |
+
|
| 1133 |
+
/* Stats tile sizing */
|
| 1134 |
+
.ovc-stats { grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 8px; }
|
| 1135 |
+
.ovc-stat { padding: 10px 12px; }
|
| 1136 |
+
.ovc-stat .value { font-size: 1.25rem; }
|
| 1137 |
+
.ovc-stat .label { font-size: 0.68rem; }
|
| 1138 |
+
|
| 1139 |
+
/* Outputs: shorter video so it does not dominate the screen */
|
| 1140 |
+
.ovc-card video { max-height: 280px !important; }
|
| 1141 |
+
}
|
| 1142 |
+
|
| 1143 |
+
@media (max-width: 480px) {
|
| 1144 |
+
#ovc-hero { padding: 22px 12px 14px; }
|
| 1145 |
+
#ovc-hero h1 { font-size: 1.7rem; }
|
| 1146 |
+
#ovc-hero p.tagline { font-size: 0.9rem; }
|
| 1147 |
+
/* Put each link on a row of two (browsers will pack 2 per row at this size) */
|
| 1148 |
+
.ovc-links a { font-size: 0.74rem; padding: 4px 9px; }
|
| 1149 |
+
#ovc-flow .step { font-size: 0.70rem; padding: 3px 8px; }
|
| 1150 |
+
#ovc-run button { height: 46px !important; font-size: 0.94rem !important; }
|
| 1151 |
+
}
|
| 1152 |
"""
|
| 1153 |
|
| 1154 |
THEME = gr.themes.Soft(
|
|
|
|
| 1236 |
gr.HTML(HERO_HTML)
|
| 1237 |
gr.HTML(FLOW_HTML)
|
| 1238 |
|
| 1239 |
+
with gr.Row(equal_height=False, elem_classes="ovc-main"):
|
| 1240 |
# ─── Controls (narrow column) ────────────────────────────────────
|
| 1241 |
with gr.Column(scale=4, min_width=320):
|
| 1242 |
with gr.Group(elem_classes="ovc-card"):
|