Design Vault Search use case, structure, colour, notes /
Index Categories Tags 日本語
Back to index

Code Slide — Line Numbers, Highlighted Lines, Notes Tied by Number

Annotated
Design
Code Slide — Line Numbers, Highlighted Lines, Notes Tied by Number
140 88

1920 × 1080 Seen as a design

Take it with you

Copy and paste, or save a file and hand it over. For a machine with no network, one “Everything” file is enough.

Everything

code-highlight-lines-everything.md

Everything in this panel, including the contents behind each URL, in one Markdown file

Prompt

1.2 KB
Produce one slide to the following specification.

- Canvas 1920 × 1080
- Margin top 88 right 140 bottom 56 left 140

## Type (px against a 1920px canvas)
kicker  22px / 500 / tracking 0.12em / tabular numerals
title  50px / 700 / leading 1.4 / tabular numerals
lineNo  20px / 400 / leading 1.5 / tabular numerals
code  24px / 400 / leading 1.5 / tabular numerals
markNo  24px / 700 / tabular numerals
noteLine  20px / 400 / tabular numerals
noteHead  28px / 700 / tabular numerals
noteBody  22px / 400 / leading 1.6 / tabular numerals
folio  16px / 400 / tabular numerals

## Colour
Ground #FBFAF6 / Surface #F1EFE8 / Ink #1E1E1C / Muted #6B6A64 / Accent #8A2B1E / Rule #DCD8CC

## Constraints — dropping these breaks it
- Highlight three lines at most — explain everything and nothing stands out
- Notes say what the line does and why — not a reading of the code
- Twenty lines at most, at 24px or more; elide the rest with an ellipsis
- Show the line number on both sides so the eye can travel back and forth

Replace the content with [your content]. Keep the measurements and colours as given.
For an exact reproduction, use the verbatim HTML at https://design-vault.pages.dev/designs/code-highlight-lines/pattern.html.

Spec

1.6 KB

/ai/designs/code-highlight-lines.json

format: slide-16x9
density: medium
layout:
  kind: annotated
  canvas:
    w: 1920
    h: 1080
  margin:
    top: 88
    right: 140
    bottom: 56
    left: 140
type:
  kicker:
    size: 22
    weight: 500
    tracking: 0.12em
    numeric: tabular
  title:
    size: 50
    weight: 700
    leading: 1.4
    numeric: tabular
  lineNo:
    size: 20
    weight: 400
    leading: 1.5
    numeric: tabular
  code:
    size: 24
    weight: 400
    leading: 1.5
    numeric: tabular
  markNo:
    size: 24
    weight: 700
    numeric: tabular
  noteLine:
    size: 20
    weight: 400
    numeric: tabular
  noteHead:
    size: 28
    weight: 700
    numeric: tabular
  noteBody:
    size: 22
    weight: 400
    leading: 1.6
    numeric: tabular
  folio:
    size: 16
    weight: 400
    numeric: tabular
colors:
  ground: "#FBFAF6"
  surface: "#F1EFE8"
  ink: "#1E1E1C"
  muted: "#6B6A64"
  accent: "#8A2B1E"
  rule: "#DCD8CC"
rules:
  - Highlight three lines at most — explain everything and nothing stands out
  - Notes say what the line does and why — not a reading of the code
  - Twenty lines at most, at 24px or more; elide the rest with an ellipsis
  - Show the line number on both sides so the eye can travel back and forth

Files

pattern.html

5.8 KB

/designs/code-highlight-lines/pattern.html — The artboard itself, font subset included — open it and this picture draws.

