|
| 1 | +--- |
| 2 | +import { getLang, t } from "~/i18n"; |
| 3 | +
|
| 4 | +const s = t(getLang(Astro)).mcpAdvantage; |
| 5 | +
|
| 6 | +// Map raw cell values to (label, treatment) so the table renders consistently |
| 7 | +// across en / zh-CN. Treatment drives color: positive = green, neutral = amber, |
| 8 | +// negative = dim red. |
| 9 | +type Treatment = "positive" | "neutral" | "negative"; |
| 10 | +const cellMap: Record<string, { label: string; treatment: Treatment }> = { |
| 11 | + yes: { label: "✓", treatment: "positive" }, |
| 12 | + no: { label: "—", treatment: "negative" }, |
| 13 | + shared: { label: s.legendShared ?? "shared account", treatment: "negative" }, |
| 14 | + partial: { label: s.legendPartial ?? "partial", treatment: "neutral" }, |
| 15 | + limited: { label: s.legendLimited ?? "limited", treatment: "neutral" }, |
| 16 | + "hosted-only": { label: s.legendHostedOnly ?? "hosted-only", treatment: "neutral" }, |
| 17 | + "n/a": { label: "n/a", treatment: "negative" }, |
| 18 | + saas: { label: s.legendSaas ?? "SaaS-only", treatment: "neutral" }, |
| 19 | + varies: { label: s.legendVaries ?? "varies", treatment: "neutral" }, |
| 20 | + english: { label: s.legendEnglish ?? "English-only", treatment: "neutral" }, |
| 21 | + proprietary: { label: s.legendProprietary ?? "proprietary",treatment: "neutral" }, |
| 22 | + oss: { label: s.legendOss ?? "OSS", treatment: "neutral" }, |
| 23 | +}; |
| 24 | +
|
| 25 | +function cell(raw: string) { |
| 26 | + return cellMap[raw] ?? { label: raw, treatment: "neutral" as Treatment }; |
| 27 | +} |
| 28 | +
|
| 29 | +const treatmentClass: Record<Treatment, string> = { |
| 30 | + positive: "text-[var(--color-brand-1)]", |
| 31 | + neutral: "text-amber-300/80", |
| 32 | + negative: "text-[var(--color-dim)]", |
| 33 | +}; |
| 34 | +--- |
| 35 | + |
| 36 | +<section id="mcp" class="py-20 sm:py-28 border-t border-white/5 relative overflow-hidden"> |
| 37 | + <!-- Subtle radial accent so the section reads as the marquee MCP pitch --> |
| 38 | + <div |
| 39 | + class="pointer-events-none absolute inset-0 -z-0" |
| 40 | + aria-hidden="true" |
| 41 | + style="background: radial-gradient(60% 50% at 80% 0%, rgba(61, 219, 217, 0.07), transparent 60%), radial-gradient(50% 40% at 10% 100%, rgba(168, 85, 247, 0.06), transparent 60%);" |
| 42 | + ></div> |
| 43 | + |
| 44 | + <div class="container-page relative z-10"> |
| 45 | + <div class="max-w-3xl"> |
| 46 | + <div class="text-xs uppercase tracking-[0.18em] text-[var(--color-brand-1)] font-medium mb-4"> |
| 47 | + {s.eyebrow} |
| 48 | + </div> |
| 49 | + <h2 class="text-3xl sm:text-4xl md:text-5xl font-semibold tracking-tight"> |
| 50 | + {s.title}<span class="text-gradient">{s.titleHighlight}</span>. |
| 51 | + </h2> |
| 52 | + <p class="mt-4 sm:mt-5 text-base sm:text-lg text-[var(--color-muted)] leading-relaxed"> |
| 53 | + {s.sub} |
| 54 | + </p> |
| 55 | + </div> |
| 56 | + |
| 57 | + <!-- Comparison table --> |
| 58 | + <div class="mt-14"> |
| 59 | + <div class="text-xs uppercase tracking-[0.18em] text-[var(--color-muted)] mb-4"> |
| 60 | + {s.tableTitle} |
| 61 | + </div> |
| 62 | + |
| 63 | + <div class="rounded-2xl border border-white/10 bg-[var(--color-surface)]/60 overflow-hidden"> |
| 64 | + <div class="overflow-x-auto"> |
| 65 | + <table class="w-full text-sm min-w-[720px]"> |
| 66 | + <thead> |
| 67 | + <tr class="border-b border-white/10 bg-white/[0.02]"> |
| 68 | + {s.columns.map((col, i) => ( |
| 69 | + <th |
| 70 | + scope="col" |
| 71 | + class:list={[ |
| 72 | + "text-left px-5 py-4 text-xs uppercase tracking-[0.14em] font-medium", |
| 73 | + i === 0 ? "text-[var(--color-muted)]" : "", |
| 74 | + i === 1 ? "text-white" : "", |
| 75 | + i > 1 ? "text-[var(--color-dim)]" : "", |
| 76 | + ]} |
| 77 | + > |
| 78 | + {i === 1 ? ( |
| 79 | + <span class="inline-flex items-center gap-1.5"> |
| 80 | + <span class="w-1.5 h-1.5 rounded-full bg-[var(--color-brand-1)] shadow-[0_0_8px_var(--color-brand-1)]" aria-hidden="true"></span> |
| 81 | + {col} |
| 82 | + </span> |
| 83 | + ) : ( |
| 84 | + col |
| 85 | + )} |
| 86 | + </th> |
| 87 | + ))} |
| 88 | + </tr> |
| 89 | + </thead> |
| 90 | + <tbody> |
| 91 | + {s.rows.map((row, rIdx) => ( |
| 92 | + <tr class:list={["border-b border-white/5 last:border-b-0", rIdx % 2 === 1 ? "bg-white/[0.015]" : ""]}> |
| 93 | + <td class="px-5 py-3.5 text-[var(--color-muted)]">{row.label}</td> |
| 94 | + {row.values.map((raw, cIdx) => { |
| 95 | + const c = cell(raw); |
| 96 | + return ( |
| 97 | + <td |
| 98 | + class:list={[ |
| 99 | + "px-5 py-3.5 font-mono text-[13px] tabular-nums", |
| 100 | + treatmentClass[c.treatment], |
| 101 | + cIdx === 0 ? "font-semibold" : "", |
| 102 | + ]} |
| 103 | + > |
| 104 | + {c.label} |
| 105 | + </td> |
| 106 | + ); |
| 107 | + })} |
| 108 | + </tr> |
| 109 | + ))} |
| 110 | + </tbody> |
| 111 | + </table> |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + |
| 115 | + <p class="mt-3 text-xs text-[var(--color-dim)]">{s.tableNote}</p> |
| 116 | + </div> |
| 117 | + |
| 118 | + <!-- Differentiator cards --> |
| 119 | + <div class="mt-14 sm:mt-16"> |
| 120 | + <div class="text-xs uppercase tracking-[0.18em] text-[var(--color-muted)] mb-4"> |
| 121 | + {s.cardsTitle} |
| 122 | + </div> |
| 123 | + <div class="grid gap-4 sm:gap-5 sm:grid-cols-2"> |
| 124 | + {s.cards.map((card, i) => ( |
| 125 | + <div |
| 126 | + class="mcp-card group relative rounded-2xl border border-white/10 bg-[var(--color-surface)]/60 p-6 hover:border-white/25 transition-colors overflow-hidden" |
| 127 | + style={`--mcp-delay:${i * 80}ms`} |
| 128 | + > |
| 129 | + <div class="flex items-start justify-between mb-4"> |
| 130 | + <span class="font-mono text-[11px] tracking-[0.18em] text-[var(--color-brand-1)]"> |
| 131 | + 0{i + 1} |
| 132 | + </span> |
| 133 | + <span class="font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--color-dim)]"> |
| 134 | + ThinkWatch |
| 135 | + </span> |
| 136 | + </div> |
| 137 | + <h3 class="text-lg font-semibold tracking-tight mb-2">{card.title}</h3> |
| 138 | + <p class="text-sm text-[var(--color-muted)] leading-relaxed">{card.body}</p> |
| 139 | + <div class="absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-cyan-400/40 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"></div> |
| 140 | + </div> |
| 141 | + ))} |
| 142 | + </div> |
| 143 | + </div> |
| 144 | + </div> |
| 145 | +</section> |
| 146 | + |
| 147 | +<style> |
| 148 | + .mcp-card { |
| 149 | + opacity: 0; |
| 150 | + transform: translateY(14px); |
| 151 | + } |
| 152 | + .mcp-card.is-visible { |
| 153 | + animation: mcpFadeUp 600ms cubic-bezier(.2,.7,.25,1) both; |
| 154 | + animation-delay: var(--mcp-delay, 0ms); |
| 155 | + } |
| 156 | + @keyframes mcpFadeUp { |
| 157 | + from { opacity: 0; transform: translateY(14px); } |
| 158 | + to { opacity: 1; transform: translateY(0); } |
| 159 | + } |
| 160 | + @media (prefers-reduced-motion: reduce) { |
| 161 | + .mcp-card { opacity: 1; transform: none; animation: none !important; } |
| 162 | + } |
| 163 | +</style> |
| 164 | + |
| 165 | +<script> |
| 166 | + const cards = document.querySelectorAll(".mcp-card"); |
| 167 | + if (cards.length && "IntersectionObserver" in window) { |
| 168 | + const obs = new IntersectionObserver( |
| 169 | + (entries) => { |
| 170 | + for (const entry of entries) { |
| 171 | + if (entry.isIntersecting) { |
| 172 | + entry.target.classList.add("is-visible"); |
| 173 | + obs.unobserve(entry.target); |
| 174 | + } |
| 175 | + } |
| 176 | + }, |
| 177 | + { threshold: 0.15 } |
| 178 | + ); |
| 179 | + cards.forEach((c) => obs.observe(c)); |
| 180 | + } else { |
| 181 | + cards.forEach((c) => c.classList.add("is-visible")); |
| 182 | + } |
| 183 | +</script> |
0 commit comments