{
  "id": "motion:motion-callout-lines",
  "slug": "motion-callout-lines",
  "kind": "motion",
  "title": {
    "ja": "注釈線",
    "en": "Model-sheet callout lines"
  },
  "aiName": "Model-sheet callout lines",
  "summary": {
    "ja": "人物の各部から線が伸び、番号つきの拡大窓につながる",
    "en": "Lines run from points on a figure to numbered close-up windows"
  },
  "number": 62,
  "group": "lp-section",
  "techniques": [
    "scroll-progress",
    "position-sticky",
    "svg",
    "clip-path"
  ],
  "rules": [
    {
      "ja": "線の端は要素の位置から毎回測る。固定の座標で引くと、幅が変わった画面で窓から外れる",
      "en": "Measure the line ends from the elements on every draw; fixed coordinates miss the windows at other widths"
    },
    {
      "ja": "窓の拡大は同じ絵の切り抜きにする。別の絵を入れると、線の指す場所と窓の中身が食い違う",
      "en": "Each window is a crop of the same picture, so the line and the close-up always agree"
    },
    {
      "ja": "動きを減らす設定では、窓と線をすべて出した状態で止める",
      "en": "With reduced motion on, show every window and line at once and stop"
    }
  ],
  "reproduction": {
    "prompt": {
      "ja": "注釈線 — Model-sheet callout lines\n\n設定画のように、人物の全身を左に置き、右に角丸の横長の窓を 4 つ縦に積む。窓は 1 つおきに 8% 右へずらし、各窓の右に「: 01」のような等幅の番号と部位の名前を添える。区画の高さは 300vh、中の箱は 100vh の sticky にする。\n窓の中身は同じ人物の絵の一部分で、SVG の `<use>` を窓ごとの viewBox で切り抜き、`preserveAspectRatio=\"xMidYMid slice\"` で窓いっぱいに広げる。\n窓 i は --p = 0.06 + 0.18i から 0.18 の間に `clip-path: inset(0 X% 0 0)` で左から開きつつ 48px 右から寄る。その 0.08 後から、人物の上の点（絵に対する 0〜1 の座標）から窓の左端の中央まで、`pathLength=\"1\"` の線を `stroke-dashoffset` で引く。点には差し色の丸を置く。線の両端は描くたびに要素の位置から測り直す。\nCSS と素の JavaScript だけで実装し、ライブラリは使わない。\n\n外すと崩れる点:\n- 線の端は要素の位置から毎回測る。固定の座標で引くと、幅が変わった画面で窓から外れる\n- 窓の拡大は同じ絵の切り抜きにする。別の絵を入れると、線の指す場所と窓の中身が食い違う\n- 動きを減らす設定では、窓と線をすべて出した状態で止める\n\n動く実物（1 ファイルで完結する HTML）: https://design-vault.pages.dev/designs/motion-callout-lines/demo.html",
      "en": "Model-sheet callout lines — Model-sheet callout lines\n\nLike a model sheet, put the full figure on the left and stack four wide rounded windows on the right, every other one shifted 8% to the right, each with a monospaced number such as \": 01\" and the part's name beside it. Make the section 300vh tall and the box inside a 100vh sticky element.\nEach window shows part of the same figure: an SVG `<use>` cropped by the window's own viewBox and stretched to fill it with `preserveAspectRatio=\"xMidYMid slice\"`.\nWindow i opens from the left with `clip-path: inset(0 X% 0 0)` and slides in 48px from the right while --p goes from 0.06 + 0.18i over 0.18. Starting 0.08 later, draw a `pathLength=\"1\"` line with `stroke-dashoffset` from a point on the figure (0–1 coordinates of the picture) to the middle of the window's left edge, with an accent dot at the point. Re-measure both ends from the elements on every draw.\nImplement with CSS and plain JavaScript only; do not use a library.\n\nDo not drop:\n- Measure the line ends from the elements on every draw; fixed coordinates miss the windows at other widths\n- Each window is a crop of the same picture, so the line and the close-up always agree\n- With reduced motion on, show every window and line at once and stop\n\nA working example (one self-contained HTML file): https://design-vault.pages.dev/designs/motion-callout-lines/demo.html"
    },
    "code": {
      "url": "https://design-vault.pages.dev/designs/motion-callout-lines/demo.html",
      "html": "<!doctype html>\n<html lang=\"ja\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>62 注釈線 — Model-sheet callout lines</title>\n<style>\n/* dv-motion-base:start */\n:root {\n  --ground: #FFFFFF;\n  --surface: #F3F5F8;\n  --ink: #14181F;\n  --muted: #5A6472;\n  --accent: #1F5FA8;\n  --rule: #D8DDE4;\n  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--ground));\n  --accent-mid: color-mix(in srgb, var(--accent) 45%, var(--ground));\n  --shade: color-mix(in srgb, var(--ink) 14%, transparent);\n\n  --font: \"Zen Kaku Gothic New\", \"Hiragino Sans\", \"Noto Sans JP\", \"Yu Gothic\", system-ui, sans-serif;\n  --mono: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n\n  --t-label: 13px;\n  --t-body: 16px;\n  --t-lead: 20px;\n  --t-h2: 32px;\n  --t-h1: clamp(40px, 7vw, 72px);\n\n  --s1: 4px;\n  --s2: 8px;\n  --s3: 16px;\n  --s4: 24px;\n  --s5: 40px;\n  --s6: 64px;\n  --s7: 104px;\n\n  --radius: 12px;\n  --ease: cubic-bezier(.2, .7, .2, 1);\n  --dur: .7s;\n  --measure: 1080px;\n}\n*, *::before, *::after { box-sizing: border-box; }\nhtml { -webkit-text-size-adjust: 100%; }\nbody {\n  margin: 0;\n  background: var(--ground);\n  color: var(--ink);\n  font-family: var(--font);\n  font-size: var(--t-body);\n  line-height: 1.7;\n  font-feature-settings: \"palt\";\n  overflow-x: hidden;\n}\nh1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }\nul, ol { list-style: none; }\n.dv-wrap { width: min(100% - 2 * var(--s4), var(--measure)); margin-inline: auto; }\n.dv-label {\n  min-height: 72vh;\n  display: grid;\n  align-content: center;\n  gap: var(--s3);\n  padding-block: var(--s6);\n  border-bottom: 1px solid var(--rule);\n}\n.dv-num { font-family: var(--mono); font-size: var(--t-lead); font-weight: 700; color: var(--accent); letter-spacing: .04em; }\n.dv-name { font-size: var(--t-h1); font-weight: 700; line-height: 1.15; letter-spacing: .01em; }\n.dv-ai { font-family: var(--mono); font-size: var(--t-lead); color: var(--muted); }\n.dv-desc { font-size: var(--t-lead); color: var(--ink); }\n.dv-hint { font-size: var(--t-label); color: var(--muted); letter-spacing: .12em; margin-top: var(--s4); }\n.dv-stage { padding-block: var(--s7); }\n.dv-h2 { font-size: var(--t-h2); font-weight: 700; line-height: 1.3; }\n.dv-lead { font-size: var(--t-lead); color: var(--muted); }\n.dv-eyebrow { font-family: var(--mono); font-size: var(--t-label); color: var(--accent); letter-spacing: .12em; text-transform: uppercase; }\n.dv-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s4); }\n.dv-ph {\n  border-radius: var(--radius);\n  background: linear-gradient(135deg, var(--accent-soft), var(--accent-mid) 60%, var(--accent));\n  aspect-ratio: 16 / 9;\n}\n.dv-ph--alt { background: linear-gradient(200deg, var(--surface), var(--accent-soft) 55%, var(--accent-mid)); }\n.dv-ph--ink { background: linear-gradient(160deg, var(--ink), color-mix(in srgb, var(--ink) 55%, var(--accent))); }\n.dv-end {\n  min-height: 60vh;\n  display: grid;\n  place-items: center;\n  border-top: 1px solid var(--rule);\n  color: var(--muted);\n  font-family: var(--mono);\n  font-size: var(--t-label);\n  letter-spacing: .12em;\n}\n/* dv-motion-base:end */\n\n/* ---- この演出だけの CSS。色は var(--…) か color-mix() のみ ---- */\n.f-ink { fill: var(--ink); }\n.f-face { fill: var(--surface); }\n.f-accent { fill: var(--accent); }\n.f-arm { stroke: var(--ink); stroke-width: 30; stroke-linecap: round; fill: none; }\n.cl-zone { height: 300vh; }\n.cl-box {\n  position: sticky; top: 0; height: 100vh; display: grid; align-items: center;\n  grid-template-columns: minmax(0, .7fr) minmax(0, 1.6fr); gap: var(--s5); overflow: clip;\n}\n.cl-fig { height: 86vh; width: 34.4vh; max-width: 100%; justify-self: center; }\n.cl-fig svg { width: 100%; height: 100%; display: block; }\n.cl-list { display: grid; gap: var(--s4); }\n.cl-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s4); }\n.cl-item:nth-child(even) { margin-left: 8%; }\n.cl-win {\n  height: clamp(64px, 15vh, 150px); border-radius: var(--radius); overflow: hidden;\n  background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink);\n}\n.cl-win svg { width: 100%; height: 100%; display: block; }\n.cl-tag { font-family: var(--mono); line-height: 1.1; }\n.cl-no { font-size: var(--t-h2); font-weight: 700; color: var(--accent); }\n.cl-name { font-family: var(--font); font-size: var(--t-lead); font-weight: 700; }\n.cl-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }\n.cl-lines path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--t, 0)); }\n.cl-lines circle { fill: var(--accent); stroke: var(--ink); stroke-width: 2; opacity: var(--t, 0); }\n.js .cl-item { opacity: var(--o, 0); }\n.js .cl-win { clip-path: inset(0 calc((1 - var(--s, 0)) * 100%) 0 0 round var(--radius)); transform: translateX(calc((1 - var(--s, 0)) * 48px)); }\n.cl-box { position: sticky; }\n@media (max-width: 600px) {\n  .cl-box { grid-template-columns: minmax(0, .55fr) minmax(0, 1.45fr); gap: var(--s3); }\n  .cl-item { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }\n  .cl-item:nth-child(even) { margin-left: 0; }\n  .cl-list { gap: var(--s3); }\n  .cl-win { height: 10vh; }\n  .cl-no { font-size: var(--t-lead); }\n  .cl-name { font-size: var(--t-body); }\n  .cl-fig { height: 70vh; width: 28vh; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .js .cl-item { opacity: 1; }\n  .js .cl-win { clip-path: none; transform: none; }\n}\n</style>\n</head>\n<body data-motion-number=\"62\">\n<header class=\"dv-label\">\n  <div class=\"dv-wrap\">\n    <p class=\"dv-num\">62</p>\n    <h1 class=\"dv-name\">注釈線</h1>\n    <p class=\"dv-ai\">Model-sheet callout lines</p>\n    <p class=\"dv-desc\">人物の各部から線が伸び、番号つきの拡大窓につながる</p>\n    <p class=\"dv-hint\">SCROLL ↓</p>\n  </div>\n</header>\n\n<svg width=\"0\" height=\"0\" style=\"position: absolute\" aria-hidden=\"true\">\n  <symbol id=\"fig-front\" viewBox=\"0 0 400 1000\">\n    <path class=\"f-ink\" d=\"M128 120 Q120 40 200 34 Q280 40 272 120 L292 430 L108 430 Z\"/>\n    <rect class=\"f-ink\" x=\"182\" y=\"210\" width=\"36\" height=\"50\"/>\n    <ellipse class=\"f-face\" cx=\"200\" cy=\"150\" rx=\"60\" ry=\"72\"/>\n    <path class=\"f-ink\" d=\"M140 118 Q200 60 262 118 L262 96 Q200 40 138 96 Z\"/>\n    <ellipse class=\"f-ink\" cx=\"176\" cy=\"158\" rx=\"7\" ry=\"11\"/><ellipse class=\"f-ink\" cx=\"224\" cy=\"158\" rx=\"7\" ry=\"11\"/>\n    <path class=\"f-accent\" d=\"M232 70 l40 -26 l6 36 Z M232 70 l-6 -40 l40 16 Z\"/>\n    <path class=\"f-ink\" d=\"M128 252 L272 252 L240 520 L160 520 Z\"/>\n    <path class=\"f-accent\" d=\"M160 520 L240 520 L296 712 L104 712 Z\"/>\n    <rect class=\"f-ink\" x=\"158\" y=\"712\" width=\"30\" height=\"236\"/><rect class=\"f-ink\" x=\"212\" y=\"712\" width=\"30\" height=\"236\"/>\n    <ellipse class=\"f-ink\" cx=\"170\" cy=\"956\" rx=\"30\" ry=\"16\"/><ellipse class=\"f-ink\" cx=\"230\" cy=\"956\" rx=\"30\" ry=\"16\"/>\n    <path class=\"f-arm\" d=\"M136 262 L104 516\"/><path class=\"f-arm\" d=\"M264 262 L300 496\"/>\n    <rect class=\"f-accent\" x=\"282\" y=\"478\" width=\"42\" height=\"58\" rx=\"6\"/>\n  </symbol>\n</svg>\n<main class=\"dv-stage\">\n  <div class=\"dv-wrap\">\n    <section class=\"cl-zone\" data-progress=\"pin\">\n      <div class=\"cl-box\">\n        <div class=\"cl-fig\"><svg viewBox=\"0 0 400 1000\" role=\"img\" aria-label=\"代役の人物\"><use href=\"#fig-front\"/></svg></div>\n        <ol class=\"cl-list\">\n          <li class=\"cl-item\">\n            <div class=\"cl-win\"><svg viewBox=\"216 26 72 64\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\"><use href=\"#fig-front\" width=\"400\" height=\"1000\"/></svg></div>\n            <p class=\"cl-tag\"><span class=\"cl-no\">: 01</span><br><span class=\"cl-name\">髪飾り</span></p>\n          </li>\n          <li class=\"cl-item\">\n            <div class=\"cl-win\"><svg viewBox=\"150 128 100 60\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\"><use href=\"#fig-front\" width=\"400\" height=\"1000\"/></svg></div>\n            <p class=\"cl-tag\"><span class=\"cl-no\">: 02</span><br><span class=\"cl-name\">目元</span></p>\n          </li>\n          <li class=\"cl-item\">\n            <div class=\"cl-win\"><svg viewBox=\"270 470 66 74\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\"><use href=\"#fig-front\" width=\"400\" height=\"1000\"/></svg></div>\n            <p class=\"cl-tag\"><span class=\"cl-no\">: 03</span><br><span class=\"cl-name\">持ち物</span></p>\n          </li>\n          <li class=\"cl-item\">\n            <div class=\"cl-win\"><svg viewBox=\"128 930 144 46\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\"><use href=\"#fig-front\" width=\"400\" height=\"1000\"/></svg></div>\n            <p class=\"cl-tag\"><span class=\"cl-no\">: 04</span><br><span class=\"cl-name\">靴</span></p>\n          </li>\n        </ol>\n        <svg class=\"cl-lines\" aria-hidden=\"true\"></svg>\n      </div>\n    </section>\n  </div>\n</main>\n\n<footer class=\"dv-end\">END — 62 注釈線</footer>\n\n<script>\n/* dv-motion-helpers:start */\nconst dvReduce = matchMedia('(prefers-reduced-motion: reduce)').matches;\ndocument.documentElement.classList.add('js');\n\n/**\n * 画面に入った要素へ .is-in を付ける。\n * data-reveal=\"repeat\" の要素は画面を出たら外す（何度でも再生）。\n */\nfunction dvReveal(selector = '[data-reveal]', { threshold = 0.2, rootMargin = '0px 0px -8% 0px' } = {}) {\n  const els = [...document.querySelectorAll(selector)];\n  if (dvReduce || !('IntersectionObserver' in window)) {\n    els.forEach((el) => el.classList.add('is-in'));\n    return;\n  }\n  const io = new IntersectionObserver((entries) => {\n    for (const e of entries) {\n      if (e.isIntersecting) {\n        e.target.classList.add('is-in');\n        if (e.target.dataset.reveal !== 'repeat') io.unobserve(e.target);\n      } else if (e.target.dataset.reveal === 'repeat') {\n        e.target.classList.remove('is-in');\n      }\n    }\n  }, { threshold, rootMargin });\n  els.forEach((el) => io.observe(el));\n}\n\n/**\n * スクロール量を 0〜1 にして、各 [data-progress] 要素の CSS 変数 --p に書く。\n *   data-progress=\"through\" : 要素の上端が画面の下端に来たとき 0、下端が画面の上端を抜けたとき 1\n *   data-progress=\"pin\"     : 要素の上端が画面の上端に来たとき 0、下端が画面の下端に来たとき 1\n *                             （中に position: sticky の箱を持つ、背の高い区画用）\n *   data-progress=\"page\"    : ページ全体のスクロール量\n * onUpdate(el, p) を渡すと、値が変わるたびに呼ばれる。\n */\nfunction dvProgress(onUpdate) {\n  const els = [...document.querySelectorAll('[data-progress]')];\n  const clamp = (n) => Math.min(1, Math.max(0, n));\n  let queued = false;\n  const measure = () => {\n    queued = false;\n    const vh = window.innerHeight;\n    for (const el of els) {\n      const r = el.getBoundingClientRect();\n      let p;\n      if (el.dataset.progress === 'pin') p = r.height > vh ? -r.top / (r.height - vh) : 0;\n      else if (el.dataset.progress === 'page') {\n        const max = document.documentElement.scrollHeight - vh;\n        p = max > 0 ? window.scrollY / max : 0;\n      } else p = (vh - r.top) / (vh + r.height);\n      p = clamp(p);\n      el.style.setProperty('--p', p.toFixed(4));\n      if (onUpdate) onUpdate(el, p);\n    }\n  };\n  const request = () => {\n    if (!queued) { queued = true; requestAnimationFrame(measure); }\n  };\n  addEventListener('scroll', request, { passive: true });\n  addEventListener('resize', request);\n  measure();\n}\n/* dv-motion-helpers:end */\n\n/* ---- この演出だけの JS ---- */\n// 設定画の注釈。窓が 1 つずつ入り、人物の上の点から窓へ線が引かれる。線の両端は描くたびに測り直す。\nconst POINTS = [[0.63, 0.06], [0.5, 0.158], [0.76, 0.507], [0.43, 0.956]]; // 人物の絵の上の点（0〜1）\nconst box = document.querySelector('.cl-box'), figEl = box.querySelector('.cl-fig svg');\nconst items = [...box.querySelectorAll('.cl-item')], lines = box.querySelector('.cl-lines');\nconst NS = 'http://www.w3.org/2000/svg';\nconst parts = items.map(() => {\n  const g = document.createElementNS(NS, 'g'), path = document.createElementNS(NS, 'path'), dot = document.createElementNS(NS, 'circle');\n  path.setAttribute('pathLength', '1'); dot.setAttribute('r', '6');\n  g.append(path, dot); lines.appendChild(g);\n  return g;\n});\nconst clamp = (n) => Math.min(1, Math.max(0, n));\nconst ease = (t) => 1 - Math.pow(1 - t, 3);\ndvProgress((el, p) => {\n  const b = box.getBoundingClientRect(), f = figEl.getBoundingClientRect();\n  lines.setAttribute('viewBox', `0 0 ${b.width} ${b.height}`);\n  items.forEach((item, i) => {\n    // 窓 i は p = 0.06 + 0.18i から入り、線はその少し後から引かれる。最後の窓も p = 0.9 までに揃う。\n    const a = 0.06 + i * 0.18;\n    const s = dvReduce ? 1 : ease(clamp((p - a) / 0.18));\n    const t = dvReduce ? 1 : clamp((p - a - 0.08) / 0.18);\n    item.style.setProperty('--o', s > 0 ? 1 : 0);\n    item.style.setProperty('--s', s.toFixed(4));\n    const w = item.querySelector('.cl-win').getBoundingClientRect();\n    // 人物の絵は箱の中に縦横比を保って収まる（meet）ので、描かれた範囲を出してから点を置く。\n    const k = Math.min(f.width / 400, f.height / 1000), dx = (f.width - 400 * k) / 2, dy = (f.height - 1000 * k) / 2;\n    const x1 = f.left - b.left + dx + POINTS[i][0] * 400 * k, y1 = f.top - b.top + dy + POINTS[i][1] * 1000 * k;\n    const x2 = w.left - b.left, y2 = w.top - b.top + w.height / 2;\n    const [path, dot] = parts[i].children;\n    path.setAttribute('d', `M${x1.toFixed(1)} ${y1.toFixed(1)} L${x2.toFixed(1)} ${y2.toFixed(1)}`);\n    dot.setAttribute('cx', x1.toFixed(1)); dot.setAttribute('cy', y1.toFixed(1));\n    parts[i].style.setProperty('--t', t.toFixed(4));\n  });\n});\n</script>\n</body>\n</html>\n"
    }
  },
  "license": "Original",
  "catalogVersion": 1,
  "designSchemaVersion": 2,
  "capabilities": [
    "live-preview",
    "copy-prompt",
    "get-code"
  ],
  "reusePolicy": "construction-reuse",
  "urls": {
    "ja": "https://design-vault.pages.dev/designs/motion-callout-lines",
    "en": "https://design-vault.pages.dev/en/designs/motion-callout-lines",
    "json": "https://design-vault.pages.dev/ai/assets/motion-callout-lines.json",
    "designJson": null
  }
}