Show contents
<!doctype html>
<meta charset="utf-8">
<title>コードの 1 枚 — 行番号、強調する行、右の注記を番号で結ぶ</title>
<meta name="dv-font" content="Zen Old Mincho:700">
<meta name="dv-font" content="Zen Kaku Gothic New:400;500;700">
<meta name="dv-font" content="IBM Plex Mono:400;600">
<link rel="stylesheet" href="./font.css">
<style>
  /* この版そのもの。index.md の layout / type / colors は、この HTML を
     scripts/render-pattern.mjs で実測した結果であって、別に書いた説明ではない。
     研究・著者・所属・数値・文献はすべて説明用の架空のもの。 */
  :root {
    --ground: #FBFAF6;
    --surface: #F1EFE8;
    --ink: #1E1E1C;
    --muted: #6B6A64;
    --accent: #8A2B1E;
    --rule: #DCD8CC;
    --hl: color-mix(in srgb, var(--accent) 12%, var(--surface));
  }
  * { box-sizing: border-box; margin: 0; }
  html, body { width: 1920px; height: 1080px; }
  body { font-family: "Zen Kaku Gothic New", "IPAGothic", sans-serif; font-variant-numeric: tabular-nums; }
  /* 明朝は見出しにだけ使う。本文まで明朝にすると、投影したとき細い線が飛ぶ */
  .mincho, .title { font-family: "Zen Old Mincho", "IPAMincho", serif; }

  .artboard {
    width: 1920px; height: 1080px;
    background: var(--ground); color: var(--ink);
    padding: 88px 140px 56px;             /* → layout.margin */
  }
  .content { height: 100%; display: grid; grid-template-rows: auto 1fr auto; row-gap: 40px; }

  .kicker { font-size: 22px; font-weight: 500; letter-spacing: .12em; color: var(--accent); }
  .title { font-size: 50px; font-weight: 700; line-height: 1.4; margin-top: 10px; }
  .folio { display: flex; justify-content: space-between; font-size: 16px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 16px; }

  .split { display: grid; grid-template-columns: 1100px 1fr; column-gap: 56px; align-items: start; }
  .code { background: var(--surface); padding: 24px 0; font-family: "IBM Plex Mono", "Zen Kaku Gothic New", monospace; }
  .ln { display: grid; grid-template-columns: 72px 1fr 48px; align-items: center; font-size: 24px; line-height: 1.5; }
  .ln .no { text-align: right; padding-right: 24px; color: var(--muted); font-size: 20px; }
  .ln code { font-family: inherit; white-space: pre; }
  /* 強調する行だけ面を敷き、行番号も強調色にする。注記の番号と同じ印を行末に置く */
  .ln.hl { background: var(--hl); }
  .ln.hl .no { color: var(--accent); font-weight: 600; }
  .mk { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--ground); font-family: "Zen Kaku Gothic New", sans-serif; font-size: 20px; font-weight: 700; }
  .mk.big { width: 44px; height: 44px; font-size: 24px; }
  ol { list-style: none; padding: 0; }
  li { display: grid; grid-template-columns: 64px 1fr; padding: 22px 0; border-bottom: 1px solid var(--rule); }
  li:first-child { padding-top: 0; }
  .nl { font-size: 20px; color: var(--muted); }
  .nh { font-size: 28px; font-weight: 700; margin-top: 2px; }
  .nb { font-size: 22px; color: var(--muted); line-height: 1.6; margin-top: 6px; }

</style>

<div class="artboard" data-artboard>
  <div class="content" data-content>
    <div>
      <p class="kicker" data-type="kicker">実装</p>
      <h1 class="title" data-type="title">束ね配信は、毎正時に列を空にするだけで作れる</h1>
    </div>
    <div class="split">
      <div class="code">
