64 lines
2.5 KiB
HTML
64 lines
2.5 KiB
HTML
|
|
<!doctype html>
|
||
|
|
<html lang="zh-Hans">
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8">
|
||
|
|
<title>OG card · DS-12</title>
|
||
|
|
<link rel="stylesheet" href="styles.css">
|
||
|
|
<style>
|
||
|
|
html, body { margin: 0; }
|
||
|
|
body { width: 1200px; height: 630px; overflow: hidden; background: var(--ink); }
|
||
|
|
.og {
|
||
|
|
width: 1200px; height: 630px;
|
||
|
|
display: grid; grid-template-rows: auto 1fr auto;
|
||
|
|
padding: 54px 60px 48px;
|
||
|
|
color: var(--paper);
|
||
|
|
background:
|
||
|
|
linear-gradient(to right, rgba(233,229,219,.05) 1px, transparent 1px) 0 0 / 34px 34px,
|
||
|
|
linear-gradient(to bottom, rgba(233,229,219,.05) 1px, transparent 1px) 0 0 / 34px 34px,
|
||
|
|
var(--ink);
|
||
|
|
}
|
||
|
|
.og__top { display: flex; justify-content: space-between; align-items: baseline;
|
||
|
|
font-family: var(--font-mono); font-size: 15px; letter-spacing: .18em; text-transform: uppercase; }
|
||
|
|
.og__code { color: var(--vermilion-hi); }
|
||
|
|
.og__mid { display: grid; grid-template-columns: 1.28fr .72fr; align-items: center; gap: 36px; }
|
||
|
|
.og__title {
|
||
|
|
font-family: var(--font-display); font-size: 74px; line-height: 1.16; margin: 0;
|
||
|
|
color: var(--paper); letter-spacing: -.01em; white-space: nowrap;
|
||
|
|
}
|
||
|
|
.og__title em { font-style: normal; color: var(--vermilion-hi); }
|
||
|
|
.og__deck { margin: 22px 0 0; font-size: 20px; line-height: 1.7; max-width: 28ch;
|
||
|
|
color: color-mix(in oklab, var(--paper) 68%, transparent); }
|
||
|
|
.og__bot { display: flex; justify-content: space-between; align-items: baseline;
|
||
|
|
border-top: 1px solid color-mix(in oklab, var(--paper) 22%, transparent);
|
||
|
|
padding-top: 20px; font-family: var(--font-mono); font-size: 15px; letter-spacing: .12em;
|
||
|
|
color: color-mix(in oklab, var(--paper) 55%, transparent); }
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="og">
|
||
|
|
<div class="og__top">
|
||
|
|
<span class="og__code">DS-12 / 00</span>
|
||
|
|
<span>408 知识卡片 · 数据结构</span>
|
||
|
|
</div>
|
||
|
|
<div class="og__mid">
|
||
|
|
<div>
|
||
|
|
<h1 class="og__title">一棵树,<br><em>折成一棵二叉树</em></h1>
|
||
|
|
<p class="og__deck">左孩子、右兄弟;先根变先序、后根变中序。</p>
|
||
|
|
</div>
|
||
|
|
<div id="ogDiagram" style="height: 380px"></div>
|
||
|
|
</div>
|
||
|
|
<div class="og__bot">
|
||
|
|
<span>孩子兄弟表示法 · 遍历序列互推 · 结点计数</span>
|
||
|
|
<span>本页实时 SVG 绘制</span>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<script src="app.js"></script>
|
||
|
|
<script>
|
||
|
|
// 复用正片的绘制器,跑一张静态二叉树
|
||
|
|
document.addEventListener('DOMContentLoaded', () => {
|
||
|
|
if (window.__mountOgDiagram) window.__mountOgDiagram(document.getElementById('ogDiagram'));
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|