Spaces:
Running
Running
rohanjaggi commited on
Commit ·
fa3f2ca
1
Parent(s): 9a291bf
fix: mobile responsiveness
Browse files- src/app/globals.css +81 -14
- src/components/AboutSection.tsx +28 -9
- src/components/BenchmarkExplainer.tsx +9 -20
- src/components/EvaluationShell.tsx +35 -29
- src/components/InsightsSection.tsx +7 -7
- src/components/Nav.tsx +87 -39
- src/components/ScrollReveal.tsx +3 -3
src/app/globals.css
CHANGED
|
@@ -88,7 +88,7 @@ strong, b {
|
|
| 88 |
to { transform: scaleX(1); }
|
| 89 |
}
|
| 90 |
@keyframes fadeUp {
|
| 91 |
-
from { opacity: 0; transform: translateY(
|
| 92 |
to { opacity: 1; transform: translateY(0); }
|
| 93 |
}
|
| 94 |
@keyframes fadeIn {
|
|
@@ -96,21 +96,21 @@ strong, b {
|
|
| 96 |
to { opacity: 1; }
|
| 97 |
}
|
| 98 |
@keyframes tabSwitch {
|
| 99 |
-
from { opacity: 0; transform: translateY(
|
| 100 |
to { opacity: 1; transform: translateY(0); }
|
| 101 |
}
|
| 102 |
|
| 103 |
/* ─── Reveal on scroll ───────────────────────────────────────── */
|
| 104 |
.reveal {
|
| 105 |
opacity: 0;
|
| 106 |
-
transform: translateY(
|
| 107 |
-
transition: opacity 0.
|
| 108 |
}
|
| 109 |
.reveal.visible { opacity: 1; transform: translateY(0); }
|
| 110 |
-
.reveal-delay-1 { transition-delay: 0.
|
| 111 |
-
.reveal-delay-2 { transition-delay: 0.
|
| 112 |
-
.reveal-delay-3 { transition-delay: 0.
|
| 113 |
-
.reveal-delay-4 { transition-delay: 0.
|
| 114 |
|
| 115 |
/* ─── Nav ────────────────────────────────────────────────────── */
|
| 116 |
.nav-bar {
|
|
@@ -211,6 +211,7 @@ strong, b {
|
|
| 211 |
display: flex;
|
| 212 |
flex-direction: column;
|
| 213 |
gap: 1.25rem;
|
|
|
|
| 214 |
}
|
| 215 |
.page-intro-headline {
|
| 216 |
font-family: var(--font-lato), sans-serif;
|
|
@@ -1161,15 +1162,81 @@ strong, b {
|
|
| 1161 |
background: var(--border-0);
|
| 1162 |
}
|
| 1163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1164 |
/* ─── Mobile ──────────────────────────────────────────────────── */
|
| 1165 |
@media (max-width: 640px) {
|
| 1166 |
-
.
|
| 1167 |
-
.
|
| 1168 |
-
.
|
| 1169 |
-
.
|
| 1170 |
-
|
| 1171 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1172 |
.explainer-grid { grid-template-columns: 1fr; }
|
| 1173 |
.about-grid { grid-template-columns: 1fr; }
|
| 1174 |
.insights-grid { grid-template-columns: 1fr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1175 |
}
|
|
|
|
| 88 |
to { transform: scaleX(1); }
|
| 89 |
}
|
| 90 |
@keyframes fadeUp {
|
| 91 |
+
from { opacity: 0; transform: translateY(12px); }
|
| 92 |
to { opacity: 1; transform: translateY(0); }
|
| 93 |
}
|
| 94 |
@keyframes fadeIn {
|
|
|
|
| 96 |
to { opacity: 1; }
|
| 97 |
}
|
| 98 |
@keyframes tabSwitch {
|
| 99 |
+
from { opacity: 0; transform: translateY(6px); }
|
| 100 |
to { opacity: 1; transform: translateY(0); }
|
| 101 |
}
|
| 102 |
|
| 103 |
/* ─── Reveal on scroll ───────────────────────────────────────── */
|
| 104 |
.reveal {
|
| 105 |
opacity: 0;
|
| 106 |
+
transform: translateY(12px);
|
| 107 |
+
transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
|
| 108 |
}
|
| 109 |
.reveal.visible { opacity: 1; transform: translateY(0); }
|
| 110 |
+
.reveal-delay-1 { transition-delay: 0.1s; }
|
| 111 |
+
.reveal-delay-2 { transition-delay: 0.2s; }
|
| 112 |
+
.reveal-delay-3 { transition-delay: 0.3s; }
|
| 113 |
+
.reveal-delay-4 { transition-delay: 0.4s; }
|
| 114 |
|
| 115 |
/* ─── Nav ────────────────────────────────────────────────────── */
|
| 116 |
.nav-bar {
|
|
|
|
| 211 |
display: flex;
|
| 212 |
flex-direction: column;
|
| 213 |
gap: 1.25rem;
|
| 214 |
+
animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
|
| 215 |
}
|
| 216 |
.page-intro-headline {
|
| 217 |
font-family: var(--font-lato), sans-serif;
|
|
|
|
| 1162 |
background: var(--border-0);
|
| 1163 |
}
|
| 1164 |
|
| 1165 |
+
/* ─── Mobile nav menu ────────────────────────────────────────── */
|
| 1166 |
+
.nav-hamburger {
|
| 1167 |
+
display: none;
|
| 1168 |
+
background: none;
|
| 1169 |
+
border: none;
|
| 1170 |
+
padding: 6px;
|
| 1171 |
+
cursor: pointer;
|
| 1172 |
+
color: var(--text-1);
|
| 1173 |
+
border-radius: 4px;
|
| 1174 |
+
transition: background 0.15s;
|
| 1175 |
+
}
|
| 1176 |
+
.nav-hamburger:hover { background: var(--bg-0); }
|
| 1177 |
+
|
| 1178 |
+
.nav-mobile-menu {
|
| 1179 |
+
display: none;
|
| 1180 |
+
position: fixed;
|
| 1181 |
+
top: 56px; left: 0; right: 0;
|
| 1182 |
+
z-index: 99;
|
| 1183 |
+
background: var(--bg-1);
|
| 1184 |
+
border-bottom: 1.5px solid var(--border-1);
|
| 1185 |
+
padding: 1rem 1.5rem;
|
| 1186 |
+
box-shadow: 0 4px 16px rgba(0,0,0,0.1);
|
| 1187 |
+
animation: fadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
|
| 1188 |
+
}
|
| 1189 |
+
.nav-mobile-menu a {
|
| 1190 |
+
display: block;
|
| 1191 |
+
padding: 0.75rem 0;
|
| 1192 |
+
font-size: 14px;
|
| 1193 |
+
font-weight: 700;
|
| 1194 |
+
letter-spacing: 0.04em;
|
| 1195 |
+
text-transform: uppercase;
|
| 1196 |
+
color: var(--text-1);
|
| 1197 |
+
text-decoration: none;
|
| 1198 |
+
border-bottom: 1px solid var(--border-0);
|
| 1199 |
+
transition: color 0.15s;
|
| 1200 |
+
}
|
| 1201 |
+
.nav-mobile-menu a:last-child { border-bottom: none; }
|
| 1202 |
+
.nav-mobile-menu a:hover,
|
| 1203 |
+
.nav-mobile-menu a.nav-active { color: var(--accent); }
|
| 1204 |
+
|
| 1205 |
/* ─── Mobile ──────────────────────────────────────────────────── */
|
| 1206 |
@media (max-width: 640px) {
|
| 1207 |
+
.nav-bar { padding: 0 1rem; }
|
| 1208 |
+
.nav-links { display: none; }
|
| 1209 |
+
.nav-hamburger { display: block; }
|
| 1210 |
+
.nav-mobile-menu.open { display: block; }
|
| 1211 |
+
|
| 1212 |
+
.page-intro-inner { padding: 1.25rem 1rem; gap: 1rem; max-width: 100%; overflow: hidden; }
|
| 1213 |
+
.page-intro-row { flex-direction: column; gap: 1rem; }
|
| 1214 |
+
.page-intro-stats { width: 100%; max-width: 100%; overflow: hidden; }
|
| 1215 |
+
.pi-stat { padding: 0.6rem 0.75rem; flex: 1; min-width: 0; }
|
| 1216 |
+
.pi-num { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
| 1217 |
+
.pi-label { font-size: 10px; }
|
| 1218 |
+
|
| 1219 |
+
.section-wrap { padding: 2rem 1rem; }
|
| 1220 |
+
.footer-bar { padding: 1.25rem 1rem; }
|
| 1221 |
+
|
| 1222 |
+
.lb-expand-inner { grid-template-columns: 1fr; padding: 1rem 1rem 1rem 1.5rem; }
|
| 1223 |
+
.lb-controls { gap: 0.5rem; }
|
| 1224 |
+
.lb-search-wrap { width: 100%; }
|
| 1225 |
+
.lb-search { max-width: none; width: 100%; }
|
| 1226 |
+
|
| 1227 |
.explainer-grid { grid-template-columns: 1fr; }
|
| 1228 |
.about-grid { grid-template-columns: 1fr; }
|
| 1229 |
.insights-grid { grid-template-columns: 1fr; }
|
| 1230 |
+
|
| 1231 |
+
.explainer-cta { flex-direction: column; align-items: flex-start; gap: 1rem; }
|
| 1232 |
+
|
| 1233 |
+
.mode-toggle-grid { grid-template-columns: 1fr !important; }
|
| 1234 |
+
.mode-toggle-btn { padding: 1rem 1.25rem !important; }
|
| 1235 |
+
.mode-toggle-subtitle { padding-left: 0 !important; margin-top: 4px; }
|
| 1236 |
+
|
| 1237 |
+
.insights-chart-name { width: 100px !important; padding-left: 8px !important; }
|
| 1238 |
+
.insights-chart-legend { padding-left: 100px !important; }
|
| 1239 |
+
|
| 1240 |
+
.mode-toggle-btn .mode-toggle-icon { width: 28px !important; height: 28px !important; }
|
| 1241 |
+
.barchart-tabs { gap: 0.35rem; }
|
| 1242 |
}
|
src/components/AboutSection.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
-
import React, { useState } from 'react'
|
| 4 |
import type { MetricThresholds, GuardrailThresholds } from '@/lib/types'
|
| 5 |
|
| 6 |
function fmtPct(v: number) { return `${Math.round(v * 100)}%` }
|
|
@@ -310,12 +310,13 @@ function LinkRow({ links, color }: { links: { label: string; href: string }[]; c
|
|
| 310 |
target="_blank"
|
| 311 |
rel="noopener noreferrer"
|
| 312 |
style={{
|
| 313 |
-
display: 'inline-flex', alignItems: 'center', gap:
|
| 314 |
-
fontSize:
|
| 315 |
-
|
| 316 |
-
color, background:
|
| 317 |
-
border: `1.5px solid ${color}`,
|
| 318 |
-
padding: '
|
|
|
|
| 319 |
}}
|
| 320 |
>
|
| 321 |
{LINK_ICONS[lk.label] ?? (
|
|
@@ -324,6 +325,9 @@ function LinkRow({ links, color }: { links: { label: string; href: string }[]; c
|
|
| 324 |
</svg>
|
| 325 |
)}
|
| 326 |
{lk.label}
|
|
|
|
|
|
|
|
|
|
| 327 |
</a>
|
| 328 |
))}
|
| 329 |
</div>
|
|
@@ -690,6 +694,21 @@ export default function AboutSection({
|
|
| 690 |
thresholds?: MetricThresholds
|
| 691 |
guardrailThresholds?: GuardrailThresholds
|
| 692 |
}) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 693 |
const thirds = thresholds ? buildThirdStrings(thresholds) : null
|
| 694 |
|
| 695 |
const guardrailThirds: ThirdStrings | undefined = guardrailThresholds
|
|
@@ -701,8 +720,8 @@ export default function AboutSection({
|
|
| 701 |
: undefined
|
| 702 |
|
| 703 |
return (
|
| 704 |
-
<div id="about" className="section-wrap" style={{ paddingTop: '1.5rem', paddingBottom: '1.5rem' }}>
|
| 705 |
-
<div style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', flexWrap: 'wrap', gap: '1rem', marginBottom: '2rem' }}>
|
| 706 |
<div>
|
| 707 |
<h2 className="section-title">How we score</h2>
|
| 708 |
<p style={{ maxWidth: '60ch', fontSize: 13, color: 'var(--text-2)', lineHeight: 1.8, marginTop: '0.75rem' }}>
|
|
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
+
import React, { useState, useEffect, useRef } from 'react'
|
| 4 |
import type { MetricThresholds, GuardrailThresholds } from '@/lib/types'
|
| 5 |
|
| 6 |
function fmtPct(v: number) { return `${Math.round(v * 100)}%` }
|
|
|
|
| 310 |
target="_blank"
|
| 311 |
rel="noopener noreferrer"
|
| 312 |
style={{
|
| 313 |
+
display: 'inline-flex', alignItems: 'center', gap: 7,
|
| 314 |
+
fontSize: 12, fontWeight: 700, letterSpacing: '0.03em',
|
| 315 |
+
textDecoration: 'none',
|
| 316 |
+
color, background: `color-mix(in oklch, ${color} 8%, var(--bg-1))`,
|
| 317 |
+
border: `1.5px solid color-mix(in oklch, ${color} 30%, transparent)`,
|
| 318 |
+
padding: '7px 14px', borderRadius: 8,
|
| 319 |
+
transition: 'background 0.15s, border-color 0.15s',
|
| 320 |
}}
|
| 321 |
>
|
| 322 |
{LINK_ICONS[lk.label] ?? (
|
|
|
|
| 325 |
</svg>
|
| 326 |
)}
|
| 327 |
{lk.label}
|
| 328 |
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" style={{ opacity: 0.7 }}>
|
| 329 |
+
<path d="M7 17L17 7M7 7h10v10" />
|
| 330 |
+
</svg>
|
| 331 |
</a>
|
| 332 |
))}
|
| 333 |
</div>
|
|
|
|
| 694 |
thresholds?: MetricThresholds
|
| 695 |
guardrailThresholds?: GuardrailThresholds
|
| 696 |
}) {
|
| 697 |
+
const sectionRef = useRef<HTMLDivElement>(null)
|
| 698 |
+
|
| 699 |
+
useEffect(() => {
|
| 700 |
+
const obs = new IntersectionObserver(
|
| 701 |
+
entries => {
|
| 702 |
+
entries.forEach(e => {
|
| 703 |
+
if (e.isIntersecting) { e.target.classList.add('visible'); obs.unobserve(e.target) }
|
| 704 |
+
})
|
| 705 |
+
},
|
| 706 |
+
{ threshold: 0.05, rootMargin: '0px 0px -60px 0px' },
|
| 707 |
+
)
|
| 708 |
+
sectionRef.current?.querySelectorAll('.reveal').forEach(el => obs.observe(el))
|
| 709 |
+
return () => obs.disconnect()
|
| 710 |
+
}, [mode])
|
| 711 |
+
|
| 712 |
const thirds = thresholds ? buildThirdStrings(thresholds) : null
|
| 713 |
|
| 714 |
const guardrailThirds: ThirdStrings | undefined = guardrailThresholds
|
|
|
|
| 720 |
: undefined
|
| 721 |
|
| 722 |
return (
|
| 723 |
+
<div id="about" ref={sectionRef} className="section-wrap" style={{ paddingTop: '1.5rem', paddingBottom: '1.5rem' }}>
|
| 724 |
+
<div className="reveal" style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', flexWrap: 'wrap', gap: '1rem', marginBottom: '2rem' }}>
|
| 725 |
<div>
|
| 726 |
<h2 className="section-title">How we score</h2>
|
| 727 |
<p style={{ maxWidth: '60ch', fontSize: 13, color: 'var(--text-2)', lineHeight: 1.8, marginTop: '0.75rem' }}>
|
src/components/BenchmarkExplainer.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
-
import
|
| 4 |
|
| 5 |
type Mode = 'models' | 'guardrails'
|
| 6 |
|
|
@@ -21,7 +21,7 @@ const MODE_COLORS: Record<Mode, { color: string; dim: string }> = {
|
|
| 21 |
guardrails: { color: '#00C0F3', dim: 'rgba(0,192,243,0.07)' },
|
| 22 |
}
|
| 23 |
|
| 24 |
-
const TAB_ICONS: Record<Mode, (p: { color: string }) =>
|
| 25 |
models: ({ color }) => (
|
| 26 |
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden>
|
| 27 |
<rect x="7" y="7" width="10" height="10" rx="2" stroke={color} strokeWidth="1.5"/>
|
|
@@ -109,28 +109,15 @@ const CRITERIA = [
|
|
| 109 |
]
|
| 110 |
|
| 111 |
export default function BenchmarkExplainer({ mode, onModeChange, options }: Props) {
|
| 112 |
-
const ref = useRef<HTMLElement>(null)
|
| 113 |
-
|
| 114 |
-
useEffect(() => {
|
| 115 |
-
const obs = new IntersectionObserver(
|
| 116 |
-
entries => entries.forEach(e => {
|
| 117 |
-
if (e.isIntersecting) { e.target.classList.add('visible'); obs.unobserve(e.target) }
|
| 118 |
-
}),
|
| 119 |
-
{ threshold: 0.1 },
|
| 120 |
-
)
|
| 121 |
-
ref.current?.querySelectorAll('.section-reveal').forEach(el => obs.observe(el))
|
| 122 |
-
return () => obs.disconnect()
|
| 123 |
-
}, [])
|
| 124 |
-
|
| 125 |
const visibleCriteria = CRITERIA.filter(c => c.modes.includes(mode))
|
| 126 |
|
| 127 |
return (
|
| 128 |
-
<section className="explainer-section"
|
| 129 |
<div className="section-wrap" style={{ paddingBottom: '1.5rem' }}>
|
| 130 |
|
| 131 |
|
| 132 |
{/* Mode switcher — full-width toggle */}
|
| 133 |
-
<div style={{
|
| 134 |
display: 'grid', gridTemplateColumns: '1fr 1fr',
|
| 135 |
padding: 5,
|
| 136 |
background: 'var(--bg-0)',
|
|
@@ -138,6 +125,7 @@ export default function BenchmarkExplainer({ mode, onModeChange, options }: Prop
|
|
| 138 |
borderRadius: 14,
|
| 139 |
marginBottom: '1.75rem',
|
| 140 |
gap: 5,
|
|
|
|
| 141 |
}}>
|
| 142 |
{options.map(o => {
|
| 143 |
const isActive = mode === o.key
|
|
@@ -146,6 +134,7 @@ export default function BenchmarkExplainer({ mode, onModeChange, options }: Prop
|
|
| 146 |
return (
|
| 147 |
<button
|
| 148 |
key={o.key}
|
|
|
|
| 149 |
onClick={() => onModeChange(o.key as Mode)}
|
| 150 |
style={{
|
| 151 |
position: 'relative',
|
|
@@ -188,7 +177,7 @@ export default function BenchmarkExplainer({ mode, onModeChange, options }: Prop
|
|
| 188 |
</div>
|
| 189 |
|
| 190 |
{/* Subtitle */}
|
| 191 |
-
<p style={{
|
| 192 |
fontSize: 13, color: isActive ? 'var(--text-2)' : 'var(--text-3)',
|
| 193 |
margin: 0, lineHeight: 1.6, paddingLeft: 48,
|
| 194 |
transition: 'color 0.2s',
|
|
@@ -199,7 +188,7 @@ export default function BenchmarkExplainer({ mode, onModeChange, options }: Prop
|
|
| 199 |
</div>
|
| 200 |
|
| 201 |
{/* Criteria rows — keyed by mode to trigger transition */}
|
| 202 |
-
<div key={mode} style={{ animation: '
|
| 203 |
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, border: '1.5px solid var(--border-1)', borderRadius: 10, overflow: 'hidden', background: 'var(--bg-1)' }}>
|
| 204 |
{visibleCriteria.map((c, i) => (
|
| 205 |
<div
|
|
@@ -253,7 +242,7 @@ export default function BenchmarkExplainer({ mode, onModeChange, options }: Prop
|
|
| 253 |
</div>
|
| 254 |
|
| 255 |
{/* CTA */}
|
| 256 |
-
<div className="explainer-cta
|
| 257 |
<span className="explainer-cta-text">Want to understand what the scores mean?</span>
|
| 258 |
<a href="#about" className="explainer-cta-link">
|
| 259 |
Our methodology
|
|
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
+
import React from 'react'
|
| 4 |
|
| 5 |
type Mode = 'models' | 'guardrails'
|
| 6 |
|
|
|
|
| 21 |
guardrails: { color: '#00C0F3', dim: 'rgba(0,192,243,0.07)' },
|
| 22 |
}
|
| 23 |
|
| 24 |
+
const TAB_ICONS: Record<Mode, (p: { color: string }) => React.ReactNode> = {
|
| 25 |
models: ({ color }) => (
|
| 26 |
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden>
|
| 27 |
<rect x="7" y="7" width="10" height="10" rx="2" stroke={color} strokeWidth="1.5"/>
|
|
|
|
| 109 |
]
|
| 110 |
|
| 111 |
export default function BenchmarkExplainer({ mode, onModeChange, options }: Props) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
const visibleCriteria = CRITERIA.filter(c => c.modes.includes(mode))
|
| 113 |
|
| 114 |
return (
|
| 115 |
+
<section className="explainer-section" id="criteria">
|
| 116 |
<div className="section-wrap" style={{ paddingBottom: '1.5rem' }}>
|
| 117 |
|
| 118 |
|
| 119 |
{/* Mode switcher — full-width toggle */}
|
| 120 |
+
<div className="mode-toggle-grid" style={{
|
| 121 |
display: 'grid', gridTemplateColumns: '1fr 1fr',
|
| 122 |
padding: 5,
|
| 123 |
background: 'var(--bg-0)',
|
|
|
|
| 125 |
borderRadius: 14,
|
| 126 |
marginBottom: '1.75rem',
|
| 127 |
gap: 5,
|
| 128 |
+
animation: 'fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both',
|
| 129 |
}}>
|
| 130 |
{options.map(o => {
|
| 131 |
const isActive = mode === o.key
|
|
|
|
| 134 |
return (
|
| 135 |
<button
|
| 136 |
key={o.key}
|
| 137 |
+
className="mode-toggle-btn"
|
| 138 |
onClick={() => onModeChange(o.key as Mode)}
|
| 139 |
style={{
|
| 140 |
position: 'relative',
|
|
|
|
| 177 |
</div>
|
| 178 |
|
| 179 |
{/* Subtitle */}
|
| 180 |
+
<p className="mode-toggle-subtitle" style={{
|
| 181 |
fontSize: 13, color: isActive ? 'var(--text-2)' : 'var(--text-3)',
|
| 182 |
margin: 0, lineHeight: 1.6, paddingLeft: 48,
|
| 183 |
transition: 'color 0.2s',
|
|
|
|
| 188 |
</div>
|
| 189 |
|
| 190 |
{/* Criteria rows — keyed by mode to trigger transition */}
|
| 191 |
+
<div key={mode} style={{ animation: 'fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both' }}>
|
| 192 |
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, border: '1.5px solid var(--border-1)', borderRadius: 10, overflow: 'hidden', background: 'var(--bg-1)' }}>
|
| 193 |
{visibleCriteria.map((c, i) => (
|
| 194 |
<div
|
|
|
|
| 242 |
</div>
|
| 243 |
|
| 244 |
{/* CTA */}
|
| 245 |
+
<div className="explainer-cta" style={{ animation: 'fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both' }}>
|
| 246 |
<span className="explainer-cta-text">Want to understand what the scores mean?</span>
|
| 247 |
<a href="#about" className="explainer-cta-link">
|
| 248 |
Our methodology
|
src/components/EvaluationShell.tsx
CHANGED
|
@@ -56,27 +56,31 @@ export default function EvaluationShell({ models, guardrails, maxFairness, thres
|
|
| 56 |
|
| 57 |
{mode === 'models' && (
|
| 58 |
<div className="section-wrap" style={{ paddingTop: 0, paddingBottom: '1.5rem' }}>
|
| 59 |
-
<
|
| 60 |
-
<div className="insight-card
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
| 67 |
</div>
|
| 68 |
)}
|
| 69 |
|
| 70 |
{mode === 'guardrails' && (
|
| 71 |
<div className="section-wrap" style={{ paddingTop: 0, paddingBottom: '1.5rem' }}>
|
| 72 |
-
<
|
| 73 |
-
<div className="insight-card
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
| 80 |
</div>
|
| 81 |
)}
|
| 82 |
|
|
@@ -88,19 +92,21 @@ export default function EvaluationShell({ models, guardrails, maxFairness, thres
|
|
| 88 |
|
| 89 |
<section style={{ borderTop: '1px solid var(--border-0)' }}>
|
| 90 |
<div className="section-wrap" style={{ paddingTop: '1.5rem', paddingBottom: '1.5rem' }}>
|
| 91 |
-
<
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
{mode === 'models'
|
| 105 |
? <LeaderboardTable models={models} maxFairness={maxFairness} />
|
| 106 |
: <GuardrailsTable guardrails={guardrails} />
|
|
|
|
| 56 |
|
| 57 |
{mode === 'models' && (
|
| 58 |
<div className="section-wrap" style={{ paddingTop: 0, paddingBottom: '1.5rem' }}>
|
| 59 |
+
<ScrollReveal className="reveal-delay-1">
|
| 60 |
+
<div className="insight-card">
|
| 61 |
+
<div className="insight-card-heading">Where models cluster</div>
|
| 62 |
+
<p style={{ fontSize: 13, color: 'var(--text-2)', lineHeight: 1.65, marginBottom: '1.5rem', maxWidth: '64ch' }}>
|
| 63 |
+
Each dot is one active model, coloured by lab. The dashed line marks the field average.
|
| 64 |
+
Fairness is inverted: dots further right are more equitable.
|
| 65 |
+
</p>
|
| 66 |
+
<ScoreDistribution models={models} maxFairness={maxFairness} />
|
| 67 |
+
</div>
|
| 68 |
+
</ScrollReveal>
|
| 69 |
</div>
|
| 70 |
)}
|
| 71 |
|
| 72 |
{mode === 'guardrails' && (
|
| 73 |
<div className="section-wrap" style={{ paddingTop: 0, paddingBottom: '1.5rem' }}>
|
| 74 |
+
<ScrollReveal className="reveal-delay-1">
|
| 75 |
+
<div className="insight-card">
|
| 76 |
+
<div className="insight-card-heading">Where guardrails cluster</div>
|
| 77 |
+
<p style={{ fontSize: 13, color: 'var(--text-2)', lineHeight: 1.65, marginBottom: '1.5rem', maxWidth: '64ch' }}>
|
| 78 |
+
Each dot is one guardrail, coloured by provider. The dashed line marks the field average.
|
| 79 |
+
All metrics: higher is better.
|
| 80 |
+
</p>
|
| 81 |
+
<GuardrailDistribution guardrails={guardrails} />
|
| 82 |
+
</div>
|
| 83 |
+
</ScrollReveal>
|
| 84 |
</div>
|
| 85 |
)}
|
| 86 |
|
|
|
|
| 92 |
|
| 93 |
<section style={{ borderTop: '1px solid var(--border-0)' }}>
|
| 94 |
<div className="section-wrap" style={{ paddingTop: '1.5rem', paddingBottom: '1.5rem' }}>
|
| 95 |
+
<ScrollReveal>
|
| 96 |
+
<h2 className="section-title">Leaderboard</h2>
|
| 97 |
+
<p style={{
|
| 98 |
+
marginTop: '0.5rem',
|
| 99 |
+
marginBottom: '1.25rem',
|
| 100 |
+
fontSize: 13,
|
| 101 |
+
color: 'var(--text-2)',
|
| 102 |
+
maxWidth: '64ch',
|
| 103 |
+
lineHeight: 1.7,
|
| 104 |
+
}}>
|
| 105 |
+
{mode === 'models'
|
| 106 |
+
? 'Click any row to expand the full metric breakdown. Click a creator badge to filter. Fairness: ↓ lower = more equitable.'
|
| 107 |
+
: 'Click any row to expand the full metric breakdown. Click a provider badge to filter. Higher scores = better detection.'}
|
| 108 |
+
</p>
|
| 109 |
+
</ScrollReveal>
|
| 110 |
{mode === 'models'
|
| 111 |
? <LeaderboardTable models={models} maxFairness={maxFairness} />
|
| 112 |
: <GuardrailsTable guardrails={guardrails} />
|
src/components/InsightsSection.tsx
CHANGED
|
@@ -129,7 +129,7 @@ function LabSizeBreakdown({ models, maxFairness }: { models: ModelData[]; maxFai
|
|
| 129 |
<div style={{ display: 'flex', flexDirection: 'column', gap: 0 }}>
|
| 130 |
{/* Axis scale */}
|
| 131 |
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 6, paddingLeft: 0 }}>
|
| 132 |
-
<div style={{ width: 170, flexShrink: 0 }} />
|
| 133 |
<div style={{ flex: 1, position: 'relative', height: 16 }}>
|
| 134 |
{[0, 0.25, 0.5, 0.75, 1].map(t => (
|
| 135 |
<span key={t} style={{
|
|
@@ -208,8 +208,8 @@ function LabSizeBreakdown({ models, maxFairness }: { models: ModelData[]; maxFai
|
|
| 208 |
cursor: 'default',
|
| 209 |
}}
|
| 210 |
>
|
| 211 |
-
{/* Model name
|
| 212 |
-
<div style={{
|
| 213 |
width: 170,
|
| 214 |
flexShrink: 0,
|
| 215 |
paddingLeft: 20,
|
|
@@ -294,7 +294,7 @@ function LabSizeBreakdown({ models, maxFairness }: { models: ModelData[]; maxFai
|
|
| 294 |
|
| 295 |
{/* Field average legend */}
|
| 296 |
{fieldAvg !== null && (
|
| 297 |
-
<div style={{
|
| 298 |
display: 'flex', alignItems: 'center', gap: 6,
|
| 299 |
marginTop: 10, paddingLeft: 170,
|
| 300 |
}}>
|
|
@@ -335,7 +335,7 @@ export default function InsightsSection({ models, guardrails, maxFairness, mode
|
|
| 335 |
if (e.isIntersecting) { e.target.classList.add('visible'); obs.unobserve(e.target) }
|
| 336 |
})
|
| 337 |
},
|
| 338 |
-
{ threshold: 0.
|
| 339 |
)
|
| 340 |
ref.current?.querySelectorAll('.reveal').forEach(el => obs.observe(el))
|
| 341 |
return () => obs.disconnect()
|
|
@@ -363,14 +363,14 @@ export default function InsightsSection({ models, guardrails, maxFairness, mode
|
|
| 363 |
{mode === 'models' && <div className="insight-card reveal reveal-delay-1" style={{ marginTop: '2rem' }}>
|
| 364 |
<div className="insight-card-title">Lab × Size Breakdown</div>
|
| 365 |
<div className="insight-card-heading" style={{ marginBottom: '0.75rem' }}>How size affects performance within each lab</div>
|
| 366 |
-
<p style={{ fontSize: 15, color: 'var(--text-2)', lineHeight: 1.65, marginBottom: '0.5rem'
|
| 367 |
Models are grouped by approximate size: <strong style={{ color: SIZE_COLORS.Small }}>Small</strong> (≤ 10 B params),{' '}
|
| 368 |
<strong style={{ color: SIZE_COLORS.Medium }}>Medium</strong> (11–40 B), and{' '}
|
| 369 |
<strong style={{ color: SIZE_COLORS.Large }}>Large</strong> (40 B+).
|
| 370 |
Commercial closed-weight models are classified by model-family tier
|
| 371 |
(e.g. Haiku → Small, Sonnet/Flash → Medium, Opus/Pro → Large).
|
| 372 |
</p>
|
| 373 |
-
<p style={{ fontSize: 13, color: 'var(--text-3)', lineHeight: 1.55, marginBottom: '1.25rem',
|
| 374 |
Size classifications are approximate and inherently subjective — exact
|
| 375 |
parameter counts are not published for most commercial models.
|
| 376 |
Categorisations are based on publicly available information and
|
|
|
|
| 129 |
<div style={{ display: 'flex', flexDirection: 'column', gap: 0 }}>
|
| 130 |
{/* Axis scale */}
|
| 131 |
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 6, paddingLeft: 0 }}>
|
| 132 |
+
<div className="insights-chart-name" style={{ width: 170, flexShrink: 0 }} />
|
| 133 |
<div style={{ flex: 1, position: 'relative', height: 16 }}>
|
| 134 |
{[0, 0.25, 0.5, 0.75, 1].map(t => (
|
| 135 |
<span key={t} style={{
|
|
|
|
| 208 |
cursor: 'default',
|
| 209 |
}}
|
| 210 |
>
|
| 211 |
+
{/* Model name */}
|
| 212 |
+
<div className="insights-chart-name" style={{
|
| 213 |
width: 170,
|
| 214 |
flexShrink: 0,
|
| 215 |
paddingLeft: 20,
|
|
|
|
| 294 |
|
| 295 |
{/* Field average legend */}
|
| 296 |
{fieldAvg !== null && (
|
| 297 |
+
<div className="insights-chart-legend" style={{
|
| 298 |
display: 'flex', alignItems: 'center', gap: 6,
|
| 299 |
marginTop: 10, paddingLeft: 170,
|
| 300 |
}}>
|
|
|
|
| 335 |
if (e.isIntersecting) { e.target.classList.add('visible'); obs.unobserve(e.target) }
|
| 336 |
})
|
| 337 |
},
|
| 338 |
+
{ threshold: 0.05, rootMargin: '0px 0px -60px 0px' },
|
| 339 |
)
|
| 340 |
ref.current?.querySelectorAll('.reveal').forEach(el => obs.observe(el))
|
| 341 |
return () => obs.disconnect()
|
|
|
|
| 363 |
{mode === 'models' && <div className="insight-card reveal reveal-delay-1" style={{ marginTop: '2rem' }}>
|
| 364 |
<div className="insight-card-title">Lab × Size Breakdown</div>
|
| 365 |
<div className="insight-card-heading" style={{ marginBottom: '0.75rem' }}>How size affects performance within each lab</div>
|
| 366 |
+
<p style={{ fontSize: 15, color: 'var(--text-2)', lineHeight: 1.65, marginBottom: '0.5rem' }}>
|
| 367 |
Models are grouped by approximate size: <strong style={{ color: SIZE_COLORS.Small }}>Small</strong> (≤ 10 B params),{' '}
|
| 368 |
<strong style={{ color: SIZE_COLORS.Medium }}>Medium</strong> (11–40 B), and{' '}
|
| 369 |
<strong style={{ color: SIZE_COLORS.Large }}>Large</strong> (40 B+).
|
| 370 |
Commercial closed-weight models are classified by model-family tier
|
| 371 |
(e.g. Haiku → Small, Sonnet/Flash → Medium, Opus/Pro → Large).
|
| 372 |
</p>
|
| 373 |
+
<p style={{ fontSize: 13, color: 'var(--text-3)', lineHeight: 1.55, marginBottom: '1.25rem', fontStyle: 'italic' }}>
|
| 374 |
Size classifications are approximate and inherently subjective — exact
|
| 375 |
parameter counts are not published for most commercial models.
|
| 376 |
Categorisations are based on publicly available information and
|
src/components/Nav.tsx
CHANGED
|
@@ -1,14 +1,21 @@
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
import Image from 'next/image'
|
| 4 |
-
import { useEffect, useState } from 'react'
|
| 5 |
|
| 6 |
const NAV_SECTIONS = ['criteria', 'leaderboard', 'about', 'insights'] as const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
export default function Nav({ modelCount, lastUpdated }: { modelCount: number; lastUpdated: string }) {
|
| 9 |
const [scrolled, setScrolled] = useState(false)
|
| 10 |
const [showTitle, setShowTitle] = useState(false)
|
| 11 |
const [activeSection, setActiveSection] = useState<string | null>(null)
|
|
|
|
| 12 |
|
| 13 |
useEffect(() => {
|
| 14 |
const update = () => {
|
|
@@ -34,46 +41,87 @@ export default function Nav({ modelCount, lastUpdated }: { modelCount: number; l
|
|
| 34 |
return () => window.removeEventListener('scroll', update)
|
| 35 |
}, [])
|
| 36 |
|
|
|
|
|
|
|
| 37 |
return (
|
| 38 |
-
<
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
<
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
)
|
| 79 |
}
|
|
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
import Image from 'next/image'
|
| 4 |
+
import { useEffect, useState, useCallback } from 'react'
|
| 5 |
|
| 6 |
const NAV_SECTIONS = ['criteria', 'leaderboard', 'about', 'insights'] as const
|
| 7 |
+
const NAV_LABELS: Record<string, string> = {
|
| 8 |
+
criteria: 'Overview',
|
| 9 |
+
leaderboard: 'Results',
|
| 10 |
+
about: 'Methodology',
|
| 11 |
+
insights: 'Insights',
|
| 12 |
+
}
|
| 13 |
|
| 14 |
export default function Nav({ modelCount, lastUpdated }: { modelCount: number; lastUpdated: string }) {
|
| 15 |
const [scrolled, setScrolled] = useState(false)
|
| 16 |
const [showTitle, setShowTitle] = useState(false)
|
| 17 |
const [activeSection, setActiveSection] = useState<string | null>(null)
|
| 18 |
+
const [menuOpen, setMenuOpen] = useState(false)
|
| 19 |
|
| 20 |
useEffect(() => {
|
| 21 |
const update = () => {
|
|
|
|
| 41 |
return () => window.removeEventListener('scroll', update)
|
| 42 |
}, [])
|
| 43 |
|
| 44 |
+
const closeMenu = useCallback(() => setMenuOpen(false), [])
|
| 45 |
+
|
| 46 |
return (
|
| 47 |
+
<>
|
| 48 |
+
<nav
|
| 49 |
+
className="nav-bar"
|
| 50 |
+
style={{ boxShadow: scrolled ? '0 1px 8px rgba(0,0,0,0.08)' : 'none' }}
|
| 51 |
+
>
|
| 52 |
+
<div className="nav-logo">
|
| 53 |
+
<Image
|
| 54 |
+
src="/govtech-logo.jpg"
|
| 55 |
+
alt="GovTech Singapore"
|
| 56 |
+
height={26}
|
| 57 |
+
width={104}
|
| 58 |
+
style={{ objectFit: 'contain', objectPosition: 'left center', width: 'auto', height: 26 }}
|
| 59 |
+
priority
|
| 60 |
+
/>
|
| 61 |
+
<span
|
| 62 |
+
className="nav-logo-sep"
|
| 63 |
+
style={{
|
| 64 |
+
opacity: showTitle ? 1 : 0,
|
| 65 |
+
transition: 'opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1)',
|
| 66 |
+
}}
|
| 67 |
+
/>
|
| 68 |
+
<span
|
| 69 |
+
className="nav-logo-bench"
|
| 70 |
+
style={{
|
| 71 |
+
opacity: showTitle ? 1 : 0,
|
| 72 |
+
transform: showTitle ? 'translateY(0)' : 'translateY(4px)',
|
| 73 |
+
transition: 'opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1)',
|
| 74 |
+
}}
|
| 75 |
+
>
|
| 76 |
+
Responsible AI Bench
|
| 77 |
+
</span>
|
| 78 |
+
</div>
|
| 79 |
|
| 80 |
+
<ul className="nav-links">
|
| 81 |
+
{NAV_SECTIONS.map(id => (
|
| 82 |
+
<li key={id}>
|
| 83 |
+
<a href={`#${id}`} className={activeSection === id ? 'nav-active' : ''}>
|
| 84 |
+
{NAV_LABELS[id]}
|
| 85 |
+
</a>
|
| 86 |
+
</li>
|
| 87 |
+
))}
|
| 88 |
+
</ul>
|
| 89 |
|
| 90 |
+
<button
|
| 91 |
+
className="nav-hamburger"
|
| 92 |
+
onClick={() => setMenuOpen(v => !v)}
|
| 93 |
+
aria-label="Toggle navigation menu"
|
| 94 |
+
aria-expanded={menuOpen}
|
| 95 |
+
>
|
| 96 |
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
| 97 |
+
{menuOpen ? (
|
| 98 |
+
<>
|
| 99 |
+
<line x1="6" y1="6" x2="18" y2="18" />
|
| 100 |
+
<line x1="6" y1="18" x2="18" y2="6" />
|
| 101 |
+
</>
|
| 102 |
+
) : (
|
| 103 |
+
<>
|
| 104 |
+
<line x1="4" y1="7" x2="20" y2="7" />
|
| 105 |
+
<line x1="4" y1="12" x2="20" y2="12" />
|
| 106 |
+
<line x1="4" y1="17" x2="20" y2="17" />
|
| 107 |
+
</>
|
| 108 |
+
)}
|
| 109 |
+
</svg>
|
| 110 |
+
</button>
|
| 111 |
+
</nav>
|
| 112 |
+
|
| 113 |
+
<div className={`nav-mobile-menu ${menuOpen ? 'open' : ''}`}>
|
| 114 |
+
{NAV_SECTIONS.map(id => (
|
| 115 |
+
<a
|
| 116 |
+
key={id}
|
| 117 |
+
href={`#${id}`}
|
| 118 |
+
className={activeSection === id ? 'nav-active' : ''}
|
| 119 |
+
onClick={closeMenu}
|
| 120 |
+
>
|
| 121 |
+
{NAV_LABELS[id]}
|
| 122 |
+
</a>
|
| 123 |
+
))}
|
| 124 |
+
</div>
|
| 125 |
+
</>
|
| 126 |
)
|
| 127 |
}
|
src/components/ScrollReveal.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
import { useEffect, useRef } from 'react'
|
| 4 |
|
| 5 |
-
export default function ScrollReveal({ children }: { children: React.ReactNode }) {
|
| 6 |
const ref = useRef<HTMLDivElement>(null)
|
| 7 |
|
| 8 |
useEffect(() => {
|
|
@@ -15,7 +15,7 @@ export default function ScrollReveal({ children }: { children: React.ReactNode }
|
|
| 15 |
}
|
| 16 |
})
|
| 17 |
},
|
| 18 |
-
{ threshold: 0.
|
| 19 |
)
|
| 20 |
|
| 21 |
const el = ref.current
|
|
@@ -24,7 +24,7 @@ export default function ScrollReveal({ children }: { children: React.ReactNode }
|
|
| 24 |
}, [])
|
| 25 |
|
| 26 |
return (
|
| 27 |
-
<div ref={ref} className=
|
| 28 |
{children}
|
| 29 |
</div>
|
| 30 |
)
|
|
|
|
| 2 |
|
| 3 |
import { useEffect, useRef } from 'react'
|
| 4 |
|
| 5 |
+
export default function ScrollReveal({ children, className = '' }: { children: React.ReactNode; className?: string }) {
|
| 6 |
const ref = useRef<HTMLDivElement>(null)
|
| 7 |
|
| 8 |
useEffect(() => {
|
|
|
|
| 15 |
}
|
| 16 |
})
|
| 17 |
},
|
| 18 |
+
{ threshold: 0.05, rootMargin: '0px 0px -60px 0px' },
|
| 19 |
)
|
| 20 |
|
| 21 |
const el = ref.current
|
|
|
|
| 24 |
}, [])
|
| 25 |
|
| 26 |
return (
|
| 27 |
+
<div ref={ref} className={`reveal ${className}`}>
|
| 28 |
{children}
|
| 29 |
</div>
|
| 30 |
)
|