<p class="ln"><span class="no" data-type="lineNo">1</span><code data-type="code">type Notice = { id: string; from: string; at: Date };</code></p>
<p class="ln"><span class="no">2</span><code> </code></p>
<p class="ln"><span class="no">3</span><code>const HOUR = 60 * 60 * 1000;</code></p>
<p class="ln"><span class="no">4</span><code>const queue: Notice[] = [];</code></p>
<p class="ln"><span class="no">5</span><code> </code></p>
<p class="ln"><span class="no">6</span><code>// 届いた通知は渡さずに、列にためる</code></p>
<p class="ln"><span class="no">7</span><code>export function receive(n: Notice) {</code></p>
<p class="ln"><span class="no">8</span><code>  queue.push(n);</code></p>
<p class="ln"><span class="no">9</span><code>}</code></p>
<p class="ln"><span class="no">10</span><code> </code></p>
<p class="ln"><span class="no">11</span><code>export function startBatching(deliver: (ns: Notice[]) =&gt; void) {</code></p>
<p class="ln hl"><span class="no">12</span><code>  const wait = HOUR - (Date.now() % HOUR);</code><span class="mk">1</span></p>
<p class="ln"><span class="no">13</span><code>  setTimeout(() =&gt; {</code></p>
<p class="ln hl"><span class="no">14</span><code>    deliver(queue.splice(0));</code><span class="mk">2</span></p>
<p class="ln hl"><span class="no">15</span><code>    setInterval(() =&gt; deliver(queue.splice(0)), HOUR);</code><span class="mk">3</span></p>
<p class="ln"><span class="no">16</span><code>  }, wait);</code></p>
<p class="ln"><span class="no">17</span><code>}</code></p>
      </div>
      <ol><li><span class="mk big" data-type="markNo">1</span><div><p class="nl" data-type="noteLine">12 行目</p><p class="nh" data-type="noteHead">次の正時までの待ち時間を出す</p><p class="nb" data-type="noteBody">起動した時刻によらず、配信を毎時 0 分に揃える</p></div></li><li><span class="mk big">2</span><div><p class="nl">14 行目</p><p class="nh">たまった分を一度に渡す</p><p class="nb">splice(0) で列を空にし、同じ通知を二度渡さない</p></div></li><li><span class="mk big">3</span><div><p class="nl">15 行目</p><p class="nh">以後は 1 時間ごと</p><p class="nb">最初の 1 回だけ待ち時間がずれ、2 回目からは等間隔</p></div></li></ol>
    </div>
    <div class="folio">
      <p data-type="folio">山野ほか 通知の束ね配信と作業の中断</p>
      <p>08</p>
    </div>
  </div>
</div>

font.css

6.0 KB

/designs/code-highlight-lines/font.css — Not in Everything

Show contents
/* dv-subset v2 — generated by scripts/subset-font.mjs. Do not edit.
 * font    Zen Old Mincho 700
 * font    Zen Kaku Gothic New 400;500;700
 * font    IBM Plex Mono 400;600
 * chars   146 (825467b1159f0717)
 *
 * pattern.html の文字だけを含む部分集合。描画時に外部へ取りに行かないよう同梱する。
 * 版の文字を変えたら取り直すこと — 忘れると足りない字が豆腐になる。
 * その取り忘れは pattern-entries.test.ts が上の指紋で検出する。
 */

@font-face {
  font-family: 'Zen Old Mincho';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(./font-0.woff2) format('woff2');
  unicode-range: U+20, U+25, U+28-2a, U+2c-3b, U+3d-3e, U+42, U+44, U+48-49, U+4e-4f, U+52, U+54-55, U+5b, U+5d, U+61, U+63-69, U+6c-79, U+7b, U+7d, U+2014, U+3000-3001, U+3044, U+3048, U+304b-304c, U+3051-305a, U+305f-3063, U+3066-306b, U+306d-3070, U+3075-3076, U+307b-307c, U+307e, U+3081, U+3088-3089, U+308b-308c, U+3092, U+3099, U+30b3-30b4, U+30c8-30c9, U+30fc, U+4e00, U+4e2d, U+4e8c, U+4ee5, U+4f5c, U+4fe1, U+51fa, U+5206, U+5217, U+521d, U+523b, U+52d5, U+53f3, U+53f7, U+540c, U+56de, U+5b9f, U+5c4a, U+5c71, U+5ea6, U+5f37, U+5f85, U+5f8c, U+63c3, U+65ad, U+6642, U+6700, U+675f, U+679a, U+696d, U+6b21, U+6b63, U+6bce, U+6ce8, U+6e21, U+756a, U+76ee, U+77e5, U+7a7a, U+7b49, U+7d50, U+884c, U+88c5, U+8a18, U+8abf, U+8d77, U+901a, U+914d, U+91ce, U+9593, U+9694;
}

