Linker1907 commited on
Commit
0916538
·
1 Parent(s): e599e77

better css

Browse files
Files changed (1) hide show
  1. app.py +236 -33
app.py CHANGED
@@ -285,9 +285,10 @@ def render_cards(tasks: list[TaskDoc]) -> str:
285
  dataset_links.append(f'<span class="dataset-more">+{len(datasets) - 6} more</span>')
286
  dataset_html = " ".join(dataset_links) if dataset_links else ""
287
  star_icon = "⭐ " if is_starred_benchmark(t) else ""
 
288
  items.append(
289
  f"""
290
- <article class="card" tabindex="0" aria-label="Task {task_name}">
291
  <div class="title"><span class="title-text">{star_icon}{task_name}</span> <span class="dataset-inline">{dataset_html}</span></div>
292
  {chips_tags_html}
293
  {chips_langs_html}
@@ -331,36 +332,203 @@ def on_toggle_tags_visibility(show: bool, selected_tags: list[str], languages: l
331
  # Custom CSS for the app
332
  custom_css = """
333
  /* layout */
334
- .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 10px; }
 
335
 
336
  /* card base */
337
- .card { border-radius: 12px; padding: 14px; transition: box-shadow 160ms ease, transform 120ms ease, border-color 120ms ease; outline: none; }
338
- .card:hover, .card:focus { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(2,6,23,0.08); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
 
340
- .title { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
341
- .title-text { font-weight: 600; font-size: 16px; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
342
- .dataset-inline { font-size: 12px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
 
344
- .chips { margin: 6px 0 4px 0; display:flex; gap:2px; flex-wrap:wrap; }
345
- .chips-tags { margin: 6px 0 2px 0; }
346
- .chips-langs { margin: 0 0 4px 0; }
347
- .chip { display:inline-block; padding:1px 2px; border-radius:999px; font-size:12px; background: #e6f2ff; color: #1e3a8a; }
348
- .chip-lang { background: #e8f5e9; color: #166534; }
 
 
 
 
 
 
 
 
 
349
 
350
- .abstract { color: #475569; font-size: 13.5px; line-height: 1.35; margin-top: 6px; min-height: 48px; }
351
- .links { margin-top: 10px; font-size:12px; }
352
- .links a { text-decoration: none; font-weight: 600; }
353
 
354
  .sep { color: #94a3b8; margin: 0 8px; }
355
 
356
- .dataset { margin-left: 8px; font-size: 12px; color: #0ea5e9; background: #ecfeff; padding: 2px 6px; border-radius: 6px; text-decoration: none; }
357
- .dataset-more { margin-left: 8px; font-size: 12px; color: #64748b; background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
 
359
  /* Light mode */
360
  :root {
361
- --bg: #f8fafc;
 
362
  --card-bg: #ffffff;
363
- --card-border: #e6f2ff;
364
  --title-color: #1e3a8a;
365
  --text-color: #0f172a;
366
  --muted: #475569;
@@ -370,35 +538,70 @@ custom_css = """
370
  /* Dark mode overrides */
371
  @media (prefers-color-scheme: dark) {
372
  :root {
373
- --bg: #0b1220;
 
374
  --card-bg: #071022;
375
- --card-border: #0f2a44;
376
  --title-color: #93c5fd;
377
  --text-color: #e6eef8;
378
  --muted: #cbd5e1;
379
  --link: #6ea8ff;
380
  }
381
- .dataset-more { color: #94a3b8; background: rgba(148,163,184,0.15); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  }
383
 
384
  /* apply */
385
- body { background: var(--bg); color: var(--text-color); }
386
- .card { background: var(--card-bg); border: 1px solid var(--card-border); color: var(--text-color); }
 
 
 
 
 
 
 
 
 
 
 
 
387
  .title-text { color: var(--title-color); }
388
  .abstract { color: var(--muted); }
389
  .links a { color: var(--link); }
390
- .chips-tags .chip { background: #e6f2ff; color: #1e3a8a; }
391
- .chips-langs .chip { background: #e8f5e9; color: #166534; }
392
- /* tweak chips for dark mode for better contrast */
393
- @media (prefers-color-scheme: dark) {
394
- .chips-tags .chip { background: rgba(29,78,216,0.35); color: #e6eef8; border: 1px solid rgba(148,163,184,0.15); }
395
- .chips-langs .chip { background: rgba(22,101,52,0.35); color: #e6eef8; border: 1px solid rgba(148,163,184,0.15); }
396
- }
397
 
398
  /* small screens adjustments */
399
  @media (max-width: 520px) {
400
- .cards-grid { gap: 10px; }
401
- .title-text { font-size: 15px; }
 
 
 
 
402
  }
403
  """
404
 
 
285
  dataset_links.append(f'<span class="dataset-more">+{len(datasets) - 6} more</span>')
286
  dataset_html = " ".join(dataset_links) if dataset_links else ""
287
  star_icon = "⭐ " if is_starred_benchmark(t) else ""
288
+ card_class = "card card-starred" if is_starred_benchmark(t) else "card"
289
  items.append(
290
  f"""
291
+ <article class="{card_class}" tabindex="0" aria-label="Task {task_name}">
292
  <div class="title"><span class="title-text">{star_icon}{task_name}</span> <span class="dataset-inline">{dataset_html}</span></div>
293
  {chips_tags_html}
294
  {chips_langs_html}
 
332
  # Custom CSS for the app
333
  custom_css = """
334
  /* layout */
335
+ .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 10px; }
336
+
337
 
338
  /* card base */
339
+ .card {
340
+ border-radius: 16px;
341
+ padding: 18px;
342
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
343
+ outline: none;
344
+ position: relative;
345
+ overflow: hidden;
346
+ border: 2px solid transparent;
347
+ }
348
+
349
+ .card::before {
350
+ content: '';
351
+ position: absolute;
352
+ top: 0;
353
+ left: -100%;
354
+ width: 100%;
355
+ height: 100%;
356
+ background: linear-gradient(
357
+ 90deg,
358
+ transparent,
359
+ rgba(255, 255, 255, 0.1),
360
+ transparent
361
+ );
362
+ transition: left 0.5s;
363
+ }
364
+
365
+ .card:hover::before {
366
+ left: 100%;
367
+ }
368
+
369
+ .card:hover, .card:focus {
370
+ transform: translateY(-6px) scale(1.02);
371
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
372
+ }
373
+
374
+ /* Starred card special styling */
375
+ .card-starred {
376
+ background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(255, 193, 7, 0.05) 100%);
377
+ border: 2px solid rgba(255, 215, 0, 0.3);
378
+ }
379
+
380
+ .card-starred:hover {
381
+ border-color: rgba(255, 215, 0, 0.5);
382
+ box-shadow: 0 20px 50px rgba(255, 215, 0, 0.2), 0 10px 30px rgba(255, 215, 0, 0.15);
383
+ }
384
+
385
+ .title {
386
+ display: flex;
387
+ align-items: center;
388
+ gap: 8px;
389
+ flex-wrap: wrap;
390
+ position: relative;
391
+ z-index: 1;
392
+ }
393
+
394
+ .title-text {
395
+ font-weight: 700;
396
+ font-size: 17px;
397
+ font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
398
+ letter-spacing: -0.01em;
399
+ }
400
+
401
+ .card-starred .title-text {
402
+ color: #d4af37;
403
+ filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3));
404
+ }
405
+
406
+ .dataset-inline {
407
+ font-size: 12px;
408
+ display: flex;
409
+ flex-wrap: wrap;
410
+ gap: 6px;
411
+ align-items: center;
412
+ margin-left: 8px;
413
+ }
414
+
415
+ .chips {
416
+ margin: 8px 0 6px 0;
417
+ display: flex;
418
+ gap: 4px;
419
+ flex-wrap: wrap;
420
+ }
421
+
422
+ .chips-tags { margin: 8px 0 4px 0; }
423
+ .chips-langs { margin: 4px 0 6px 0; }
424
+
425
+ .chip {
426
+ display: inline-block;
427
+ padding: 4px 10px;
428
+ border-radius: 12px;
429
+ font-size: 11px;
430
+ font-weight: 500;
431
+ background: linear-gradient(135deg, #e6f2ff 0%, #d6e9ff 100%);
432
+ color: #1e3a8a;
433
+ transition: all 0.2s ease;
434
+ border: 1px solid rgba(30, 58, 138, 0.1);
435
+ }
436
+
437
+ .chip:hover {
438
+ transform: translateY(-1px);
439
+ box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
440
+ }
441
+
442
+ .chip-lang {
443
+ background: linear-gradient(135deg, #e8f5e9 0%, #d4edda 100%);
444
+ color: #166534;
445
+ border-color: rgba(22, 101, 52, 0.1);
446
+ }
447
 
448
+ .chip-lang:hover {
449
+ box-shadow: 0 2px 8px rgba(22, 101, 52, 0.2);
450
+ }
451
+
452
+ .abstract {
453
+ color: #475569;
454
+ font-size: 13.5px;
455
+ line-height: 1.6;
456
+ margin-top: 8px;
457
+ min-height: 48px;
458
+ }
459
+
460
+ .links {
461
+ margin-top: 12px;
462
+ font-size: 12px;
463
+ padding-top: 8px;
464
+ border-top: 1px solid rgba(148, 163, 184, 0.2);
465
+ }
466
+
467
+ .links a {
468
+ text-decoration: none;
469
+ font-weight: 600;
470
+ transition: all 0.2s ease;
471
+ position: relative;
472
+ }
473
 
474
+ .links a::after {
475
+ content: '';
476
+ position: absolute;
477
+ width: 0;
478
+ height: 2px;
479
+ bottom: -2px;
480
+ left: 0;
481
+ background: currentColor;
482
+ transition: width 0.3s ease;
483
+ }
484
+
485
+ .links a:hover::after {
486
+ width: 100%;
487
+ }
488
 
489
+ .links a:hover {
490
+ transform: translateX(2px);
491
+ }
492
 
493
  .sep { color: #94a3b8; margin: 0 8px; }
494
 
495
+ .dataset {
496
+ display: inline-block;
497
+ font-size: 12px;
498
+ color: #0ea5e9;
499
+ background: linear-gradient(135deg, #ecfeff 0%, #e0f7fa 100%);
500
+ padding: 4px 10px;
501
+ border-radius: 8px;
502
+ text-decoration: none;
503
+ transition: all 0.2s ease;
504
+ border: 1px solid rgba(14, 165, 233, 0.2);
505
+ font-weight: 500;
506
+ white-space: nowrap;
507
+ }
508
+
509
+ .dataset:hover {
510
+ transform: translateY(-1px);
511
+ box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
512
+ background: linear-gradient(135deg, #e0f7fa 0%, #d1f2eb 100%);
513
+ }
514
+
515
+ .dataset-more {
516
+ display: inline-block;
517
+ font-size: 12px;
518
+ color: #64748b;
519
+ background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
520
+ padding: 4px 10px;
521
+ border-radius: 8px;
522
+ font-weight: 500;
523
+ white-space: nowrap;
524
+ }
525
 
526
  /* Light mode */
527
  :root {
528
+ --bg-start: #f8fafc;
529
+ --bg-end: #f1f5f9;
530
  --card-bg: #ffffff;
531
+ --card-border: rgba(226, 232, 240, 0.8);
532
  --title-color: #1e3a8a;
533
  --text-color: #0f172a;
534
  --muted: #475569;
 
538
  /* Dark mode overrides */
539
  @media (prefers-color-scheme: dark) {
540
  :root {
541
+ --bg-start: #0b1220;
542
+ --bg-end: #0f172a;
543
  --card-bg: #071022;
544
+ --card-border: rgba(15, 42, 68, 0.8);
545
  --title-color: #93c5fd;
546
  --text-color: #e6eef8;
547
  --muted: #cbd5e1;
548
  --link: #6ea8ff;
549
  }
550
+
551
+ .card-starred {
552
+ background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
553
+ border-color: rgba(255, 215, 0, 0.4);
554
+ }
555
+
556
+ .dataset-more {
557
+ color: #94a3b8;
558
+ background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.1) 100%);
559
+ }
560
+
561
+ .chips-tags .chip {
562
+ background: linear-gradient(135deg, rgba(29, 78, 216, 0.35) 0%, rgba(29, 78, 216, 0.25) 100%);
563
+ color: #e6eef8;
564
+ border: 1px solid rgba(148, 163, 184, 0.15);
565
+ }
566
+
567
+ .chips-langs .chip {
568
+ background: linear-gradient(135deg, rgba(22, 101, 52, 0.35) 0%, rgba(22, 101, 52, 0.25) 100%);
569
+ color: #e6eef8;
570
+ border: 1px solid rgba(148, 163, 184, 0.15);
571
+ }
572
+
573
+ .links {
574
+ border-top-color: rgba(148, 163, 184, 0.3);
575
+ }
576
  }
577
 
578
  /* apply */
579
+ body {
580
+ background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
581
+ background-attachment: fixed;
582
+ color: var(--text-color);
583
+ min-height: 100vh;
584
+ }
585
+
586
+ .card {
587
+ background: var(--card-bg);
588
+ border: 2px solid var(--card-border);
589
+ color: var(--text-color);
590
+ backdrop-filter: blur(10px);
591
+ }
592
+
593
  .title-text { color: var(--title-color); }
594
  .abstract { color: var(--muted); }
595
  .links a { color: var(--link); }
 
 
 
 
 
 
 
596
 
597
  /* small screens adjustments */
598
  @media (max-width: 520px) {
599
+ .cards-grid {
600
+ gap: 12px;
601
+ grid-template-columns: 1fr;
602
+ }
603
+ .title-text { font-size: 16px; }
604
+ .card { padding: 14px; }
605
  }
606
  """
607