ggcristian commited on
Commit
bf30e64
·
1 Parent(s): ff0c247

Add badges styling

Browse files
Files changed (2) hide show
  1. style/css_html_js.py +40 -0
  2. utils.py +3 -3
style/css_html_js.py CHANGED
@@ -173,6 +173,46 @@ flex-grow: 0;
173
  text-decoration: underline;
174
  opacity: 0.8;
175
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  """
177
 
178
  get_window_url_params = """
 
173
  text-decoration: underline;
174
  opacity: 0.8;
175
  }
176
+
177
+ .badge {
178
+ display: inline-flex;
179
+ align-items: center;
180
+ line-height: 1;
181
+ vertical-align: middle;
182
+ font-size: 11px;
183
+ text-transform: uppercase;
184
+ font-weight: 500;
185
+ padding: 2px 4px 0px 4px;
186
+ border-radius: 6px;
187
+ user-select: none;
188
+ white-space: nowrap;
189
+ }
190
+
191
+ .reasoning-badge {
192
+ opacity: 0.5;
193
+ background-color: #fdf2f8;
194
+ color: #9d174d;
195
+ border: 1px solid #fbcfe8;
196
+ }
197
+
198
+ .new-badge {
199
+ color: #ab8900;
200
+ border: 1px dashed #d9b31c;
201
+ }
202
+
203
+ @media (prefers-color-scheme: dark) {
204
+ .reasoning-badge {
205
+ opacity: 0.7;
206
+ background-color: #4a044e;
207
+ color: #f5d0fe;
208
+ border-color: #c026d3;
209
+ }
210
+ .new-badge {
211
+ opacity: 0.8;
212
+ color: #fde68a;
213
+ border-color: #bda237
214
+ }
215
+ }
216
  """
217
 
218
  get_window_url_params = """
utils.py CHANGED
@@ -17,14 +17,14 @@ type_emoji = {
17
 
18
  def model_hyperlink(link, model_name, release, thinking=False):
19
  ret = f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
20
- new_badge = f' <span style="opacity: 0.7; font-variant: all-small-caps; font-weight: 600">new</span>'
21
- reasoning_badge = f' <span style="opacity: 0.9; font-variant: all-small-caps; font-weight: 600; color: #5C6BC0">(reasoning)</span>'
22
 
23
  if release == "V1":
24
  return ret + reasoning_badge if thinking == "Reasoning" else ret
25
  else:
26
  return (
27
- ret + new_badge + reasoning_badge
28
  if thinking == "Reasoning"
29
  else ret + new_badge
30
  )
 
17
 
18
  def model_hyperlink(link, model_name, release, thinking=False):
19
  ret = f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
20
+ new_badge = f' <span class="badge new-badge">new</span>'
21
+ reasoning_badge = f' <span class="badge reasoning-badge">reasoning</span>'
22
 
23
  if release == "V1":
24
  return ret + reasoning_badge if thinking == "Reasoning" else ret
25
  else:
26
  return (
27
+ ret + reasoning_badge + new_badge
28
  if thinking == "Reasoning"
29
  else ret + new_badge
30
  )