@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(./font-1.woff2) format('woff2');
  unicode-range: U+20, U+25, U+28-2a, U+2c-3b, U+3d-3e, U+42, U+44, U+48-49, U+4e-4f, U+52, U+54-55, U+5b, U+5d, U+61, U+63-69, U+6c-79, U+7b, U+7d, U+2014, U+3000-3001, U+3044, U+3048, U+304b-304c, U+3051-305a, U+305f-3063, U+3066-306b, U+306d-3070, U+3075-3076, U+307b-307c, U+307e, U+3081, U+3088-3089, U+308b-308c, U+3092, U+3099, U+30b3-30b4, U+30c8-30c9, U+30fc, U+4e00, U+4e2d, U+4e8c, U+4ee5, U+4f5c, U+4fe1, U+51fa, U+5206, U+5217, U+521d, U+523b, U+52d5, U+53f3, U+53f7, U+540c, U+56de, U+5b9f, U+5c4a, U+5c71, U+5ea6, U+5f37, U+5f85, U+5f8c, U+63c3, U+65ad, U+6642, U+6700, U+675f, U+679a, U+696d, U+6b21, U+6b63, U+6bce, U+6ce8, U+6e21, U+756a, U+76ee, U+77e5, U+7a7a, U+7b49, U+7d50, U+884c, U+88c5, U+8a18, U+8abf, U+8d77, U+901a, U+914d, U+91ce, U+9593, U+9694;
}
@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url(./font-2.woff2) format('woff2');
  unicode-range: U+20, U+25, U+28-2a, U+2c-3b, U+3d-3e, U+42, U+44, U+48-49, U+4e-4f, U+52, U+54-55, U+5b, U+5d, U+61, U+63-69, U+6c-79, U+7b, U+7d, U+2014, U+3000-3001, U+3044, U+3048, U+304b-304c, U+3051-305a, U+305f-3063, U+3066-306b, U+306d-3070, U+3075-3076, U+307b-307c, U+307e, U+3081, U+3088-3089, U+308b-308c, U+3092, U+3099, U+30b3-30b4, U+30c8-30c9, U+30fc, U+4e00, U+4e2d, U+4e8c, U+4ee5, U+4f5c, U+4fe1, U+51fa, U+5206, U+5217, U+521d, U+523b, U+52d5, U+53f3, U+53f7, U+540c, U+56de, U+5b9f, U+5c4a, U+5c71, U+5ea6, U+5f37, U+5f85, U+5f8c, U+63c3, U+65ad, U+6642, U+6700, U+675f, U+679a, U+696d, U+6b21, U+6b63, U+6bce, U+6ce8, U+6e21, U+756a, U+76ee, U+77e5, U+7a7a, U+7b49, U+7d50, U+884c, U+88c5, U+8a18, U+8abf, U+8d77, U+901a, U+914d, U+91ce, U+9593, U+9694;
}
@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(./font-3.woff2) format('woff2');
  unicode-range: U+20, U+25, U+28-2a, U+2c-3b, U+3d-3e, U+42, U+44, U+48-49, U+4e-4f, U+52, U+54-55, U+5b, U+5d, U+61, U+63-69, U+6c-79, U+7b, U+7d, U+2014, U+3000-3001, U+3044, U+3048, U+304b-304c, U+3051-305a, U+305f-3063, U+3066-306b, U+306d-3070, U+3075-3076, U+307b-307c, U+307e, U+3081, U+3088-3089, U+308b-308c, U+3092, U+3099, U+30b3-30b4, U+30c8-30c9, U+30fc, U+4e00, U+4e2d, U+4e8c, U+4ee5, U+4f5c, U+4fe1, U+51fa, U+5206, U+5217, U+521d, U+523b, U+52d5, U+53f3, U+53f7, U+540c, U+56de, U+5b9f, U+5c4a, U+5c71, U+5ea6, U+5f37, U+5f85, U+5f8c, U+63c3, U+65ad, U+6642, U+6700, U+675f, U+679a, U+696d, U+6b21, U+6b63, U+6bce, U+6ce8, U+6e21, U+756a, U+76ee, U+77e5, U+7a7a, U+7b49, U+7d50, U+884c, U+88c5, U+8a18, U+8abf, U+8d77, U+901a, U+914d, U+91ce, U+9593, U+9694;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(./font-4.woff2) format('woff2');
  unicode-range: U+20, U+25, U+28-2a, U+2c-3b, U+3d-3e, U+42, U+44, U+48-49, U+4e-4f, U+52, U+54-55, U+5b, U+5d, U+61, U+63-69, U+6c-79, U+7b, U+7d, U+2014, U+3000-3001, U+3044, U+3048, U+304b-304c, U+3051-305a, U+305f-3063, U+3066-306b, U+306d-3070, U+3075-3076, U+307b-307c, U+307e, U+3081, U+3088-3089, U+308b-308c, U+3092, U+3099, U+30b3-30b4, U+30c8-30c9, U+30fc, U+4e00, U+4e2d, U+4e8c, U+4ee5, U+4f5c, U+4fe1, U+51fa, U+5206, U+5217, U+521d, U+523b, U+52d5, U+53f3, U+53f7, U+540c, U+56de, U+5b9f, U+5c4a, U+5c71, U+5ea6, U+5f37, U+5f85, U+5f8c, U+63c3, U+65ad, U+6642, U+6700, U+675f, U+679a, U+696d, U+6b21, U+6b63, U+6bce, U+6ce8, U+6e21, U+756a, U+76ee, U+77e5, U+7a7a, U+7b49, U+7d50, U+884c, U+88c5, U+8a18, U+8abf, U+8d77, U+901a, U+914d, U+91ce, U+9593, U+9694;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url(./font-5.woff2) format('woff2');
  unicode-range: U+20, U+25, U+28-2a, U+2c-3b, U+3d-3e, U+42, U+44, U+48-49, U+4e-4f, U+52, U+54-55, U+5b, U+5d, U+61, U+63-69, U+6c-79, U+7b, U+7d, U+2014, U+3000-3001, U+3044, U+3048, U+304b-304c, U+3051-305a, U+305f-3063, U+3066-306b, U+306d-3070, U+3075-3076, U+307b-307c, U+307e, U+3081, U+3088-3089, U+308b-308c, U+3092, U+3099, U+30b3-30b4, U+30c8-30c9, U+30fc, U+4e00, U+4e2d, U+4e8c, U+4ee5, U+4f5c, U+4fe1, U+51fa, U+5206, U+5217, U+521d, U+523b, U+52d5, U+53f3, U+53f7, U+540c, U+56de, U+5b9f, U+5c4a, U+5c71, U+5ea6, U+5f37, U+5f85, U+5f8c, U+63c3, U+65ad, U+6642, U+6700, U+675f, U+679a, U+696d, U+6b21, U+6b63, U+6bce, U+6ce8, U+6e21, U+756a, U+76ee, U+77e5, U+7a7a, U+7b49, U+7d50, U+884c, U+88c5, U+8a18, U+8abf, U+8d77, U+901a, U+914d, U+91ce, U+9593, U+9694;
}

Notes

この構成について / About this pattern

出典を持たない自作パターン。pattern.html が版そのもので、cover.png と frontmatter の layout / type / colors はどちらもそこから機械的に測った結果。一式「研究・技術発表」の 1 枚で、架空の研究「通知の束ね配信と作業の中断」の発表として描いてある。研究・著者・所属・数値・文献はすべて架空。

A self-authored pattern. pattern.html is the artboard itself; both cover.png and the measurements in the frontmatter are derived from it. One of the nine research-talk pieces, drawn as the talk for a fictional study; the study, authors, affiliations, figures and references are all invented.

Techniques

Apply to