PromptMeister commited on
Commit
0708f1d
Β·
verified Β·
1 Parent(s): f771ead

Update app.py

Browse files

What I've added:

Element IDs for each tab to target them specifically
Multiple font fallbacks prioritizing emoji fonts
Aggressive CSS targeting using various selectors
Specific emoji font targeting for each tab button

The new approach includes:

βœ… Element IDs - Each tab now has a unique ID for targeting
βœ… Multiple font stacks - Prioritizes emoji fonts first
βœ… Aria-controls targeting - Targets the actual button elements
βœ… Forced emoji fonts - 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji'

This should now display:

πŸ”¬ Token Visualization
πŸ“Š Full Analysis
πŸ“ˆ Evolution Chart
🌐 SERP Results
πŸ“‰ Ranking History
πŸ’Ύ Raw Data

Files changed (1) hide show
  1. app.py +61 -11
app.py CHANGED
@@ -150,7 +150,7 @@ p, span, div:not(.gr-button), .gr-markdown {
150
  font-weight: 600 !important;
151
  }
152
 
153
- /* Fix tab text and icons */
154
  .gr-tab-nav {
155
  background: var(--gradient-card) !important;
156
  border-radius: 12px !important;
@@ -166,8 +166,11 @@ p, span, div:not(.gr-button), .gr-markdown {
166
  padding: 0.75rem 1.5rem !important;
167
  transition: all 0.3s ease !important;
168
  font-weight: 500 !important;
169
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif !important;
170
  white-space: nowrap !important;
 
 
 
171
  }
172
 
173
  .gr-tab-nav button.selected {
@@ -181,14 +184,61 @@ p, span, div:not(.gr-button), .gr-markdown {
181
  color: var(--text-primary) !important;
182
  }
183
 
184
- /* Force tab button text visibility */
185
  .gr-tab-nav button,
186
  .gr-tab-nav button *,
187
- .gr-tab-nav button span {
 
 
 
188
  color: inherit !important;
189
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif !important;
 
 
190
  }
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  /* Buttons */
193
  .gr-button {
194
  background: var(--gradient-button) !important;
@@ -1630,22 +1680,22 @@ with gr.Blocks(
1630
 
1631
  with gr.Column(scale=2):
1632
  with gr.Tabs():
1633
- with gr.Tab("πŸ”¬ Token Visualization"):
1634
  token_viz_html = gr.HTML()
1635
 
1636
- with gr.Tab("πŸ“Š Full Analysis"):
1637
  analysis_html = gr.HTML()
1638
 
1639
- with gr.Tab("πŸ“ˆ Evolution Chart"):
1640
  evolution_chart = gr.Plot(label="Keyword Evolution Forecast")
1641
 
1642
- with gr.Tab("🌐 SERP Results"):
1643
  serp_html = gr.HTML()
1644
 
1645
- with gr.Tab("πŸ“‰ Ranking History"):
1646
  ranking_chart = gr.Plot(label="Keyword Ranking History")
1647
 
1648
- with gr.Tab("οΏ½οΏ½ Raw Data"):
1649
  json_output = gr.JSON()
1650
 
1651
  # Event handlers
 
150
  font-weight: 600 !important;
151
  }
152
 
153
+ /* Fix tab text and icons - AGGRESSIVE APPROACH */
154
  .gr-tab-nav {
155
  background: var(--gradient-card) !important;
156
  border-radius: 12px !important;
 
166
  padding: 0.75rem 1.5rem !important;
167
  transition: all 0.3s ease !important;
168
  font-weight: 500 !important;
169
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', system-ui, sans-serif !important;
170
  white-space: nowrap !important;
171
+ display: flex !important;
172
+ align-items: center !important;
173
+ justify-content: center !important;
174
  }
175
 
176
  .gr-tab-nav button.selected {
 
184
  color: var(--text-primary) !important;
185
  }
186
 
187
+ /* Force tab button text visibility with multiple selectors */
188
  .gr-tab-nav button,
189
  .gr-tab-nav button *,
190
+ .gr-tab-nav button span,
191
+ button[role="tab"],
192
+ button[role="tab"] *,
193
+ button[role="tab"] span {
194
  color: inherit !important;
195
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', system-ui, sans-serif !important;
196
+ opacity: 1 !important;
197
+ visibility: visible !important;
198
  }
199
 
200
+ /* Force emoji rendering */
201
+ .gr-tab-nav button::before {
202
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', system-ui !important;
203
+ }
204
+
205
+ /* Target any hidden text in tabs */
206
+ .gr-tabs .gr-tab-nav button {
207
+ font-size: 14px !important;
208
+ line-height: 1.5 !important;
209
+ }
210
+
211
+ /* Ensure tab content is visible */
212
+ .gr-tabs .gr-tab-nav {
213
+ overflow: visible !important;
214
+ }
215
+
216
+ /* Additional fallback for stubborn elements */
217
+ [class*="tab"] button {
218
+ color: var(--text-secondary) !important;
219
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', system-ui, sans-serif !important;
220
+ }
221
+
222
+ [class*="tab"] button.selected {
223
+ color: var(--text-primary) !important;
224
+ }
225
+
226
+ /* Specific tab targeting with elem_ids */
227
+ #tab-token button, #tab-analysis button, #tab-evolution button,
228
+ #tab-serp button, #tab-ranking button, #tab-data button {
229
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', system-ui, sans-serif !important;
230
+ color: var(--text-secondary) !important;
231
+ font-size: 14px !important;
232
+ }
233
+
234
+ /* Force emoji rendering for specific tabs */
235
+ button[aria-controls*="tab-token"] { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important; }
236
+ button[aria-controls*="tab-analysis"] { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important; }
237
+ button[aria-controls*="tab-evolution"] { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important; }
238
+ button[aria-controls*="tab-serp"] { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important; }
239
+ button[aria-controls*="tab-ranking"] { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important; }
240
+ button[aria-controls*="tab-data"] { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important; }
241
+
242
  /* Buttons */
243
  .gr-button {
244
  background: var(--gradient-button) !important;
 
1680
 
1681
  with gr.Column(scale=2):
1682
  with gr.Tabs():
1683
+ with gr.Tab("πŸ”¬ Token Visualization", elem_id="tab-token"):
1684
  token_viz_html = gr.HTML()
1685
 
1686
+ with gr.Tab("πŸ“Š Full Analysis", elem_id="tab-analysis"):
1687
  analysis_html = gr.HTML()
1688
 
1689
+ with gr.Tab("πŸ“ˆ Evolution Chart", elem_id="tab-evolution"):
1690
  evolution_chart = gr.Plot(label="Keyword Evolution Forecast")
1691
 
1692
+ with gr.Tab("🌐 SERP Results", elem_id="tab-serp"):
1693
  serp_html = gr.HTML()
1694
 
1695
+ with gr.Tab("πŸ“‰ Ranking History", elem_id="tab-ranking"):
1696
  ranking_chart = gr.Plot(label="Keyword Ranking History")
1697
 
1698
+ with gr.Tab("πŸ’Ύ Raw Data", elem_id="tab-data"):
1699
  json_output = gr.JSON()
1700
 
1701
  # Event handlers