|
1 | 1 | <script> |
2 | 2 | import { getContext } from "svelte"; |
3 | 3 | import Icon from "$components/helpers/Icon.svelte"; |
| 4 | + import leaderboardData from "$data/leaderboard.json"; |
4 | 5 |
|
5 | 6 | const copy = getContext("copy") || {}; |
6 | 7 | const headerCopy = copy.paperHeader || {}; |
|
55 | 56 | : defaultAbstractParagraphs; |
56 | 57 |
|
57 | 58 | // Hardcoded leaderboard data matching main Leaderboard.svelte structure |
58 | | - const leaderboardTitle = "Leaderboard Snapshot"; |
59 | | - const leaderboardDescription = "This leaderboard displays the agent advantage scores by aggregation level. Higher scores indicate better performance relative to the oracle."; |
| 59 | + const leaderboardTitle = headerCopy.leaderboard.title; |
| 60 | + const leaderboardDescription = headerCopy.leaderboard.description; |
60 | 61 |
|
61 | 62 | // Level display labels - matching main Leaderboard |
62 | 63 | const LEVEL_DISPLAY_LABELS = { |
|
71 | 72 | const levels = ["param-level", "func-level", "class-level", "module-level"]; |
72 | 73 |
|
73 | 74 | // Hardcoded table data - example data, replace with actual values |
74 | | - const tableData = [ |
75 | | - { |
76 | | - displayName: "GPT-5", |
77 | | - levels: { |
78 | | - "param-level": 0.15, |
79 | | - "func-level": 0.12, |
80 | | - "class-level": 0.08, |
81 | | - "module-level": 0.05, |
82 | | - }, |
83 | | - overall: 0.10 |
84 | | - }, |
85 | | - { |
86 | | - displayName: "Claude Sonnet 4.0", |
87 | | - levels: { |
88 | | - "param-level": 0.13, |
89 | | - "func-level": 0.10, |
90 | | - "class-level": 0.06, |
91 | | - "module-level": 0.03, |
92 | | - }, |
93 | | - overall: 0.08 |
94 | | - }, |
95 | | - { |
96 | | - displayName: "Oracle (Human)", |
97 | | - levels: { |
98 | | - "param-level": 0.25, |
99 | | - "func-level": 0.22, |
100 | | - "class-level": 0.18, |
101 | | - "module-level": 0.15, |
102 | | - }, |
103 | | - overall: 0.20 |
104 | | - } |
105 | | - ]; |
| 75 | + const tableData = Array.isArray(leaderboardData?.tableData) ? leaderboardData.tableData : []; |
106 | 76 |
|
107 | 77 | const hero = headerCopy.hero || {}; |
| 78 | + const heroCommand = typeof hero.command === "string" ? hero.command.trim() : ""; |
| 79 | + const hasHeroContent = Boolean( |
| 80 | + hero?.eyebrow || |
| 81 | + hero?.instructions || |
| 82 | + heroCommand || |
| 83 | + hero?.body || |
| 84 | + (hero?.cta && hero.cta.label) |
| 85 | + ); |
108 | 86 |
|
109 | 87 | // Helper functions matching main Leaderboard.svelte |
110 | 88 | function formatAdvantage(value) { |
|
222 | 200 | </div> |
223 | 201 | {/if} |
224 | 202 |
|
225 | | - {#if hero?.title} |
| 203 | + {#if hasHeroContent} |
226 | 204 | <div class="paper-hero"> |
227 | 205 | {#if hero.eyebrow}<p class="hero-eyebrow">{hero.eyebrow}</p>{/if} |
228 | | - <h3>{hero.title}</h3> |
229 | | - {#if hero.body}<p class="hero-body">{hero.body}</p>{/if} |
230 | | - {#if hero.cta?.label} |
231 | | - <a class="hero-cta" href={hero.cta.href ?? "#"}>{hero.cta.label}</a> |
| 206 | + {#if hero.instructions} |
| 207 | + <p class="hero-instructions">{@html hero.instructions}</p> |
| 208 | + {/if} |
| 209 | + {#if heroCommand} |
| 210 | + <div class="hero-command"> |
| 211 | + <pre class="hero-command__code" tabindex="0"><code>{heroCommand}</code></pre> |
| 212 | + </div> |
| 213 | + {/if} |
| 214 | + {#if hero.body}<p class="hero-body">{hero.body}</p>{/if} |
| 215 | + {#if hero.cta?.label} |
| 216 | + <a class="hero-cta" href={hero.cta.href ?? "#"}>{hero.cta.label}</a> |
232 | 217 | {/if} |
233 | 218 | </div> |
234 | 219 | {/if} |
|
492 | 477 | border-radius: 8px; |
493 | 478 | background: rgba(24, 26, 31, 0.5); |
494 | 479 | border: 1px solid var(--wine-dark-gray); |
| 480 | + display: flex; |
| 481 | + flex-direction: column; |
| 482 | + gap: 1.25rem; |
495 | 483 | text-align: center; |
496 | 484 | } |
497 | 485 |
|
|
500 | 488 | font-size: var(--12px); |
501 | 489 | letter-spacing: 0.08em; |
502 | 490 | text-transform: uppercase; |
503 | | - margin: 0 0 0.75rem; |
| 491 | + margin: 0 auto; |
504 | 492 | color: var(--wine-dark-tan); |
505 | 493 | } |
506 | 494 |
|
507 | | - .paper-hero h3 { |
508 | | - margin: 0 0 1rem; |
509 | | - font-size: var(--28px); |
| 495 | + .hero-instructions { |
| 496 | + margin: 0 auto; |
510 | 497 | color: var(--wine-tan); |
| 498 | + font-size: var(--16px); |
| 499 | + line-height: 1.6; |
| 500 | + max-width: 620px; |
511 | 501 | } |
512 | 502 |
|
513 | 503 | .hero-body { |
514 | | - margin: 0 auto 1.5rem; |
| 504 | + margin: 0 auto; |
515 | 505 | max-width: 640px; |
516 | 506 | color: var(--wine-tan); |
517 | 507 | font-size: var(--18px); |
518 | 508 | line-height: 1.65; |
519 | 509 | } |
520 | 510 |
|
| 511 | + .hero-instructions :global(a) { |
| 512 | + color: var(--wine-gold); |
| 513 | + text-decoration: none; |
| 514 | + font-weight: 600; |
| 515 | + } |
| 516 | +
|
| 517 | + .hero-instructions :global(a:hover), |
| 518 | + .hero-instructions :global(a:focus-visible) { |
| 519 | + color: var(--wine-dark-gold); |
| 520 | + text-decoration: underline; |
| 521 | + } |
| 522 | + /* hero instructions > a href color should be gold */ |
| 523 | + .hero-instructions a { |
| 524 | + color: var(--wine-gold); |
| 525 | + text-decoration: none; |
| 526 | + transition: color 0.2s ease; |
| 527 | + } |
| 528 | +
|
| 529 | + .hero-command { |
| 530 | + background: rgba(5, 5, 5, 0.45); |
| 531 | + border: 1px solid rgba(207, 202, 191, 0.2); |
| 532 | + border-radius: 10px; |
| 533 | + padding: 1.25rem 1.5rem; |
| 534 | + font-family: var(--mono); |
| 535 | + } |
| 536 | +
|
| 537 | +
|
521 | 538 | .hero-cta { |
522 | 539 | display: inline-flex; |
523 | 540 | align-items: center; |
|
602 | 619 | .paper-hero { |
603 | 620 | padding: 2rem 1.25rem; |
604 | 621 | } |
| 622 | +
|
| 623 | + .hero-command { |
| 624 | + padding: 1.5rem 1rem; |
| 625 | + } |
| 626 | +
|
605 | 627 | } |
606 | 628 |
|
607 | 629 | @media (max-width: 480px) { |
|
645 | 667 | font-size: var(--12px); |
646 | 668 | } |
647 | 669 |
|
648 | | - .paper-hero h3 { |
649 | | - font-size: var(--22px); |
650 | | - } |
651 | | -
|
652 | 670 | .hero-body { |
653 | 671 | font-size: var(--16px); |
654 | 672 | } |
|
0 commit comments