techfreakworm commited on
Commit
607a667
·
unverified ·
1 Parent(s): 3f1ee45

feat(ui): add a support nudge to the community banner

Browse files

Restructure the top strip into a split: a support nudge (left) and the
Discord/Skool pills (right). The nudge copy adapts by platform via the
same on_zerogpu() switch the device layer uses — 'star it on github'
locally (links the repo), 'drop a like at the top' on the Space (points
at HF's like button). Coral is reserved for the single heart/star glyph;
both community pills settle to amber. No motion on the nudge.

Files changed (1) hide show
  1. qvs/ui/theme.py +40 -11
qvs/ui/theme.py CHANGED
@@ -102,17 +102,23 @@ body, .gradio-container {{
102
  }}
103
  .qvs-meter b {{ color: var(--signal); font-weight:500; }}
104
 
105
- /* community banner — top strip */
106
  .qvs-banner {{
107
- display:flex; align-items:center; flex-wrap:wrap; gap:10px;
108
  padding:9px 14px; margin: 2px 0 6px;
109
  border:1px solid var(--line); border-radius:8px;
110
  background: linear-gradient(90deg, rgba(240,169,59,0.09), rgba(255,107,74,0.06) 55%, rgba(0,0,0,0.15));
111
  }}
112
- .qvs-banner-label {{
113
- font-family:'IBM Plex Mono', monospace; font-size:11px; letter-spacing:0.14em;
114
- text-transform:uppercase; color:var(--muted);
 
115
  }}
 
 
 
 
 
116
  .qvs-banner-btn {{
117
  display:inline-flex; align-items:center; gap:8px;
118
  padding:6px 12px; border-radius:6px; text-decoration:none !important;
@@ -123,10 +129,7 @@ body, .gradio-container {{
123
  .qvs-banner-btn:hover {{ border-color:var(--signal); background:rgba(240,169,59,0.12); }}
124
  .qvs-banner-btn .arw {{ color:var(--muted); transition: transform .15s ease, color .15s ease; }}
125
  .qvs-banner-btn:hover .arw {{ transform:translateX(3px); color:var(--signal); }}
126
- .qvs-banner-btn.skool {{ color:var(--hot) !important; }}
127
- .qvs-banner-btn.skool:hover {{ border-color:var(--hot); background:rgba(255,107,74,0.12); }}
128
- .qvs-banner-btn.skool:hover .arw {{ color:var(--hot); }}
129
- @media (max-width:640px){{ .qvs-banner-label {{ width:100%; }} }}
130
 
131
  /* eyebrow labels */
132
  .qvs-eyebrow {{
@@ -200,13 +203,39 @@ def header_html() -> str:
200
 
201
 
202
  def banner_html() -> str:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  return (
204
  '<div class="qvs-banner">'
205
- '<span class="qvs-banner-label">Join the community</span>'
 
206
  '<a class="qvs-banner-btn" href="https://discord.gg/qbn3exeEXa" target="_blank" rel="noopener noreferrer">'
207
  'Discord — chat with the maker <span class="arw">&rarr;</span></a>'
208
- '<a class="qvs-banner-btn skool" href="https://www.skool.com/techfreaks-ai-club-6037/about" target="_blank" rel="noopener noreferrer">'
209
  'Skool — TechFreaks AI Club <span class="arw">&rarr;</span></a>'
 
210
  '</div>'
211
  )
212
 
 
102
  }}
103
  .qvs-meter b {{ color: var(--signal); font-weight:500; }}
104
 
105
+ /* community banner — top strip: support nudge (left) · community pills (right) */
106
  .qvs-banner {{
107
+ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px;
108
  padding:9px 14px; margin: 2px 0 6px;
109
  border:1px solid var(--line); border-radius:8px;
110
  background: linear-gradient(90deg, rgba(240,169,59,0.09), rgba(255,107,74,0.06) 55%, rgba(0,0,0,0.15));
111
  }}
112
+ /* the support nudge — one line, mono; its heart/star is the ONLY coral glyph, no motion */
113
+ .qvs-nudge {{
114
+ display:inline-flex; align-items:center; gap:7px; text-decoration:none !important;
115
+ font-family:'IBM Plex Mono', monospace; font-size:12.5px; letter-spacing:0.02em; color:var(--muted);
116
  }}
117
+ .qvs-nudge b {{ color:var(--text); font-weight:500; }}
118
+ .qvs-nudge .heart {{ color:var(--hot); }}
119
+ .qvs-nudge .up {{ color:var(--signal); }}
120
+ a.qvs-nudge:hover b {{ color:var(--signal); }} /* hover brighten (link/local only) */
121
+ .qvs-banner-actions {{ display:inline-flex; align-items:center; flex-wrap:wrap; gap:8px; }}
122
  .qvs-banner-btn {{
123
  display:inline-flex; align-items:center; gap:8px;
124
  padding:6px 12px; border-radius:6px; text-decoration:none !important;
 
129
  .qvs-banner-btn:hover {{ border-color:var(--signal); background:rgba(240,169,59,0.12); }}
130
  .qvs-banner-btn .arw {{ color:var(--muted); transition: transform .15s ease, color .15s ease; }}
131
  .qvs-banner-btn:hover .arw {{ transform:translateX(3px); color:var(--signal); }}
132
+ @media (max-width:560px){{ .qvs-banner {{ justify-content:flex-start; }} }}
 
 
 
133
 
134
  /* eyebrow labels */
135
  .qvs-eyebrow {{
 
203
 
204
 
205
  def banner_html() -> str:
206
+ """Top community strip: a support nudge (left) + Discord/Skool pills (right).
207
+
208
+ The nudge copy adapts to where the app runs — the same ``on_zerogpu()``
209
+ switch the device layer uses. On the Space the heart is HF's native like
210
+ button (top-right chrome), so we point at it; locally the honest equivalent
211
+ is a GitHub star, which we can actually link.
212
+ """
213
+ from ..device import on_zerogpu
214
+
215
+ if on_zerogpu():
216
+ # The HF like button sits in the top chrome next to the Space title — "at
217
+ # the top" (ltx's proven, position-agnostic phrasing), not a named corner.
218
+ nudge = (
219
+ '<span class="qvs-nudge">'
220
+ '<span class="heart">&#9829;</span> enjoying it? '
221
+ '<b>drop a like at the top&nbsp;<span class="up">&uarr;</span></b></span>'
222
+ )
223
+ else:
224
+ nudge = (
225
+ '<a class="qvs-nudge" href="https://github.com/techfreakworm/qwen-voice-studio" '
226
+ 'target="_blank" rel="noopener noreferrer">'
227
+ '<span class="heart">&#9733;</span> useful? '
228
+ '<b>star it on github&nbsp;<span class="up">&rarr;</span></b></a>'
229
+ )
230
  return (
231
  '<div class="qvs-banner">'
232
+ f'{nudge}'
233
+ '<span class="qvs-banner-actions">'
234
  '<a class="qvs-banner-btn" href="https://discord.gg/qbn3exeEXa" target="_blank" rel="noopener noreferrer">'
235
  'Discord — chat with the maker <span class="arw">&rarr;</span></a>'
236
+ '<a class="qvs-banner-btn" href="https://www.skool.com/techfreaks-ai-club-6037/about" target="_blank" rel="noopener noreferrer">'
237
  'Skool — TechFreaks AI Club <span class="arw">&rarr;</span></a>'
238
+ '</span>'
239
  '</div>'
240
  )
241