feat: add AI and Backend evolution history with interactive demos, and refine Frontend evolution demo

This commit is contained in:
sanbuphy
2026-01-18 10:24:35 +08:00
parent 82be39a9ac
commit 26ed39e1eb
44 changed files with 9868 additions and 2633 deletions
@@ -46,6 +46,9 @@
<h3 class="stage-title">Step 1: Tokenization (分词)</h3>
<p class="stage-desc">
计算机首先将文本切分为最小的语义单位Token
<span style="font-size: 0.85em; color: var(--vp-c-text-2); display: block; margin-top: 4px;">
(此处演示简化为按字切分真实模型通常使用 BPE 算法人工智能可能合并为一个 Token)
</span>
</p>
<div class="token-container">
<div
@@ -177,7 +180,8 @@ const getTokenColor = (idx) => colors[idx % colors.length]
const getHeatmapColor = (val) => {
// val is -1 to 1
// Map to blue (negative) -> white (0) -> red (positive)
const opacity = Math.abs(val)
// Reduce max opacity to avoid confusion with "selection" or "special token"
const opacity = Math.abs(val) * 0.6 + 0.1
if (val > 0) return `rgba(239, 68, 68, ${opacity})` // Red
return `rgba(59, 130, 246, ${opacity})` // Blue
}
@@ -341,6 +345,7 @@ const getHeatmapColor = (val) => {
position: relative;
display: flex;
align-items: center;
justify-content: center; /* Add centering */
margin-top: 1rem;
}