スクロールで 1 字ずつ薄い灰から黒へ濃くなる紹介文(文字帯とコラージュを伴う)
yh-scroll-copy ・ v1.0.0 ・ 文字組み ・ 2 節 ・ 吸収元:線と間(SEN TO MA・旧名 余白の住まい)(2b44882)
中央に置いた大きな紹介文(PC 35px・行高 1.5)の文字を書記素ごとの span にし、位置は動かさずに opacity だけを 0.2→1 へ順に変える。進み p は「文の上端より 100px 上の点が画面の高さ 75% に来たとき」から「100px 下の点が 25% に来たとき」まで(p = (100 + 0.75H − top) / (200 + 0.5H))。i 字目は q = clamp((p(N+5) − i)/6) で、6 字ぶんが同時に濃くなりながら左上から右下へ進む。追従は 180ms の指数の減速(rAF・実際の経過時間)で、逆にスクロールすると同じ濃さへ戻る。同じモジュールで、上の文字帯(6 語を 2 組並べ、1 組ぶんを 80 秒で等速に流す。スクロールの速さに応じて 3〜7 倍へ 0.33 秒で加速)と、下のコラージュ(幅 120vw・5 枚、マウスと逆向きに最大 40px、離すと弾んで 0 へ)も動く。
ライブデモは APPROVED の版から写したコード(library/typography/yh-scroll-copy/src)をこの場で動かしている。動き:オフは見本の決まり(html.reduced)で止めた形。
記録
吸収元との比較
一致 (止めた状態 1% 以下・動きの各コマ 3% 以下・誤りなし)
| 幅 | 止めた状態の差 | 動きのコマ(時刻:差) | やり直し |
|---|---|---|---|
| 390px | 0.00% | 0ms 0.00% / 100ms 0.00% / 200ms 0.00% / 300ms 0.00% / 450ms 0.00% / 700ms 0.00% / 1000ms 0.00% / 1350ms 0.00% / 1450ms 0.00% / 1600ms 0.00% / 1900ms 0.00% / 2300ms 0.00% / 2450ms 0.00% / 2550ms 0.00% / 2700ms 0.00% / 3000ms 0.00% / 3350ms 0.00% / 3450ms 0.00% / 3550ms 0.00% / 3700ms 0.00% | 0 |
| 1440px | 0.00% | 0ms 0.00% / 100ms 0.00% / 200ms 0.00% / 300ms 0.00% / 450ms 0.00% / 700ms 0.00% / 1000ms 0.00% / 1350ms 0.00% / 1450ms 0.00% / 1600ms 0.00% / 1900ms 0.00% / 2300ms 0.00% / 2450ms 0.00% / 2550ms 0.00% / 2700ms 0.00% / 3000ms 0.00% / 3350ms 0.00% / 3450ms 0.00% / 3550ms 0.00% / 3700ms 0.00% | 0 |
比べた日時 2026-12-05 08:46(UTC)。吸収元 /shindan/mihon/yohaku と LAB のデモを、節を同じ高さに置き、時計を止めて同じ時刻に撮った。文字は両方ともグレーの描き方。
出所
- 見本
- 線と間(SEN TO MA・旧名 余白の住まい) APPROVED
- 版
- 2b4488256376a115b6c03164f58ad4bd4d7d706b
- ページ
- /shindan/mihon/yohaku
- 写した要素
- .yh-home-intro || .yh-keywords || .yh-collage || .yh-intro-layers || .yh-skip-intro
- 元のファイル
- src/scripts/yohaku/home.ts
- src/scripts/yohaku/common.ts(64〜78 行の文字入替だけを入口に原文のまま写した)
- src/styles/yohaku/base.css
- src/styles/yohaku/home.css
- src/components/yohaku/ScrollCopy.astro(書記素ごとの span。マークアップはサーバーの HTML から)
- src/pages/shindan/mihon/yohaku/index.astro・src/components/yohaku/Photo.astro(同上)
- src/layouts/Yohaku.astro(器。字体・base.css・html.reduced を付ける inline・common.ts)
- 指示書
- prompts/yohaku.md
- 写したモジュール
- 吸収元と同じ中身(blob で照合)
権利と書き出し
- コード
- 便利DEネットの自社制作(見本サイトのために書いたコード。ライブラリーを使わない素の TypeScript)
- 字体
- OFL(fontsource のパッケージから読む。字体ファイルは持ち込まない)
- 素材
- 架空の住宅会社の見本のために生成した写真 5 枚(コラージュ。T01 は架空の人物)。実在の人物・会社・実績ではない
- 参考
- 参考サイト (参考サイト) の画面構造・数値(文字の濃さとスクロールの連動・120vw のコラージュ・最大 40px など)を文章に書き起こした指示書で作った版(事業者が 2026-12-01 18:57 に『あまりにも酷似』と述べた、独自性の作り替えの前の版)。参考の写真・文章・字体・コードは持ち込んでいない
- 書き出し
- code-restyle(コード 可・素材 不可・文 不可)
- 紹介文・文字帯の語・写真は案件のものに差し替える(見本は架空の会社。文は書記素ごとの span[data-yh-glyph] に分けて置く)
- 参考サイトの完全再現として作った版なので、色・字体・寸法(35px・幅 70%・120vw・23vw)は案件のアートディレクションで決め直し、濃さの計算(開始と終了の位置・6 字の幅・180ms の追従)の仕組みだけを使う
- home.ts は冒頭の組み立て演出・文字帯・紹介文・コラージュを 1 つのモジュールで初期化し、要素を決め打ちで探す。紹介文だけを使う案件では、モジュールを分ける必要がある(このままでは文字帯・コラージュ・冒頭の器がないと例外になる)
変えてよいところ
- 文:p[data-yh-reveal] の中に、読み上げ用の全文 .yh-sr と、aria-hidden の span の中に 1 書記素ずつの span[data-yh-glyph](改行は br)。ページ内の [data-yh-reveal] はいくつでも
- 大きさ:.yh-home-intro .yh-reveal の font-size:35px・line-height:1.5・max-width:min(1000px,70%)、1024px 以下 24px、767px 以下 clamp(16px,5.4vw,21px)
- 文字帯の語:.yh-key-group の span(2 組とも同じ語。2 組目は aria-hidden)。偶数の語は明朝 800
- コラージュ:.yh-collage-track の picture(5 枚)、.yh-collage-offset の width:120vw(767px 以下 150vw)、偶数の写真は 3:4
- 色:.yh の --ink(濃くなった字)・--paper(地)・--muted(文字帯の罫線)。薄い字は opacity 0.2 なので色は --ink のまま
変えてはいけないところ
- 文字の位置は動かさない。opacity だけを 0.2→1 へ、書記素の順に変える(ランダムにしない)
- p = clamp((100 + 0.75H − top) / (200 + 0.5H))、i 字目の q = clamp((p(N+5) − i)/6)、opacity = 0.2 + 0.8q
- 追従は 1 − exp(−dt/180)(dt は実際の経過時間で 80ms まで)。逆にスクロールすると同じ濃さに戻る。画面から 100px 以上外れたら追従せずに合わせる
- 動き:オフ(html.reduced)では全文 opacity 1
- 文字帯は 1 組ぶんを 80 秒で等速。スクロールの速さ v が 12px/秒を超えると 3 + min(v/800, 4) 倍へ 0.33 秒で近づき、120ms スクロールがなければ 1 倍へ戻る。画面の外・一時停止・フォーカスが中にある・タブが隠れている間は止める
- コラージュはマウスだけ:目標 −40 × x(x は −1〜1)px を 0.6 秒、離すと 0.8 秒の弾む戻り。タッチと動き:オフでは動かさない。横にはみ出す 120vw の器と、動かす要素を分ける
組み合わせ・品質
- 業種
- 住宅・リフォーム・建築・設計・企業・宿泊・おもてなし・美容・サロン・業種を問わない
- AD
- ad-yohaku
- 合う
- 写真の大きなページの、写真と写真の間の短い紹介文(3〜5 行)/余白の多い、文字の少ないページ/yh-white-menu(同じ器の common.ts。PC の Lenis もそちらが作る)
- 避ける
- 長い本文(読み終える前に濃くならない字が残る)/同じ画面に濃さの変わる文を 3 つ以上並べる
- 注意
- html・.yh・.yh * に効く初期化の規則(base.css)と、body の class="yh"・html の data-mihon="yohaku" に置いた変数を含む。ほかの技術と 1 枚のページに組むときは、初期化の規則が 1 組になるようにするか、iframe で分ける。吸収元では器の common.ts が PC で Lenis(duration 1.5)を作るが、この技術の入口は作らない(濃さは getBoundingClientRect を読むだけなので、Lenis の有無で計算は変わらない)
- 依存
- @fontsource-variable/noto-sans-jp 5.3.1@fontsource/shippori-mincho 5.3.0(800。文字帯の偶数の語)@fontsource-variable/geist 5.3.0(器が読む。この節では使わない)
- 速さ
- コラージュの写真 5 枚(各 5〜7 幅の webp・srcset・sizes=(max-width:767px) 40vw,23vw・loading=lazy)/文字ごとの opacity(値が変わったときだけ書く)、文字帯の translate3d、コラージュの transform(CSS の遷移)/濃さの rAF は動いている間だけ回し、止まったら次のスクロールまで止める。文字帯の幅は ResizeObserver で測り直す。素材は 29 ファイル
- レスポンシブ
- 1024px(紹介文 24px・幅 90%)/767px(紹介文 clamp(16px,5.4vw,21px)・行高 1.7、上下 64px、文字帯の高さ 55px・1 組 680px、コラージュ 150vw)
- アクセシビリティ
- 紹介文は読み上げ用の全文 1 つ(.yh-sr)と、aria-hidden の 1 字ずつの span。文字帯の 2 組目は aria-hidden。一時停止のボタンは aria-pressed と aria-label(文字帯を一時停止/再生)が替わる/.yh :focus-visible に 2px の線。文字帯の中にフォーカスがある間は止まる/薄い字は opacity 0.2(地との差が小さい)だが、読み上げ用の全文は常にある。スクロールすると濃くなる
- 動きを減らす
- home.ts は html.reduced だけを見る(吸収元の still())。見本の決まり(2026-11-30 事業者の指示)はサイトの「動き:オフ」のときだけ止めること。ただし承認の版 2b44882 の器(Yohaku.astro の head の inline と common.ts の mode())は、OS の「動きを減らす」でも html.reduced を付ける。LAB のデモは ?motion=off のときだけ html.reduced を付ける(器の OS の判定は写していない)/紹介文は全文 opacity 1。文字帯は止まって並び、一時停止のボタンは隠れる。コラージュは動かない。冒頭の演出はしない
- 素材
- 29 ファイル(案件には書き出さない)
抽出の注意
- 原文と対応づけられず CSSOM の文で写した:.yh-collage .yh-photo:nth-child(2n)
ソース
/**
* 技術 yh-scroll-copy の入口(ライブデモ・案件の組み立てから mount を呼ぶ)
* 吸収元:線と間(SEN TO MA・APPROVED 2b44882)のトップ /shindan/mihon/yohaku。
* 吸収元のページは、器 layouts/Yohaku.astro が字体と base.css を読み、ページ index.astro が home.css と scripts/yohaku/home.ts を読む。
* スクリプトの実行の順は home.ts → 器の common.ts(ページの HTML で確かめた)。
* ・home.ts は「読み込んだ時点で要素を探して動かす」作り(関数を書き出さない)。この入口を読み込んだ時点で動き出す。
* ・home.ts は 1 つのモジュールで、冒頭の組み立て演出・文字帯(.yh-keywords)・紹介文の濃さ([data-yh-reveal])・コラージュ(.yh-collage)を
* まとめて初期化し、要素を「!」で決め打ちで探す。そのため文字帯・コラージュと、冒頭の演出の器(.yh-intro-layers・.yh-skip-intro)も
* マークアップに含めている(ないと読み込みで例外になる)。冒頭の演出は html.yh-prepare(トップの head の inline が付ける)がないと走らない。
* ・器の common.ts のうち、この節に効くのは文字入替(「私たちについて」の [data-roll])だけなので、その部分(common.ts 64〜78 行)を
* 下に原文のまま写した(ヘッダー・メニュー・Lenis は技術 yh-white-menu)。吸収元と同じく home.ts の後に動く。
* 写したモジュール(js/home.ts)は書き換えていない。
*/
import '@fontsource-variable/noto-sans-jp';
import '@fontsource-variable/geist';
import '@fontsource/shippori-mincho/800.css';
import './style.css';
import './js/home';
export const id = 'yh-scroll-copy';
// ---- ここから吸収元の scripts/yohaku/common.ts 64〜78 行(文字入替の組み立て)を原文のまま
export function graphemes(text:string):string[] {
if ('Segmenter' in Intl) return Array.from(new Intl.Segmenter('ja',{granularity:'grapheme'}).segment(text),x=>x.segment);
return Array.from(text);
}
document.querySelectorAll<HTMLElement>('[data-roll]').forEach(el=>{
const label=el.textContent?.trim()||'';
if(!label) return;
const spoken=document.createElement('span'); spoken.className='yh-sr'; spoken.textContent=label;
const row=document.createElement('span'); row.className='yh-roll'; row.setAttribute('aria-hidden','true');
graphemes(label).forEach((ch,i)=>{
const wrapper=document.createElement('i'); wrapper.dataset.echo=ch;wrapper.style.setProperty('--i',String(i));
const letter=document.createElement('span');letter.textContent=ch;wrapper.append(letter);row.append(wrapper);
});
el.replaceChildren(spoken,row);
});
// ---- ここまで
/**
* 吸収元はページを離れるとき(pagehide・persisted=false)に自分で片付ける:冒頭の演出を終える・文字帯と濃さの rAF を取り消す・
* AbortController でスクロール・resize・ポインターの受け口を外す・ResizeObserver と IntersectionObserver を切る。
* 後片付けでは、その pagehide を合成して送り、吸収元の片付けをそのまま呼ぶ(モジュールは 1 ページに 1 回だけ動く。
* 同じページのほかの吸収元のモジュールも一緒に片付く)。文字に書いた opacity と文字入替の中身は元に戻らない。
*/
export function mount(): () => void {
let done = false;
return () => {
if (done) return;
done = true;
window.dispatchEvent(new PageTransitionEvent('pagehide', { persisted: false }));
};
}
<main id="main">
<section class="yh-home-hero" aria-labelledby="yh-name"><div class="yh-stage"><div class="yh-intro-layers" aria-hidden="true"></div></div><button class="yh-skip-intro" type="button" hidden="">演出をスキップ</button></section>
<div class="yh-keywords"><div class="yh-key-window"><div class="yh-key-track"><div class="yh-key-group"><span>自然光</span><span>木の質感</span><span>石の表情</span><span>心地よい動線</span><span>造作家具</span><span>住まいを継ぐ</span></div><div class="yh-key-group" aria-hidden="true"><span>自然光</span><span>木の質感</span><span>石の表情</span><span>心地よい動線</span><span>造作家具</span><span>住まいを継ぐ</span></div></div></div><button class="yh-key-pause" type="button" aria-label="文字帯を一時停止" aria-pressed="false">Ⅱ</button></div>
<section class="yh-home-intro" aria-label="住まいの考え方"><p class="yh-reveal" data-yh-reveal=""><span class="yh-sr">住まいを整えることは、暮らしの時間を整えること。光、素材、動線を丁寧につなぎ、毎日に、心地よい余白をつくります。</span><span aria-hidden="true"><span data-yh-glyph="">住</span><span data-yh-glyph="">ま</span><span data-yh-glyph="">い</span><span data-yh-glyph="">を</span><span data-yh-glyph="">整</span><span data-yh-glyph="">え</span><span data-yh-glyph="">る</span><span data-yh-glyph="">こ</span><span data-yh-glyph="">と</span><span data-yh-glyph="">は</span><span data-yh-glyph="">、</span><br><span data-yh-glyph="">暮</span><span data-yh-glyph="">ら</span><span data-yh-glyph="">し</span><span data-yh-glyph="">の</span><span data-yh-glyph="">時</span><span data-yh-glyph="">間</span><span data-yh-glyph="">を</span><span data-yh-glyph="">整</span><span data-yh-glyph="">え</span><span data-yh-glyph="">る</span><span data-yh-glyph="">こ</span><span data-yh-glyph="">と</span><span data-yh-glyph="">。</span><br><span data-yh-glyph="">光</span><span data-yh-glyph="">、</span><span data-yh-glyph="">素</span><span data-yh-glyph="">材</span><span data-yh-glyph="">、</span><span data-yh-glyph="">動</span><span data-yh-glyph="">線</span><span data-yh-glyph="">を</span><span data-yh-glyph="">丁</span><span data-yh-glyph="">寧</span><span data-yh-glyph="">に</span><span data-yh-glyph="">つ</span><span data-yh-glyph="">な</span><span data-yh-glyph="">ぎ</span><span data-yh-glyph="">、</span><br><span data-yh-glyph="">毎</span><span data-yh-glyph="">日</span><span data-yh-glyph="">に</span><span data-yh-glyph="">、</span><span data-yh-glyph="">心</span><span data-yh-glyph="">地</span><span data-yh-glyph="">よ</span><span data-yh-glyph="">い</span><span data-yh-glyph="">余</span><span data-yh-glyph="">白</span><span data-yh-glyph="">を</span><span data-yh-glyph="">つ</span><span data-yh-glyph="">く</span><span data-yh-glyph="">り</span><span data-yh-glyph="">ま</span><span data-yh-glyph="">す</span><span data-yh-glyph="">。</span></span></p><a class="yh-pill" href="/shindan/mihon/yohaku/studio" data-roll="">私たちについて</a></section>
<div class="yh-collage"><div class="yh-collage-offset"><div class="yh-collage-track"><picture class="yh-photo" style="--focus:44% 54%;--mobile-focus:44% 54%"><img src="{{asset:C01-1920.webp}}" srcset="{{asset:C01-640.webp}} 640w, {{asset:C01-960.webp}} 960w, {{asset:C01-1440.webp}} 1440w, {{asset:C01-1498.webp}} 1498w, {{asset:C01-1920.webp}} 1920w" sizes="(max-width:767px) 40vw,23vw" width="1920" height="1313" alt="木のテーブルを囲む相談室" loading="lazy" decoding="async"></picture><picture class="yh-photo" style="--focus:50% 48%;--mobile-focus:50% 50%"><img src="{{asset:W06-H-2560.webp}}" srcset="{{asset:W06-H-640.webp}} 640w, {{asset:W06-H-960.webp}} 960w, {{asset:W06-H-1440.webp}} 1440w, {{asset:W06-H-1672.webp}} 1672w, {{asset:W06-H-1920.webp}} 1920w, {{asset:W06-H-2560.webp}} 2560w" sizes="(max-width:767px) 40vw,23vw" width="2560" height="1440" alt="杉の床と古い梁の向こうにのぞく庭" loading="lazy" decoding="async"></picture><picture class="yh-photo" style="--focus:50% 50%;--mobile-focus:50% 50%"><img src="{{asset:W01-D4-1920.webp}}" srcset="{{asset:W01-D4-640.webp}} 640w, {{asset:W01-D4-960.webp}} 960w, {{asset:W01-D4-1440.webp}} 1440w, {{asset:W01-D4-1536.webp}} 1536w, {{asset:W01-D4-1920.webp}} 1920w" sizes="(max-width:767px) 40vw,23vw" width="1920" height="1280" alt="光が入るオークのダイニング" loading="lazy" decoding="async"></picture><picture class="yh-photo" style="--focus:48% 38%;--mobile-focus:48% 38%"><img src="{{asset:T01-1440.webp}}" srcset="{{asset:T01-480.webp}} 480w, {{asset:T01-640.webp}} 640w, {{asset:T01-720.webp}} 720w, {{asset:T01-960.webp}} 960w, {{asset:T01-1080.webp}} 1080w, {{asset:T01-1086.webp}} 1086w, {{asset:T01-1440.webp}} 1440w" sizes="(max-width:767px) 40vw,23vw" width="1440" height="1920" alt="椅子に座る設計担当のイメージ" loading="lazy" decoding="async"></picture><picture class="yh-photo" style="--focus:48% 54%;--mobile-focus:50% 50%"><img src="{{asset:W04-H-2560.webp}}" srcset="{{asset:W04-H-640.webp}} 640w, {{asset:W04-H-960.webp}} 960w, {{asset:W04-H-1440.webp}} 1440w, {{asset:W04-H-1672.webp}} 1672w, {{asset:W04-H-1920.webp}} 1920w, {{asset:W04-H-2560.webp}} 2560w" sizes="(max-width:767px) 40vw,23vw" width="2560" height="1440" alt="平屋の軒に沿う砂利の中庭" loading="lazy" decoding="async"></picture></div></div></div>
</main>
/* 線と間(SEN TO MA・旧名 余白の住まい)(2b44882)/shindan/mihon/yohaku の .yh-home-intro || .yh-keywords || .yh-collage || .yh-intro-layers || .yh-skip-intro に当たる規則を、吸収元のページの CSSOM で選び、元のスタイルの原文のまま写したもの。書き換えない。 */
/* --- src/styles/yohaku/base.css */
html[data-mihon=yohaku]{color-scheme:light;scroll-padding-top:65px}
.yh{--paper:#f0efeb;--ink:#111;--muted:#d6d5d2;--edge:20px;--serif:'Shippori Mincho','Yu Mincho',serif;--sans:'Noto Sans JP Variable','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif;margin:0;color:var(--ink);background:var(--paper);font:500 15px/1.9 var(--sans);-webkit-font-smoothing:antialiased;text-size-adjust:100%;line-break:strict}
.yh *,.yh *::before,.yh *::after{box-sizing:border-box}
.yh :where(h1,h2,h3,h4,p,figure,ol,ul,dl,dd){margin:0}
.yh :where(a){color:inherit;text-decoration:none}
.yh :where(button,input,textarea,select){font:inherit;color:inherit}
.yh button{background:none;border:0;padding:0;cursor:pointer}
.yh :focus-visible{outline:2px solid currentColor;outline-offset:3px}
.yh :where(button:disabled){cursor:default}
.yh [hidden]{display:none!important}
.yh img{display:block;max-width:100%}
.yh-photo{display:block;overflow:hidden}
.yh-photo img{width:100%;height:100%;object-fit:cover;object-position:var(--focus,50% 50%)}
html:has(.yh-menu[open]),html.yh-intro-lock{overflow:hidden}
.yh-pill{display:inline-flex;align-items:center;justify-content:center;background:#111!important;color:white!important;padding:10px 22px!important;font-size:12px;min-height:44px;border-radius:30px}
.yh-roll{display:inline-flex;overflow:clip;vertical-align:middle;line-height:1.6}
.yh-roll i{position:relative;display:inline-block;font-style:normal}
.yh-roll i::after{content:attr(data-echo);position:absolute;inset:0;transform:translateY(105%);transition:transform .15s cubic-bezier(.16,.6,.28,1) calc(var(--i)*25ms + 40ms)}
.yh-roll i>span{display:block;transition:transform .15s cubic-bezier(.16,.6,.28,1) calc(var(--i)*25ms)}
/* 抽出器が落とした規則(:is() の中の擬似クラス)。base.css 111・112 行目を原文のまま手で写した。technique.json の changes */
:is(a,button):is(:hover,:focus-visible) .yh-roll i>span{transform:translateY(-105%)}
:is(a,button):is(:hover,:focus-visible) .yh-roll i::after{transform:translateY(0)}
.yh-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:767px) {
.yh{--edge:12px}
.yh-photo img{object-position:var(--mobile-focus,50% 50%)}
}
html.reduced .yh *,html.reduced .yh *::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
/* --- src/styles/yohaku/home.css */
.yh-home-hero{position:relative}
.yh-stage{position:relative;width:100%;height:100svh;overflow:hidden;transform-origin:50% 50%}
.yh-final-frame,.yh-intro-layers,.yh-intro-layers img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.yh-prepare .yh-stage{transform:scale(.4)}
.yh-intro-layers{pointer-events:none}
.yh-skip-intro{position:fixed;z-index:10;bottom:20px;right:20px;border-radius:30px!important;padding:12px 18px!important;background:#fff!important;color:#111;font-size:12px}
.yh-keywords{display:flex;align-items:stretch;border-block:1px solid var(--muted)}
.yh-key-window{overflow:hidden;flex:1;min-width:0}
.yh-key-track{display:flex;width:max-content}
.yh-key-group{display:flex;justify-content:space-around;align-items:center;width:max(100vw,790px);height:80px}
.yh-key-group span{font-size:clamp(13px,1.3vw,22px);letter-spacing:.12em}
.yh-key-group span:nth-child(2n){font:800 1.4em var(--serif);letter-spacing:-.05em}
.yh-key-pause{width:48px;font-size:12px}
.yh-home-intro{padding:120px var(--edge);text-align:center}
.yh-home-intro .yh-reveal{max-width:min(1000px,70%);margin:auto;font-size:35px;line-height:1.5;letter-spacing:-.055em}
.yh-home-intro .yh-pill{margin-top:30px}
.yh-reveal span[data-yh-glyph]{transition:none}
.yh-collage{overflow:clip;width:100%}
.yh-collage-offset{width:120vw;position:relative;left:50%;transform:translateX(-50%)}
.yh-collage-track{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:end;gap:1vw}
.yh-collage .yh-photo{aspect-ratio:3/2}
.yh-collage .yh-photo:nth-child(2n) { aspect-ratio: 3 / 4; }
@media(max-width:1024px) {
.yh-home-intro .yh-reveal{max-width:90%;font-size:24px;line-height:1.6}
}
@media(max-width:767px) {
.yh-stage{height:60svh}
.yh-prepare .yh-stage{transform:none}
.yh-key-group{height:55px;width:680px}
.yh-home-intro{padding:64px 12px}
.yh-home-intro .yh-reveal{font-size:clamp(16px,5.4vw,21px);line-height:1.7;max-width:none}
.yh-collage-offset{width:150vw}
}
export {};
const doc = document.documentElement;
const scope = new AbortController();
const {signal} = scope;
const title = document.querySelector<HTMLElement>('.yh-name')!;
const titleBlock = document.querySelector<HTMLElement>('.yh-title-area')!;
const stage = document.querySelector<HTMLElement>('.yh-stage')!;
const layers = document.querySelector<HTMLElement>('.yh-intro-layers')!;
const skip = document.querySelector<HTMLButtonElement>('.yh-skip-intro')!;
const tags = document.querySelector<HTMLElement>('.yh-photo-tags')!;
const header = document.querySelector<HTMLElement>('.yh-head')!;
const still = ()=>doc.classList.contains('reduced');
let ended=false;
const animations:Animation[]=[];
let timer=0;
let failSafe=0;
function introDone(){
if(ended)return;
ended=true;window.clearTimeout(timer);window.clearTimeout(failSafe);
animations.forEach(a=>a.cancel());layers.replaceChildren();skip.hidden=true;
doc.classList.remove('yh-playing','yh-prepare','yh-intro-lock');
try{sessionStorage.setItem('yh-intro-seen','1');}catch{/* optional */}
document.dispatchEvent(new Event('yohaku:lock'));
}
skip.addEventListener('click',introDone,{signal});
function animate(el:Element, from:Keyframe, to:Keyframe, duration:number, delay=0, easing='cubic-bezier(.16,.8,.22,1)'){
animations.push(el.animate([from,to],{duration,delay,easing,fill:'both'}));
}
async function intro(){
if(!doc.classList.contains('yh-prepare') || still()){introDone();return;}
const small=matchMedia('(max-width:767px)').matches;
const target=stage.querySelector('img')!;
skip.hidden=false;
const cards:HTMLImageElement[]=[];
if(!small){
const framePixels=window.innerWidth*.4*window.devicePixelRatio;
const frameWidth=framePixels<=640?640:framePixels<=960?960:1440;
for(const key of ['W03-H','W04-H','W05-H','W02-H','W01-H']){
const image=new Image();
image.alt=''; image.decoding='async';
// 最後の一枚はそのまま全画面へ広がるので、通常表示と同じ解像度を使う。
image.src=key==='W01-H' ? target.currentSrc || target.src : `/media/shindan/yohaku/${key}-${frameWidth}.webp`;
cards.push(image);
}
}
const ready=Promise.all([document.fonts.ready,target.decode(),...cards.map(img=>img.decode())]);
failSafe=window.setTimeout(introDone,2000);
try{await ready;}catch{introDone();return;}
if(ended || !doc.classList.contains('yh-prepare') || still()){introDone();return;}
clearTimeout(failSafe);
document.documentElement.classList.add('yh-intro-lock');document.dispatchEvent(new Event('yohaku:lock'));
const areaHeight=window.innerHeight*(small?.4:.45);
doc.classList.remove('yh-prepare');
if(small){
animate(stage,{clipPath:'inset(0 0 100% 0)'},{clipPath:'inset(0)'},650);
title.querySelectorAll('b').forEach((b,i)=>animate(b,{transform:'translateY(105%)'},{transform:'none'},640,25*i));
timer=window.setTimeout(introDone,850);
return;
}
layers.append(...cards);doc.classList.add('yh-playing');
const distance=Math.max(1200,stage.offsetHeight*1.2);
cards.forEach((img,i)=>animate(img,{transform:`translateY(-${distance}px)`},{transform:'translateY(0)'},600,1000+i*600));
animate(stage,{transform:'scale(.4)'},{transform:'scale(1)'},1000,4000);
animate(titleBlock,{height:'0px',overflow:'hidden'},{height:areaHeight+'px',overflow:'hidden'},1000,4000);
title.querySelectorAll('b').forEach((b,i)=>animate(b,{transform:'translateY(400px)'},{transform:'translateY(0)'},2000,5000+i*70,'cubic-bezier(.16,1,.3,1)'));
animate(header,{transform:'translateY(-105%)'},{transform:'translateY(0)'},750,5000);
animate(tags,{opacity:0},{opacity:1},1200,5200);
timer=window.setTimeout(introDone,7350);
}
void intro().catch(introDone);
const copy=[...document.querySelectorAll<HTMLElement>('[data-yh-reveal]')].map(el=>({
el, letters:[...el.querySelectorAll<HTMLElement>('[data-yh-glyph]')],p:-1, last:-1
}));
let revealFrame=0,lastFrame=0;
const clamp=(n:number)=>Math.min(1,Math.max(0,n));
function reveal(now:number){
revealFrame=0;let moving=false;
const dt=Math.min(80,Math.max(1,now-lastFrame)); lastFrame=now;
const h=window.innerHeight;
for(const row of copy){
const top=row.el.getBoundingClientRect().top;
const target=still()?1:clamp((100+.75*h-top)/(200+.5*h));
const delta=target-row.p;
if(row.p<0 || still() || Math.abs(delta)<.001 || top>h+100 || top< -row.el.offsetHeight-100)row.p=target;
else {row.p+=delta*(1-Math.exp(-dt/180));moving=true;}
if(row.p===row.last)continue;
row.last=row.p;
row.letters.forEach((letter,i)=>{const opacity=(.2+.8*clamp((row.p*(row.letters.length+5)-i)/6)).toFixed(3);if(letter.style.opacity!==opacity)letter.style.opacity=opacity;});
}
if(moving)revealFrame=requestAnimationFrame(reveal);
}
function updateReveal(){if(!revealFrame)revealFrame=requestAnimationFrame(reveal);}
window.addEventListener('scroll',updateReveal,{passive:true,signal});window.addEventListener('resize',updateReveal,{signal});updateReveal();
const band=document.querySelector<HTMLElement>('.yh-keywords')!,track=band.querySelector<HTMLElement>('.yh-key-track')!;
const toggle=band.querySelector<HTMLButtonElement>('.yh-key-pause')!;
let paused=false,inView=false,bandFrame=0,prev=0,offset=0,multiplier=1,velocity=0;
let lastScroll=window.scrollY,lastScrollTime=performance.now();
let repeatWidth=track.firstElementChild!.getBoundingClientRect().width;
const bandSize=new ResizeObserver(()=>{repeatWidth=track.firstElementChild!.getBoundingClientRect().width;});bandSize.observe(track);
const runBand=()=>inView&&!paused&&!still()&&!document.hidden&&!band.matches(':focus-within');
function tick(now:number){
bandFrame=0;if(!runBand())return;
const dt=Math.min(.064,(now-prev)/1000);prev=now;
const v=now-lastScrollTime>120?0:velocity;
const target=v>12?3+Math.min(v/800,4):1;
multiplier+=(target-multiplier)*(1-Math.exp(-dt/.33));
offset=(offset+dt/80*repeatWidth*multiplier)%Math.max(1,repeatWidth);
track.style.transform=`translate3d(-${offset}px,0,0)`;bandFrame=requestAnimationFrame(tick);
}
function startBand(){cancelAnimationFrame(bandFrame);prev=performance.now();if(runBand())bandFrame=requestAnimationFrame(tick);}
window.addEventListener('scroll',()=>{const now=performance.now(); velocity=Math.abs(window.scrollY-lastScroll)*1000/Math.max(now-lastScrollTime,1);lastScroll=window.scrollY;lastScrollTime=now;},{passive:true,signal});
const bandSeen=new IntersectionObserver(([entry])=>{inView=entry.isIntersecting;startBand();});bandSeen.observe(band);
toggle.addEventListener('click',()=>{paused=!paused;toggle.textContent=paused?'▷':'Ⅱ';toggle.setAttribute('aria-label',paused?'文字帯を再生':'文字帯を一時停止');toggle.setAttribute('aria-pressed',String(paused));startBand();},{signal});
band.addEventListener('focusin',startBand,{signal});band.addEventListener('focusout',()=>queueMicrotask(startBand),{signal});document.addEventListener('visibilitychange',startBand,{signal});
const collage=document.querySelector<HTMLElement>('.yh-collage')!, rail=collage.querySelector<HTMLElement>('.yh-collage-track')!;
collage.addEventListener('pointermove',event=>{
if(event.pointerType!=='mouse'||still())return;
const r=collage.getBoundingClientRect();const x=clamp((event.clientX-r.left)/r.width)*2-1;
rail.style.transition='transform .6s cubic-bezier(.22,1,.36,1)';rail.style.transform=`translateX(${-40*x}px)`;
},{signal});
collage.addEventListener('pointerleave',()=>{rail.style.transition='transform .8s cubic-bezier(.2,1.18,.32,1)';rail.style.transform='translateX(0)';},{signal});
function motionChanged(){if(still()){introDone();rail.style.transform='none';track.style.transform='none';}toggle.hidden=still();startBand();updateReveal();}
motionChanged();
document.addEventListener('yohaku:motion',motionChanged,{signal});
window.addEventListener('pagehide',event=>{introDone();cancelAnimationFrame(bandFrame);cancelAnimationFrame(revealFrame);revealFrame=0;
if(event.persisted)return;
scope.abort();bandSize.disconnect();bandSeen.disconnect();
},{signal});
window.addEventListener('pageshow',()=>{startBand();updateReveal();},{signal});
# yh-scroll-copy — スクロールで 1 字ずつ薄い灰から黒へ濃くなる紹介文
吸収元:線と間(SEN TO MA・site id `yohaku`)の承認の版 `2b4488256376a115b6c03164f58ad4bd4d7d706b`、トップ `/shindan/mihon/yohaku` の紹介文の節(指示書 18 章の M05。同じモジュールで M06 の文字帯・M07 のコラージュも動く)。
## 何をする技術か
- 中央の大きな紹介文(PC 35px・行高 1.5)を書記素ごとの `span[data-yh-glyph]` に分ける。位置は動かさず、`opacity` だけを 0.2 から 1 へ、書記素の順に変える。
- 進み:`p = clamp((100 + 0.75H − top) / (200 + 0.5H))`
- 文の上端より 100px 上の点が画面の 75% の高さに来たときが 0。
- 100px 下の点が 25% の高さに来たときが 1。
- i 字目:`q = clamp((p(N+5) − i) / 6)`、`opacity = 0.2 + 0.8q`。6 字ぶんが同時に濃くなりながら進む。
- 追従は `1 − exp(−dt/180)` の減速(dt は実際の経過時間で 80ms まで)。逆にスクロールすると同じ濃さに戻る。
- 読み上げは全文の `.yh-sr` 1 つ。字の span は `aria-hidden`。
- 同じモジュールが、上の文字帯(1 組を 80 秒で等速に流し、スクロールの速さで 3〜7 倍)と、下のコラージュ(120vw・マウスと逆へ最大 40px)も動かす。
- 「私たちについて」の丸いボタンは、乗ると 1 字ずつ縦に入れ替わる。
## 写したファイル(吸収元のパス → ここ)
- `src/scripts/yohaku/home.ts` → `src/js/home.ts`(書き換えていない)
- `src/styles/yohaku/base.css`・`home.css` の、この節に当たる規則 → `src/style.css`(抽出器が原文の行を写した。手で足した行は下の「変えたところ」)
- 節のマークアップ(`ScrollCopy.astro`・`index.astro`・`Photo.astro` がサーバーで出した HTML)→ `src/markup.html`
- 写真 5 枚(C01・W06-H・W01-D4・T01・W04-H の各幅、計 29 ファイル)→ `assets/`
## 入口(src/index.ts)で呼ぶ順
1. 字体 3 つ(Noto Sans JP・Geist・しっぽり明朝 800)と `style.css` を読む。
2. `./js/home` を読む。home.ts は読み込んだ時点で要素を探して動き出す(関数を書き出さない作り)。
3. 器の `common.ts` の 64〜78 行(`graphemes` と `[data-roll]` の組み立て)を原文のまま入口に写してあり、home.ts の後に動く。吸収元でもスクリプトの順は home.ts → common.ts(ページの HTML で確かめた)。
4. `mount()` は何もせず、後片付けの関数を返す。
home.ts は冒頭の組み立て演出・文字帯・紹介文・コラージュを 1 つのモジュールで初期化し、要素を `!` で決め打ちで探す。そのため次の要素もマークアップに含めている。
- 冒頭の演出の器(`.yh-intro-layers`・`.yh-skip-intro`)。中は空。
- 文字帯とコラージュ。
冒頭の演出は `html.yh-prepare` がないと走らない。この入口ではそのクラスを付けない。
## 変えてよい所・変えてはいけない所
変えてよい:
- 文と文字帯の語(書記素ごとの span に分けて置く)。
- 字の大きさと幅(35px・`min(1000px,70%)`)。
- 色(`--ink`・`--paper`)。
- コラージュの写真と幅。
案件では色・字体・寸法をアートディレクションで決め直し、濃さの仕組みだけを使う(`technique.json` の export)。
変えてはいけない:
- 字の位置を動かさず、opacity だけで順に濃くすること。
- 開始と終了の位置(画面の 75%・25% と ±100px)。
- 6 字の幅と 180ms の追従。
- 逆のスクロールで戻ること。
- 動き:オフで全文 opacity 1。
## 後片付けで止められないもの
- `mount()` の返す関数は `pagehide`(persisted=false)を合成して送り、home.ts 自身の片付けをそのまま呼ぶ。止まるものは次のとおり。
- 冒頭の演出を終える。
- 文字帯と濃さの rAF。
- AbortController の受け口。
- ResizeObserver・IntersectionObserver。
- 同じページで `pagehide` を聞くほかのモジュールも、一緒に片付く。
- 字に書いた `opacity`、文字入替で作り替えた `[data-roll]` の中身は元に戻らない。
- モジュールは 1 ページに 1 回だけ動く。片付けの後にもう一度 mount しても動き直さない。
## 変えたところ
- `src/style.css`:base.css の 111・112 行(`:is(a,button):is(:hover,:focus-visible) .yh-roll …`。文字入替)を、原文の 1 行のまま元の位置に手で足した。
- 抽出器は照合の前に `:hover`・`:focus-visible` を消すが、`:is()` の中のものも消す。そのため壊れた選択子になり、当たらないと判断した。
- `src/index.ts`:common.ts の 64〜78 行を写した。
- common.ts は読み込みでヘッダーとメニューを `!` で探すので、この節だけでは例外になる。そのため、この節に効く文字入替の部分だけを写した。
## 写せなかったもの
- 冒頭の組み立て演出(トップの head の inline が `yh-prepare` を付ける)と、その写真。器だけを置いた。
- 器の Lenis(PC のなめらかなスクロール)は技術 `yh-white-menu` にある。濃さは `getBoundingClientRect` を読むだけなので、Lenis の有無で計算は変わらない。
## 比較の結果(tools/compare.mjs)
最終の実行:2026-12-05 17:46(日本時間)。位置合わせを直した後の道具で、閾値は変えていない。
ブラウザーの検査と同じ手順で、自分のデモも確かめた。1440・390・390 の動き:オフのすべてで、次のとおりだった。
- mount している。
- 後片付けを呼べる。
- 動き:オフで `html.reduced` が残る。
- 誤り・失敗した通信・はみ出しはない。
| 幅 | 止めた状態(動き:オフ) | 動き(20 コマ) | 誤り |
|---|---|---|---|
| 1440×900 | 0% | 最大 0%・平均 0% | なし |
| 390×844 | 0% | 最大 0%・平均 0% | なし |
判定は**一致**。動きは、節の上端へスクロールした直後から、次の操作を含めて比べた。
- 上へ 450px 戻す(後ろの字から薄くなる)。
- 下へ 220px 送る。
- 「私たちについて」に乗る。
位置合わせ(`widths[幅].align`):
| 幅 | 吸収元の上端 | デモの上端(最初) | 渡した before |
|---|---|---|---|
| 390px | 900.984375 | 1464.359375 | 337.609375 |
| 1440px | 1387 | 2369 | 405 |
経緯:前の道具では 390px の止めた状態が 1.10% で「差あり」だった。
- 原因は抽出の漏れではなく、条件の違いだった。デモでは節の上に冒頭の器と文字帯が並ぶ。それなのに前の道具は、吸収元の節の上端をそのまま前の余白にしていた。
- そのため節の上端の小数の部分がずれ、3 行目とボタンの字がちょうど 1px 下に描かれた。
- 道具が上の要素の高さを引くようになって、0% になった。
{
"site": "yohaku",
"commit": "2b4488256376a115b6c03164f58ad4bd4d7d706b",
"route": "/shindan/mihon/yohaku",
"selector": ".yh-home-intro || .yh-keywords || .yh-collage || .yh-intro-layers || .yh-skip-intro",
"width": 1440,
"extractedAt": "2026-12-05T08:28:07.970Z",
"htmlAttrs": [
[
"lang",
"ja"
],
[
"data-mihon",
"yohaku"
]
],
"bodyAttrs": [
[
"class",
"yh"
]
],
"liveHtmlAttrs": [
[
"lang",
"ja"
],
[
"data-mihon",
"yohaku"
],
[
"class",
"lenis"
]
],
"liveBodyAttrs": [
[
"class",
"yh"
]
],
"cssLines": 61,
"fonts": [
"inherit"
],
"fontImports": [
"@fontsource-variable/noto-sans-jp",
"@fontsource-variable/geist",
"@fontsource/shippori-mincho/800.css"
],
"assets": [
{
"name": "C01-1920.webp",
"from": "/media/shindan/yohaku/C01-1920.webp",
"bytes": 279644,
"sha1": "37bffa4404f68e808f08cfe673e22aa677db0ec8"
},
{
"name": "C01-640.webp",
"from": "/media/shindan/yohaku/C01-640.webp",
"bytes": 45144,
"sha1": "b4b9a009a0d02834efb300f172a738b7fa301a3c"
},
{
"name": "C01-960.webp",
"from": "/media/shindan/yohaku/C01-960.webp",
"bytes": 90428,
"sha1": "24d4ac6905fb3a656e43305f1e68139d39ff75fc"
},
{
"name": "C01-1440.webp",
"from": "/media/shindan/yohaku/C01-1440.webp",
"bytes": 219180,
"sha1": "dacf91868b82822da929b59afedf8408611f2567"
},
{
"name": "C01-1498.webp",
"from": "/media/shindan/yohaku/C01-1498.webp",
"bytes": 241952,
"sha1": "a8c02093ff727bd49a9a5fef02f44bccfd35d3cf"
},
{
"name": "W06-H-2560.webp",
"from": "/media/shindan/yohaku/W06-H-2560.webp",
"bytes": 439208,
"sha1": "fac44cc70e1d59de39d32f88ced3cf75ff5bd219"
},
{
"name": "W06-H-640.webp",
"from": "/media/shindan/yohaku/W06-H-640.webp",
"bytes": 36734,
"sha1": "baf0da6fd23d189e7a45d9cdbea8a38f7077c5ed"
},
{
"name": "W06-H-960.webp",
"from": "/media/shindan/yohaku/W06-H-960.webp",
"bytes": 75686,
"sha1": "5253e861acd914a2e01ff29ca1eb7a64e8cd70f1"
},
{
"name": "W06-H-1440.webp",
"from": "/media/shindan/yohaku/W06-H-1440.webp",
"bytes": 183102,
"sha1": "893007e3d48b836bb67c3db65a64e5e186b0c6e1"
},
{
"name": "W06-H-1672.webp",
"from": "/media/shindan/yohaku/W06-H-1672.webp",
"bytes": 234326,
"sha1": "92d86552b7bb1b373dbbec5ada968b51620a4bff"
},
{
"name": "W06-H-1920.webp",
"from": "/media/shindan/yohaku/W06-H-1920.webp",
"bytes": 275826,
"sha1": "0817f438537c1f02801cbd1eddb3024e033cad25"
},
{
"name": "W01-D4-1920.webp",
"from": "/media/shindan/yohaku/W01-D4-1920.webp",
"bytes": 251528,
"sha1": "21f82595ec90cc3d740a1801d36174a16b1c5e2b"
},
{
"name": "W01-D4-640.webp",
"from": "/media/shindan/yohaku/W01-D4-640.webp",
"bytes": 34412,
"sha1": "8f437e959f0c14f5370cc4df8bb8c436955c4a0d"
},
{
"name": "W01-D4-960.webp",
"from": "/media/shindan/yohaku/W01-D4-960.webp",
"bytes": 71966,
"sha1": "b625ecafe9ba9495f1929ec5775e58b663b567c3"
},
{
"name": "W01-D4-1440.webp",
"from": "/media/shindan/yohaku/W01-D4-1440.webp",
"bytes": 181338,
"sha1": "797deb2efa6b7b100438f794b9b8848f3612c43e"
},
{
"name": "W01-D4-1536.webp",
"from": "/media/shindan/yohaku/W01-D4-1536.webp",
"bytes": 209842,
"sha1": "621681c4c680dd10fc82aeb4471406fef96e21ca"
},
{
"name": "T01-1440.webp",
"from": "/media/shindan/yohaku/T01-1440.webp",
"bytes": 191274,
"sha1": "f2796c7b9e62f08bdb01c9d7c8f7ca92dd11684d"
},
{
"name": "T01-480.webp",
"from": "/media/shindan/yohaku/T01-480.webp",
"bytes": 34548,
"sha1": "af1837d0f7f1d880266a4098d659b25ae47b34d0"
},
{
"name": "T01-640.webp",
"from": "/media/shindan/yohaku/T01-640.webp",
"bytes": 52208,
"sha1": "22359532e8093396c7ce05752bf6fa8d19674f95"
},
{
"name": "T01-720.webp",
"from": "/media/shindan/yohaku/T01-720.webp",
"bytes": 62332,
"sha1": "94f5a4c7c39700388136358e1f4044b2c8ecabfb"
},
{
"name": "T01-960.webp",
"from": "/media/shindan/yohaku/T01-960.webp",
"bytes": 97068,
"sha1": "10c018756f3fe944b7a727652214646d84e7a2ea"
},
{
"name": "T01-1080.webp",
"from": "/media/shindan/yohaku/T01-1080.webp",
"bytes": 145232,
"sha1": "45abeaf0bd4f4c0a95be75a07972678dadfe5e96"
},
{
"name": "T01-1086.webp",
"from": "/media/shindan/yohaku/T01-1086.webp",
"bytes": 149368,
"sha1": "44c80f1be31e5a7d57e08102676dae610db02e88"
},
{
"name": "W04-H-2560.webp",
"from": "/media/shindan/yohaku/W04-H-2560.webp",
"bytes": 616056,
"sha1": "a6e9e47e98ca7093ba6b59e550c0f2e0657ce5c1"
},
{
"name": "W04-H-640.webp",
"from": "/media/shindan/yohaku/W04-H-640.webp",
"bytes": 52556,
"sha1": "4cbf22fcccf479d1bfe7f86a751b556bdb40139e"
},
{
"name": "W04-H-960.webp",
"from": "/media/shindan/yohaku/W04-H-960.webp",
"bytes": 108504,
"sha1": "310469ea4bbe9926afadf4a6fe434a53834981a8"
},
{
"name": "W04-H-1440.webp",
"from": "/media/shindan/yohaku/W04-H-1440.webp",
"bytes": 250918,
"sha1": "4a68ade6f017800880963ac505b74a29cc6cd260"
},
{
"name": "W04-H-1672.webp",
"from": "/media/shindan/yohaku/W04-H-1672.webp",
"bytes": 312636,
"sha1": "4c58df7e0fc2cc1e98161e0f912e8eb477b3ee9f"
},
{
"name": "W04-H-1920.webp",
"from": "/media/shindan/yohaku/W04-H-1920.webp",
"bytes": 400446,
"sha1": "80ca4620f18514f43f0d85757509d5519c704bcc"
}
],
"js": [
{
"from": "src/scripts/yohaku/home.ts",
"to": "src/js/home.ts",
"own": true
}
],
"warnings": [
"原文と対応づけられず CSSOM の文で写した:.yh-collage .yh-photo:nth-child(2n)"
]
}{
"id": "yh-scroll-copy",
"version": "1.0.0",
"title": "スクロールで 1 字ずつ薄い灰から黒へ濃くなる紹介文(文字帯とコラージュを伴う)",
"category": "typography",
"level": "section",
"summary": "中央に置いた大きな紹介文(PC 35px・行高 1.5)の文字を書記素ごとの span にし、位置は動かさずに opacity だけを 0.2→1 へ順に変える。進み p は「文の上端より 100px 上の点が画面の高さ 75% に来たとき」から「100px 下の点が 25% に来たとき」まで(p = (100 + 0.75H − top) / (200 + 0.5H))。i 字目は q = clamp((p(N+5) − i)/6) で、6 字ぶんが同時に濃くなりながら左上から右下へ進む。追従は 180ms の指数の減速(rAF・実際の経過時間)で、逆にスクロールすると同じ濃さへ戻る。同じモジュールで、上の文字帯(6 語を 2 組並べ、1 組ぶんを 80 秒で等速に流す。スクロールの速さに応じて 3〜7 倍へ 0.33 秒で加速)と、下のコラージュ(幅 120vw・5 枚、マウスと逆向きに最大 40px、離すと弾んで 0 へ)も動く。",
"tags": ["スクロール連動", "文字の濃さ", "1 字ずつ", "書記素", "紹介文", "文字帯", "マーキー", "コラージュ", "マウス追従", "住宅", "リフォーム"],
"provenance": {
"site": "yohaku",
"siteName": "線と間(SEN TO MA・旧名 余白の住まい)",
"commit": "2b4488256376a115b6c03164f58ad4bd4d7d706b",
"status": "APPROVED",
"route": "/shindan/mihon/yohaku",
"selector": ".yh-home-intro || .yh-keywords || .yh-collage || .yh-intro-layers || .yh-skip-intro",
"files": [
"src/scripts/yohaku/home.ts",
"src/scripts/yohaku/common.ts(64〜78 行の文字入替だけを入口に原文のまま写した)",
"src/styles/yohaku/base.css",
"src/styles/yohaku/home.css",
"src/components/yohaku/ScrollCopy.astro(書記素ごとの span。マークアップはサーバーの HTML から)",
"src/pages/shindan/mihon/yohaku/index.astro・src/components/yohaku/Photo.astro(同上)",
"src/layouts/Yohaku.astro(器。字体・base.css・html.reduced を付ける inline・common.ts)"
],
"spec": "prompts/yohaku.md",
"basis": "provenance/decisions.json の yohaku(APPROVED の根拠と事業者の指示の日時)。指示書の 10-3〜10-5 と 18 章 M05(薄い本文がスクロールで濃くなる)・M06(横帯)・M07(コラージュ)・M04(文字入替)"
},
"dependencies": {
"@fontsource-variable/noto-sans-jp": "5.3.1",
"@fontsource/shippori-mincho": "5.3.0(800。文字帯の偶数の語)",
"@fontsource-variable/geist": "5.3.0(器が読む。この節では使わない)"
},
"license": {
"code": "便利DEネットの自社制作(見本サイトのために書いたコード。ライブラリーを使わない素の TypeScript)",
"fonts": "OFL(fontsource のパッケージから読む。字体ファイルは持ち込まない)",
"assets": "架空の住宅会社の見本のために生成した写真 5 枚(コラージュ。T01 は架空の人物)。実在の人物・会社・実績ではない",
"reference": "参考サイト (参考サイト) の画面構造・数値(文字の濃さとスクロールの連動・120vw のコラージュ・最大 40px など)を文章に書き起こした指示書で作った版(事業者が 2026-12-01 18:57 に『あまりにも酷似』と述べた、独自性の作り替えの前の版)。参考の写真・文章・字体・コードは持ち込んでいない"
},
"export": {
"policy": "code-restyle",
"code": true,
"assets": false,
"copy": false,
"requires": [
"紹介文・文字帯の語・写真は案件のものに差し替える(見本は架空の会社。文は書記素ごとの span[data-yh-glyph] に分けて置く)",
"参考サイトの完全再現として作った版なので、色・字体・寸法(35px・幅 70%・120vw・23vw)は案件のアートディレクションで決め直し、濃さの計算(開始と終了の位置・6 字の幅・180ms の追従)の仕組みだけを使う",
"home.ts は冒頭の組み立て演出・文字帯・紹介文・コラージュを 1 つのモジュールで初期化し、要素を決め打ちで探す。紹介文だけを使う案件では、モジュールを分ける必要がある(このままでは文字帯・コラージュ・冒頭の器がないと例外になる)"
]
},
"customizable": [
{ "name": "文", "how": "p[data-yh-reveal] の中に、読み上げ用の全文 .yh-sr と、aria-hidden の span の中に 1 書記素ずつの span[data-yh-glyph](改行は br)。ページ内の [data-yh-reveal] はいくつでも" },
{ "name": "大きさ", "how": ".yh-home-intro .yh-reveal の font-size:35px・line-height:1.5・max-width:min(1000px,70%)、1024px 以下 24px、767px 以下 clamp(16px,5.4vw,21px)" },
{ "name": "文字帯の語", "how": ".yh-key-group の span(2 組とも同じ語。2 組目は aria-hidden)。偶数の語は明朝 800" },
{ "name": "コラージュ", "how": ".yh-collage-track の picture(5 枚)、.yh-collage-offset の width:120vw(767px 以下 150vw)、偶数の写真は 3:4" },
{ "name": "色", "how": ".yh の --ink(濃くなった字)・--paper(地)・--muted(文字帯の罫線)。薄い字は opacity 0.2 なので色は --ink のまま" }
],
"invariants": [
"文字の位置は動かさない。opacity だけを 0.2→1 へ、書記素の順に変える(ランダムにしない)",
"p = clamp((100 + 0.75H − top) / (200 + 0.5H))、i 字目の q = clamp((p(N+5) − i)/6)、opacity = 0.2 + 0.8q",
"追従は 1 − exp(−dt/180)(dt は実際の経過時間で 80ms まで)。逆にスクロールすると同じ濃さに戻る。画面から 100px 以上外れたら追従せずに合わせる",
"動き:オフ(html.reduced)では全文 opacity 1",
"文字帯は 1 組ぶんを 80 秒で等速。スクロールの速さ v が 12px/秒を超えると 3 + min(v/800, 4) 倍へ 0.33 秒で近づき、120ms スクロールがなければ 1 倍へ戻る。画面の外・一時停止・フォーカスが中にある・タブが隠れている間は止める",
"コラージュはマウスだけ:目標 −40 × x(x は −1〜1)px を 0.6 秒、離すと 0.8 秒の弾む戻り。タッチと動き:オフでは動かさない。横にはみ出す 120vw の器と、動かす要素を分ける"
],
"industries": ["reform", "architecture", "corporate", "hospitality", "beauty", "all"],
"artDirections": ["ad-yohaku"],
"combine": {
"goodWith": ["写真の大きなページの、写真と写真の間の短い紹介文(3〜5 行)", "余白の多い、文字の少ないページ", "yh-white-menu(同じ器の common.ts。PC の Lenis もそちらが作る)"],
"avoid": ["長い本文(読み終える前に濃くならない字が残る)", "同じ画面に濃さの変わる文を 3 つ以上並べる"],
"note": "html・.yh・.yh * に効く初期化の規則(base.css)と、body の class=\"yh\"・html の data-mihon=\"yohaku\" に置いた変数を含む。ほかの技術と 1 枚のページに組むときは、初期化の規則が 1 組になるようにするか、iframe で分ける。吸収元では器の common.ts が PC で Lenis(duration 1.5)を作るが、この技術の入口は作らない(濃さは getBoundingClientRect を読むだけなので、Lenis の有無で計算は変わらない)"
},
"performance": {
"images": "コラージュの写真 5 枚(各 5〜7 幅の webp・srcset・sizes=(max-width:767px) 40vw,23vw・loading=lazy)",
"animation": "文字ごとの opacity(値が変わったときだけ書く)、文字帯の translate3d、コラージュの transform(CSS の遷移)",
"notes": "濃さの rAF は動いている間だけ回し、止まったら次のスクロールまで止める。文字帯の幅は ResizeObserver で測り直す。素材は 29 ファイル"
},
"responsive": {
"breakpoints": ["1024px(紹介文 24px・幅 90%)", "767px(紹介文 clamp(16px,5.4vw,21px)・行高 1.7、上下 64px、文字帯の高さ 55px・1 組 680px、コラージュ 150vw)"],
"verified": ["1440×900", "390×844"]
},
"accessibility": {
"roles": "紹介文は読み上げ用の全文 1 つ(.yh-sr)と、aria-hidden の 1 字ずつの span。文字帯の 2 組目は aria-hidden。一時停止のボタンは aria-pressed と aria-label(文字帯を一時停止/再生)が替わる",
"focus": ".yh :focus-visible に 2px の線。文字帯の中にフォーカスがある間は止まる",
"note": "薄い字は opacity 0.2(地との差が小さい)だが、読み上げ用の全文は常にある。スクロールすると濃くなる"
},
"reducedMotion": {
"rule": "home.ts は html.reduced だけを見る(吸収元の still())。見本の決まり(2026-11-30 事業者の指示)はサイトの「動き:オフ」のときだけ止めること。ただし承認の版 2b44882 の器(Yohaku.astro の head の inline と common.ts の mode())は、OS の「動きを減らす」でも html.reduced を付ける。LAB のデモは ?motion=off のときだけ html.reduced を付ける(器の OS の判定は写していない)",
"whenOff": "紹介文は全文 opacity 1。文字帯は止まって並び、一時停止のボタンは隠れる。コラージュは動かない。冒頭の演出はしない"
},
"changes": [
{
"file": "src/style.css",
"what": "抽出器が写さなかった base.css の 2 規則(111・112 行目 :is(a,button):is(:hover,:focus-visible) .yh-roll i>span・i::after。文字入替)を、原文の 1 行のまま、元の並びの位置に手で足した",
"why": "抽出器(tools/extract.mjs)は、照合の前に :hover・:focus-visible を消すが、:is() の中のものも消すので :is(,) という壊れた選択子になり、当たらないと判断する。吸収元のページでは「私たちについて」に当たる規則。足した行は吸収元の CSS にそのままあり、レジストリが照合する"
},
{
"file": "src/index.ts",
"what": "器の scripts/yohaku/common.ts の 64〜78 行(graphemes と [data-roll] の組み立て)を原文のまま入口に写した",
"why": "common.ts は読み込みでヘッダーとメニューを「!」で探すので、この節だけでは読み込めない(例外になる)。紹介文の下の「私たちについて」の文字入替だけがこの節に効くので、その部分だけを、吸収元と同じく home.ts の後に動かす"
}
],
"verify": {
"selector": ".yh-home-intro",
"selectorNote": "写す範囲には、home.ts が要る文字帯・コラージュと冒頭の演出の器(.yh-intro-layers・.yh-skip-intro。中は空)を含めるが、比べるのは紹介文の節だけ",
"session": { "yh-intro-seen": "1" },
"sessionNote": "吸収元のトップは、このタブで初めて開くと冒頭の組み立て演出(html.yh-prepare。スクロールを 7.35 秒止める)を出す。2 回目の表示と同じにする",
"frames": [0, 100, 200, 300, 450, 700, 1000, 1350, 1450, 1600, 1900, 2300, 2450, 2550, 2700, 3000, 3350, 3450, 3550, 3700],
"framesNote": "0 は節の上端へスクロールした直後(読み込みの位置では文の上端が画面の下なので全部 0.2)。100 からは濃くなる途中(最初の 1 コマは 80ms ぶん、あとは 16ms ずつ)",
"actions": [
{ "at": 1300, "scrollBy": -450, "note": "上へ戻す(文の上端が画面の下寄りへ。p が約 0.3 へ戻り、後ろの字から薄くなる)" },
{ "at": 2400, "scrollBy": 220, "note": "少し下へ(p が約 0.65 へ。前の字から濃くなる)" },
{ "at": 3400, "hover": ".yh-home-intro .yh-pill", "note": "「私たちについて」に乗る(文字入替)" }
],
"recordMs": 4000
}
}