feat(docs): update computer fundamentals content and demos

- Refactor frontend framework demo descriptions for clarity
- Remove interactive features from triad and field map demos
- Add new computer organization and DSL documentation links
- Split type systems and compilers into separate pages
- Enhance power-on-to-web article with relay race analogy
- Add new interactive demos for type systems and compilation
- Improve visual presentation of boot process and hardware flow
- Introduce new Vibe Coding flow demo component
This commit is contained in:
sanbuphy
2026-02-25 01:38:27 +08:00
parent 3af119a598
commit f44c842fe7
41 changed files with 7721 additions and 1290 deletions
@@ -1,40 +1,29 @@
<template>
<div class="rendering-demo">
<div class="demo-label">浏览器渲染过程 点击逐步演示</div>
<div class="demo-title">浏览器渲染管线</div>
<div class="pipeline">
<div
v-for="(stage, index) in stages"
:key="stage.name"
class="pipeline-stage"
:class="{ active: currentStage >= index }"
@click="currentStage = index"
>
<div class="stage-header">
<span class="stage-num">{{ index + 1 }}</span>
<span class="stage-name">{{ stage.name }}</span>
</div>
<div class="stage-desc">{{ stage.desc }}</div>
<div v-if="currentStage >= index" class="stage-detail">
{{ stage.detail }}
<div v-for="(stage, i) in stages" :key="stage.name" class="pipe-item">
<div class="pipe-card">
<div class="pipe-num">{{ i + 1 }}</div>
<div class="pipe-info">
<div class="pipe-name">{{ stage.name }}</div>
<div class="pipe-desc">{{ stage.desc }}</div>
</div>
</div>
<div v-if="i < stages.length - 1" class="pipe-arrow"></div>
</div>
</div>
<div class="tap-hint">👆 点击查看各阶段详情</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
const currentStage = ref(0)
const stages = [
{ name: 'HTML 解析', desc: ' HTML 变成 DOM 树', detail: '<div> → Document Object Model 树结构' },
{ name: 'CSS 解析', desc: ' CSS 变成样式规则', detail: '选择器 + 属性 → 样式规则表' },
{ name: '渲染树', desc: 'DOM + CSS = 渲染树', detail: '哪些节点显示、什么样式' },
{ name: '布局计算', desc: '计算每个元素的位置', detail: '宽高、坐标、层级' },
{ name: '绘制', desc: '把内容画到像素缓冲区', detail: '文字、颜色、图片、边框' },
{ name: '合成', desc: '多层合成一张图', detail: 'GPU 合成,显示到屏幕' }
{ name: 'HTML 解析', desc: ' HTML 文本解析为 DOM 树(文档对象模型)' },
{ name: 'CSS 解析', desc: ' CSS 规则解析为样式表,计算每个元素的最终样式' },
{ name: '构建渲染树', desc: 'DOM 树 + 样式规则 = 渲染树(只包含可见元素)' },
{ name: '布局计算', desc: '计算每个元素在页面上的精确位置和大小' },
{ name: '绘制', desc: '将元素的文字、颜色、图片、边框等绘制到像素缓冲区' },
{ name: '合成显示', desc: '将多个图层合成为最终画面,由 GPU 输出到屏幕' }
]
</script>
@@ -45,87 +34,63 @@ const stages = [
background: var(--vp-c-bg-soft);
padding: 1rem 1.2rem;
margin: 1rem 0;
cursor: pointer;
user-select: none;
}
.demo-label {
font-size: 0.78rem;
font-weight: bold;
color: var(--vp-c-text-2);
margin-bottom: 0.75rem;
letter-spacing: 0.2px;
}
.pipeline {
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.pipeline-stage {
background: var(--vp-c-bg);
border: 1px solid var(--vp-c-divider);
border-radius: 6px;
padding: 0.5rem 0.6rem;
opacity: 0.4;
transition: all 0.3s;
}
.pipeline-stage.active {
opacity: 1;
border-color: var(--vp-c-brand);
}
.stage-header {
display: flex;
align-items: center;
gap: 0.4rem;
}
.stage-num {
width: 1.2rem;
height: 1.2rem;
background: var(--vp-c-divider);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.6rem;
font-weight: 600;
color: var(--vp-c-text-2);
}
.pipeline-stage.active .stage-num {
background: var(--vp-c-brand);
color: white;
}
.stage-name {
.demo-title {
font-size: 0.75rem;
font-weight: 600;
color: var(--vp-c-text-2);
margin-bottom: 0.8rem;
}
.stage-desc {
font-size: 0.68rem;
color: var(--vp-c-text-3);
margin-top: 0.15rem;
.pipeline {
display: flex;
flex-direction: column;
align-items: center;
}
.stage-detail {
.pipe-item {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
.pipe-card {
display: flex;
align-items: flex-start;
gap: 0.6rem;
padding: 0.45rem 0.7rem;
background: var(--vp-c-bg);
border: 1px solid var(--vp-c-divider);
border-radius: 6px;
width: 100%;
}
.pipe-num {
width: 1.3rem;
height: 1.3rem;
border-radius: 50%;
background: var(--vp-c-brand);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.65rem;
color: var(--vp-c-brand);
margin-top: 0.3rem;
padding: 0.25rem 0.4rem;
background: var(--vp-c-bg-soft);
border-radius: 4px;
font-weight: 600;
flex-shrink: 0;
margin-top: 0.1rem;
}
.tap-hint {
text-align: center;
.pipe-info { flex: 1; }
.pipe-name {
font-size: 0.72rem;
font-weight: 600;
color: var(--vp-c-text-1);
}
.pipe-desc {
font-size: 0.63rem;
color: var(--vp-c-text-3);
margin-top: 0.75rem;
margin-top: 0.1rem;
line-height: 1.4;
}
.pipe-arrow {
font-size: 0.7rem;
color: var(--vp-c-text-3);
padding: 0.15rem 0;
}
</style>