From 5c6ccc36777e7694c3568a47f29eb9fb12a7d2f0 Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 10 Oct 2026 02:45:33 +0900 Subject: [PATCH] fix: rebuild landing with SVG motion and a monospace tree --- README.md | 13 +- site/playwright.config.ts | 6 +- site/src/components/Landing.astro | 74 +++++++ site/src/layouts/Site.astro | 15 +- site/src/lib/landing-demo.ts | 48 +++++ site/src/pages/index.astro | 11 +- site/src/scripts/landing.ts | 335 +++++++++++++++++++++++++++++ site/src/styles/landing.css | 146 +++++++++++++ site/tests/browser/landing.spec.ts | 169 +++++++++++++++ 9 files changed, 803 insertions(+), 14 deletions(-) create mode 100644 site/src/components/Landing.astro create mode 100644 site/src/lib/landing-demo.ts create mode 100644 site/src/scripts/landing.ts create mode 100644 site/src/styles/landing.css create mode 100644 site/tests/browser/landing.spec.ts diff --git a/README.md b/README.md index 38ebf52..f13f15e 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,18 @@ npm run test:browser # インストール済みChromeを使う場合:CHROME_PATH=/path/to/chrome npm run test:browser ``` -テストはクライアントJavaScriptを無効にして実行し、スクリーンショットを`site/test-results/`へ保存します。サブパスbuildの検証時は同じ`SITE_BASE`を設定してください。 +Bookの閲覧テストはJavaScript無効、ランディングのテストは有効にして実行します。スクリーンショットは`site/test-results/`に保存され、ランディングは6場面をデスクトップ/モバイルで記録します。サブパスbuildの検証時は同じ`SITE_BASE`を設定してください。テスト用previewは`127.0.0.1:4322`を使用し、4321のdev serverとは別に起動します。 + +### ランディング + +トップはSVGのルートマークから始まります。クリック・ホイール/タッチスクロール・キー入力のいずれか一回で、約6.2秒のタイムラインを最後まで再生します。追加入力で段階を進めたり、再生を重ねたりはしません。Escapeまたは画面右下のスキップで直ちにデモへ移れます。ブラウザの修飾キー付きショートカットは妨げません。 + +- `src/components/Landing.astro` — SVGと、最終的に操作するツリー/パネルの静的HTML。 +- `src/scripts/landing.ts` — 単一の`requestAnimationFrame`時計、役割別の速度曲線、等弧長で円をほどくSVG path、ツリー操作。 +- `src/lib/landing-demo.ts` — ブラウザ内だけで使うサンプル。外部Hostへの接続、変更操作、通信はありません。Object signatureとInterface signatureを分け、本文は明示的なCallで表示します。 +- `src/styles/landing.css` — トップ全体を14pxのmonoフォント・24pxの行高で構成。フレーム幅を4ch単位に揃え、列・ガター・パディングもセルと行の整数倍にします。ツリーはSVGの線ではなく`├──`・`└──`・`│`などの罫線素片を使い、JavaScript無効時も同じ構造を表示します。モバイルはツリーとパネルを縦に配置します。 + +`prefers-reduced-motion: reduce`では演出を省略し、操作可能なデモを表示します。JavaScript無効時は静的なサンプルと説明・Bookリンクを表示し、モジュール取得失敗時も導入画面に閉じ込めません。再確認はページのリロードで行えます。 ## 文書の編集 diff --git a/site/playwright.config.ts b/site/playwright.config.ts index 01eb65d..510f5f9 100644 --- a/site/playwright.config.ts +++ b/site/playwright.config.ts @@ -5,7 +5,7 @@ const base = process.env.SITE_BASE?.replace(/\/$/, '') || ''; export default defineConfig({ testDir: './tests/browser', use: { - baseURL: `http://127.0.0.1:4321${base}/`, + baseURL: `http://127.0.0.1:4322${base}/`, javaScriptEnabled: false, launchOptions: { executablePath: process.env.CHROME_PATH }, }, @@ -14,8 +14,8 @@ export default defineConfig({ { name: 'mobile', use: { viewport: { width: 390, height: 844 } } }, ], webServer: { - command: 'npm run preview -- --host 127.0.0.1 --port 4321', - url: `http://127.0.0.1:4321${base}/`, + command: 'npm run preview -- --host 127.0.0.1 --port 4322 --ignore-lock', + url: `http://127.0.0.1:4322${base}/`, reuseExistingServer: false, }, }); diff --git a/site/src/components/Landing.astro b/site/src/components/Landing.astro new file mode 100644 index 0000000..c38afc8 --- /dev/null +++ b/site/src/components/Landing.astro @@ -0,0 +1,74 @@ +--- +import { objects, initialObject, childrenOf, treePrefix, objectSignature, interfaceSignature } from '../lib/landing-demo'; +import { href } from '../lib/book'; +import '../styles/landing.css'; +--- +
+ +
EVERY WORLD BEGINS AT A ROOT.

Click · Scroll · Press any key

+ + +
+
+

FROM A ROOT, A WORLD.

ひとつの入口から、
できることが見えてくる。

+ INTERACTIVE / LOCAL DEMO +
+
+
+
+
01 / WORLDSPACE↑ ↓ navigate · ← → expand
+
+ {objects.map((object) => { + const root = object.path === '/'; + const children = childrenOf(object.path); + return
+ {!root && } + + {root && <>worldspace} +
; + })} +
+
+
+

02 / Text View

OBJECT SIGNATURE
+
{objectSignature(initialObject)}
+

選択したObjectの公開情報。本文はOperationで取得します。

+
+
+
+

03 / Call result

EXPLICIT ACTION
+
TARGET{initialObject.path}
+
{interfaceSignature(initialObject)}
+
/::issue.read#read_body
+
+
RETURN / bodyREADY
+
// Operationを選び、Callで本文を取得。
// このデモはブラウザ内だけで動作します。
+
+

ローカルサンプル — 外部への通信や変更は行いません。

+
+
+ + +
+
+ diff --git a/site/src/layouts/Site.astro b/site/src/layouts/Site.astro index 3ebb073..e0ba13a 100644 --- a/site/src/layouts/Site.astro +++ b/site/src/layouts/Site.astro @@ -1,14 +1,23 @@ --- import '../styles/global.css'; import { href, repository } from '../lib/book'; -interface Props { title?: string; description?: string; book?: boolean; } -const { title = 'Web Interface Protocol', description = 'デジタル環境を、発見・観測・操作できるWorldspaceへ。WIPのコンセプトと仕様を読む。', book = false } = Astro.props; +interface Props { title?: string; description?: string; book?: boolean; landing?: boolean; } +const { title = 'Web Interface Protocol', description = 'デジタル環境を、発見・観測・操作できるWorldspaceへ。WIPのコンセプトと仕様を読む。', book = false, landing = false } = Astro.props; const canonical = Astro.site ? new URL(Astro.url.pathname, Astro.site) : undefined; --- + {landing && } {title} · WIP @@ -19,7 +28,7 @@ const canonical = Astro.site ? new URL(Astro.url.pathname, Astro.site) : undefin - +