2026-01-16 19:10:21 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="browser-rendering-demo">
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div class="stepper">
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<button
|
|
|
|
|
|
v-for="(step, index) in steps"
|
2026-01-18 10:24:35 +08:00
|
|
|
|
:key="index"
|
|
|
|
|
|
class="step-btn"
|
2026-01-18 12:21:49 +08:00
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep === index,
|
|
|
|
|
|
completed: currentStep > index
|
|
|
|
|
|
}"
|
2026-01-18 10:24:35 +08:00
|
|
|
|
@click="currentStep = index"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span class="step-num">{{ index + 1 }}</span>
|
|
|
|
|
|
<span class="step-label">{{ step.label }}</span>
|
|
|
|
|
|
</button>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div class="stage-container">
|
|
|
|
|
|
<div class="stage-info">
|
|
|
|
|
|
<h3>{{ steps[currentStep].title }}</h3>
|
|
|
|
|
|
<p>{{ steps[currentStep].desc }}</p>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div class="visualization-window">
|
|
|
|
|
|
<!-- HTML/CSS Source -->
|
|
|
|
|
|
<div class="source-view">
|
|
|
|
|
|
<div class="window-title">积木说明书 (HTML/CSS)</div>
|
|
|
|
|
|
<div class="code-content">
|
|
|
|
|
|
<!-- HTML Highlighted always after Step 0 -->
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="line"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'html'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'html'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'html'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'html'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
<html>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line indent"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'body'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'body'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
<body>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line indent-2"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'card'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'card'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="card">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line indent-3"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'img'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'img'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
<img class="icon" src="castle.png" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line indent-3"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'title'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'title'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
<h2 class="title">乐高城堡</h2>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line indent-3"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'btn'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'btn'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
<button class="btn">购买</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line indent-2"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'card'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'card'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line indent"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'body'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'body'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep >= 0,
|
|
|
|
|
|
hovered: hoveredPart === 'html'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'html'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div class="spacer"></div>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<!-- CSS Highlighted precisely based on step usage -->
|
|
|
|
|
|
<!-- Layout properties -->
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="line"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep === 2,
|
|
|
|
|
|
hovered: hoveredPart === 'card'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'card'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
.card { display: flex; padding: 10px; }
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep === 2,
|
|
|
|
|
|
hovered: hoveredPart === 'img'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'img'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
.icon { width: 50px; height: 50px; }
|
|
|
|
|
|
</div>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<!-- Style properties -->
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="line"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep === 1 || currentStep === 3,
|
|
|
|
|
|
hovered: hoveredPart === 'title'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'title'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
.title { color: red; }
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="line"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
active: currentStep === 1 || currentStep === 3,
|
|
|
|
|
|
hovered: hoveredPart === 'btn'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter="hoveredPart = 'btn'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
|
|
|
|
|
.btn { background: blue; }
|
|
|
|
|
|
</div>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
</div>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div class="transform-arrow">→</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Render Result -->
|
|
|
|
|
|
<div class="result-view">
|
|
|
|
|
|
<div class="window-title">{{ steps[currentStep].resultTitle }}</div>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div class="render-canvas">
|
|
|
|
|
|
<!-- Step 1: DOM (Skeleton) -->
|
|
|
|
|
|
<transition-group name="block">
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="currentStep >= 0"
|
|
|
|
|
|
key="html"
|
|
|
|
|
|
class="block-box root"
|
|
|
|
|
|
:class="{ hovered: hoveredPart === 'html' }"
|
|
|
|
|
|
@mouseenter.stop="hoveredPart = 'html'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<span class="block-label">html</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="block-box body"
|
|
|
|
|
|
:class="{ hovered: hoveredPart === 'body' }"
|
|
|
|
|
|
@mouseenter.stop="hoveredPart = 'body'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<span class="block-label">body</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<!-- Product Card -->
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="block-box card"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
layout: currentStep >= 2,
|
|
|
|
|
|
hovered: hoveredPart === 'card'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter.stop="hoveredPart = 'card'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<span class="block-label">div.card</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<!-- Image -->
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="block-box img"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
layout: currentStep >= 2,
|
|
|
|
|
|
hovered: hoveredPart === 'img'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter.stop="hoveredPart = 'img'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<span class="block-label">img.icon</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<span v-if="currentStep >= 3" class="content-img"
|
|
|
|
|
|
>🏰</span
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
</div>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<!-- Title -->
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="block-box title"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
styled: currentStep >= 1,
|
|
|
|
|
|
layout: currentStep >= 2,
|
|
|
|
|
|
hovered: hoveredPart === 'title'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter.stop="hoveredPart = 'title'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<span class="block-label">h2.title</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<span v-if="currentStep >= 3" class="content"
|
|
|
|
|
|
>乐高城堡</span
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
</div>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<!-- Button -->
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="block-box btn"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
styled: currentStep >= 1,
|
|
|
|
|
|
layout: currentStep >= 2,
|
|
|
|
|
|
hovered: hoveredPart === 'btn'
|
|
|
|
|
|
}"
|
|
|
|
|
|
@mouseenter.stop="hoveredPart = 'btn'"
|
|
|
|
|
|
@mouseleave="hoveredPart = null"
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<span class="block-label">button.btn</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<span v-if="currentStep >= 3" class="content-btn"
|
|
|
|
|
|
>购买</span
|
|
|
|
|
|
>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
</transition-group>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Overlays for different steps -->
|
|
|
|
|
|
<div v-if="currentStep === 1" class="overlay-info style-info">
|
|
|
|
|
|
<div class="brush">🖌️ 正在上色 (Style)...</div>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div v-if="currentStep === 2" class="overlay-info layout-info">
|
|
|
|
|
|
<div class="ruler">📏 正在排版 (Layout)...</div>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div v-if="currentStep === 3" class="overlay-info paint-info">
|
2026-01-18 10:24:35 +08:00
|
|
|
|
<div class="paint">✨ 绘制完成 (Paint)!</div>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-01-18 10:24:35 +08:00
|
|
|
|
</div>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
|
|
|
|
const steps = [
|
|
|
|
|
|
{
|
2026-01-18 10:24:35 +08:00
|
|
|
|
label: 'DOM (搭骨架)',
|
|
|
|
|
|
title: '1. 搭建骨架 (DOM)',
|
|
|
|
|
|
desc: '浏览器工头 (Parser) 解析 HTML 代码,构建出完整的文档树结构。注意:即使代码中省略了 html/body,浏览器也会自动补全。',
|
|
|
|
|
|
resultTitle: 'DOM 树结构'
|
2026-01-16 19:10:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-01-18 10:24:35 +08:00
|
|
|
|
label: 'Style (上色)',
|
|
|
|
|
|
title: '2. 计算样式 (Recalculate Style)',
|
|
|
|
|
|
desc: '装修工 (CSS Parser) 匹配 CSS 规则。比如发现 .title 需要红色,.btn 需要蓝色背景。此时只关心"长什么样",不关心"在哪"。',
|
|
|
|
|
|
resultTitle: '附带样式的节点'
|
2026-01-16 19:10:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-01-18 10:24:35 +08:00
|
|
|
|
label: 'Layout (排版)',
|
|
|
|
|
|
title: '3. 布局排版 (Layout/Reflow)',
|
|
|
|
|
|
desc: '测量员 (Layout) 根据 display:flex 和 padding 等属性,计算每个盒子的精确位置和大小。图片在左,文字在右。',
|
|
|
|
|
|
resultTitle: '几何布局'
|
2026-01-16 19:10:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-01-18 10:24:35 +08:00
|
|
|
|
label: 'Paint (绘制)',
|
|
|
|
|
|
title: '4. 像素绘制 (Paint)',
|
|
|
|
|
|
desc: '画家 (Paint) 按照计算好的位置和样式,真正把像素点画在屏幕上。最终你看到了一个完整的商品卡片。',
|
|
|
|
|
|
resultTitle: '最终画面'
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
2026-01-18 10:24:35 +08:00
|
|
|
|
|
|
|
|
|
|
const currentStep = ref(0)
|
|
|
|
|
|
const hoveredPart = ref(null)
|
2026-01-16 19:10:21 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.browser-rendering-demo {
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 8px;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
margin: 1rem 0;
|
|
|
|
|
|
font-family: var(--vp-font-family-mono);
|
2026-01-18 10:24:35 +08:00
|
|
|
|
overflow: hidden;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.stepper {
|
2026-01-16 19:10:21 +08:00
|
|
|
|
display: flex;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
background: var(--vp-c-bg-soft);
|
|
|
|
|
|
border-bottom: 1px solid var(--vp-c-divider);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.step-btn {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
padding: 1rem;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
background: transparent;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
display: flex;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: center;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
gap: 0.5rem;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
transition: all 0.2s;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.step-btn:hover {
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.step-btn.active {
|
|
|
|
|
|
color: var(--vp-c-brand);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
2026-01-18 10:24:35 +08:00
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.step-btn.active::after {
|
|
|
|
|
|
content: '';
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
height: 3px;
|
|
|
|
|
|
background: var(--vp-c-brand);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.step-num {
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
width: 24px;
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
font-size: 0.8rem;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.step-btn.active .step-num,
|
|
|
|
|
|
.step-btn.completed .step-num {
|
2026-01-16 19:10:21 +08:00
|
|
|
|
background: var(--vp-c-brand);
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
border-color: var(--vp-c-brand);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.stage-container {
|
|
|
|
|
|
padding: 1.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.stage-info {
|
|
|
|
|
|
margin-bottom: 2rem;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.stage-info h3 {
|
|
|
|
|
|
margin: 0 0 0.5rem 0;
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.stage-info p {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.visualization-window {
|
2026-01-16 19:10:21 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 1rem;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
align-items: stretch;
|
|
|
|
|
|
min-height: 400px;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.source-view,
|
|
|
|
|
|
.result-view {
|
2026-01-16 19:10:21 +08:00
|
|
|
|
flex: 1;
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 6px;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
background: var(--vp-c-bg-alt);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.window-title {
|
|
|
|
|
|
padding: 0.5rem;
|
|
|
|
|
|
border-bottom: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
font-size: 0.75rem;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
2026-01-18 10:24:35 +08:00
|
|
|
|
background: var(--vp-c-bg-soft);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.code-content {
|
|
|
|
|
|
padding: 1rem;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
font-size: 0.8rem;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
font-family: monospace;
|
|
|
|
|
|
overflow-y: auto;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.line {
|
|
|
|
|
|
padding: 2px 4px;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
opacity: 0.3;
|
|
|
|
|
|
transition: opacity 0.5s;
|
|
|
|
|
|
white-space: nowrap;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
2026-01-18 10:24:35 +08:00
|
|
|
|
|
|
|
|
|
|
.line.active {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
background: rgba(59, 130, 246, 0.1);
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
color: #2563eb;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.line.indent {
|
|
|
|
|
|
padding-left: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.line.indent-2 {
|
|
|
|
|
|
padding-left: 2rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.line.indent-3 {
|
|
|
|
|
|
padding-left: 3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.line.mt-2 {
|
|
|
|
|
|
margin-top: 1rem;
|
|
|
|
|
|
}
|
2026-01-18 10:24:35 +08:00
|
|
|
|
|
|
|
|
|
|
.transform-arrow {
|
|
|
|
|
|
display: flex;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
align-items: center;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
font-size: 1.5rem;
|
|
|
|
|
|
color: var(--vp-c-text-3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.result-view {
|
|
|
|
|
|
background: white;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.render-canvas {
|
|
|
|
|
|
padding: 2rem;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Blocks Animation */
|
|
|
|
|
|
.block-box {
|
|
|
|
|
|
border: 1px dashed #9ca3af;
|
|
|
|
|
|
background: #f3f4f6;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
padding: 0.5rem;
|
|
|
|
|
|
margin: 0.2rem;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
min-width: 50px;
|
|
|
|
|
|
min-height: 30px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.block-box.root {
|
|
|
|
|
|
width: 95%;
|
|
|
|
|
|
border-color: #e5e7eb;
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
.block-box.body {
|
|
|
|
|
|
width: 90%;
|
|
|
|
|
|
border-color: #d1d5db;
|
|
|
|
|
|
background: #f9fafb;
|
|
|
|
|
|
}
|
|
|
|
|
|
.block-box.card {
|
|
|
|
|
|
width: 80%;
|
|
|
|
|
|
border-color: #9ca3af;
|
|
|
|
|
|
background: #e5e7eb;
|
|
|
|
|
|
}
|
2026-01-18 10:24:35 +08:00
|
|
|
|
|
|
|
|
|
|
.block-label {
|
|
|
|
|
|
font-size: 0.6rem;
|
|
|
|
|
|
color: #9ca3af;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: -8px;
|
|
|
|
|
|
left: 4px;
|
|
|
|
|
|
background: white;
|
|
|
|
|
|
padding: 0 2px;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
2026-01-18 10:24:35 +08:00
|
|
|
|
|
|
|
|
|
|
/* Step 2: Style */
|
|
|
|
|
|
.block-box.title.styled {
|
|
|
|
|
|
color: red; /* Text color applied but not painted yet */
|
|
|
|
|
|
border: 1px solid red; /* Visual cue for style applied */
|
|
|
|
|
|
background: #fee2e2;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.block-box.btn.styled {
|
|
|
|
|
|
background: blue;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
border: 1px solid blue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Step 3: Layout */
|
|
|
|
|
|
.block-box.card.layout {
|
2026-01-16 19:10:21 +08:00
|
|
|
|
display: flex;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
flex-direction: row; /* Horizontal layout */
|
2026-01-16 19:10:21 +08:00
|
|
|
|
align-items: center;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
gap: 10px;
|
|
|
|
|
|
padding: 15px;
|
|
|
|
|
|
background: white;
|
|
|
|
|
|
border: 1px solid #ccc;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.block-box.img.layout {
|
|
|
|
|
|
width: 50px;
|
|
|
|
|
|
height: 50px;
|
|
|
|
|
|
background: #eee;
|
|
|
|
|
|
border: none;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.block-box.title.layout {
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
background: transparent;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.block-box.btn.layout {
|
|
|
|
|
|
margin-left: auto; /* Push to right */
|
|
|
|
|
|
padding: 5px 15px;
|
|
|
|
|
|
border-radius: 4px;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
/* Content visibility for Paint step */
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.content,
|
|
|
|
|
|
.content-img,
|
|
|
|
|
|
.content-btn {
|
2026-01-18 10:24:35 +08:00
|
|
|
|
font-size: 1rem;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
animation: fadeIn 0.5s;
|
|
|
|
|
|
align-self: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.content-img {
|
|
|
|
|
|
font-size: 2rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.content-btn {
|
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
|
}
|
2026-01-18 10:24:35 +08:00
|
|
|
|
|
|
|
|
|
|
/* Overlay Info */
|
|
|
|
|
|
.overlay-info {
|
2026-01-16 19:10:21 +08:00
|
|
|
|
position: absolute;
|
2026-01-18 10:24:35 +08:00
|
|
|
|
bottom: 1rem;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
animation: bounceIn 0.5s;
|
|
|
|
|
|
pointer-events: none;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.brush,
|
|
|
|
|
|
.ruler,
|
|
|
|
|
|
.paint {
|
2026-01-18 10:24:35 +08:00
|
|
|
|
display: inline-block;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
background: rgba(0, 0, 0, 0.8);
|
2026-01-18 10:24:35 +08:00
|
|
|
|
color: white;
|
|
|
|
|
|
padding: 0.5rem 1rem;
|
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
|
font-size: 0.8rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
2026-01-18 10:24:35 +08:00
|
|
|
|
|
|
|
|
|
|
/* Vue Transitions */
|
|
|
|
|
|
.block-enter-active,
|
|
|
|
|
|
.block-leave-active {
|
|
|
|
|
|
transition: all 0.5s ease;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.block-enter-from {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
transform: scale(0.9);
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
@keyframes fadeIn {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
from {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
to {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
@keyframes bounceIn {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
0% {
|
|
|
|
|
|
transform: scale(0.8);
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
60% {
|
|
|
|
|
|
transform: scale(1.1);
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
100% {
|
|
|
|
|
|
transform: scale(1);
|
|
|
|
|
|
}
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
/* Hover Interactions */
|
|
|
|
|
|
.line.hovered {
|
|
|
|
|
|
background: rgba(59, 130, 246, 0.15);
|
|
|
|
|
|
opacity: 1 !important;
|
|
|
|
|
|
cursor: crosshair;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-18 10:24:35 +08:00
|
|
|
|
.block-box.hovered {
|
|
|
|
|
|
box-shadow: 0 0 0 2px #3b82f6;
|
|
|
|
|
|
z-index: 10;
|
|
|
|
|
|
background-color: rgba(59, 130, 246, 0.05);
|
|
|
|
|
|
cursor: crosshair;
|
2026-01-16 19:10:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|