Screen Simulators

作品を実世界のスクリーンへ投影したときの見え方を、ブラウザ上で簡易的にシミュレートする ライブラリを配布するサイトです。作品の HTML に1行 <script> を 追加するだけで、投影モードに切り替えられます。

A collection of libraries that simulate — right in the browser — how a work looks when shown on real-world screens. Add a single <script> line to your work's HTML to switch into simulation mode.

Libraries

AxCROSS Projection Simulator WIDE / 8950×1080

KITTE大阪4F「AxCROSS」(W18m × H2.5m、8950×1080px、プロジェクター5台)への プロジェクションを、会場写真の上でシミュレートします。AxCROSS の2つの放映 フォーマット — ①全面表示(full・ウィンドウサイズ可変の作品)と ②16:9を中央に4面配置(tile・両サイドは黒余白)— を切り替えて 確認でき、床への映り込みや放映ローテーション(一定時間で次のコンテンツへ切替)も シミュレートできます。

Simulates projection onto "AxCROSS" (KITTE Osaka 4F — W18m × H2.5m, 8950×1080 px, 5 projectors) over a photo of the space. Toggle between the two AxCROSS display formats — (1) full-width (full, for window-size-responsive works) and (2) four 16:9 tiles centered with black margins (tile) — and simulate the floor reflection and the playback rotation (content switches after a fixed interval).

<script src="https://neort-screen-simulators.vercel.app/axcross.js"></script>
サンプルコードを見るView sample code

① HTML — data 属性で事前設定① HTML — preset via data attributes

<script src="https://neort-screen-simulators.vercel.app/axcross.js"
        data-mode="tile"     // 16:9 作品を中央に4面配置
        data-rotate="15"     // 約15秒放映→切替 をシミュレート
        data-seams="true">  // プロジェクター5台の継ぎ目
</script>
<script src="https://neort-screen-simulators.vercel.app/axcross.js"
        data-mode="tile"     // four 16:9 tiles, centered
        data-rotate="15"     // simulate ~15s playback rotation
        data-seams="true">  // seams of the 5 projectors
</script>

② sketch.js — コードから制御② sketch.js — control from code

window.onNeortAxCrossReady = function (ax) {
  ax.setMode('full');    // 'full'(①全面) | 'tile'(②16:9×4)
  ax.setRotate(15);      // 0 で常時表示
};

// 作品側の UI から随時呼ぶことも可能
window.addEventListener('keydown', function (e) {
  if (e.key === ' ') NeortAxCross.toggle();
});
window.onNeortAxCrossReady = function (ax) {
  ax.setMode('full');    // 'full' (whole screen) | 'tile' (16:9 ×4)
  ax.setRotate(15);      // 0 = always on
};

// or call it any time from the artwork's own UI
window.addEventListener('keydown', function (e) {
  if (e.key === ' ') NeortAxCross.toggle();
});

Open Cube LED Simulator CUBE / 6-FACE

二子玉川ライズ「Open Cube」型の6面キューブ LED に作品を投影したときの見え方を シミュレートします。作品の <canvas> を検出し、回転可能な 立方体の各面へライブ投影します(依存ライブラリなし)。

Simulates how a work looks on the 6-face "Open Cube" LED at Futako-Tamagawa Rise. It detects the work's <canvas> and live-projects it onto the faces of a rotatable cube (no dependencies).

<script src="https://neort-screen-simulators.vercel.app/cube.js"></script>

通常表示 ⇄ シミュレーションの切替、1面の4分割(data-face-split="2x2")、 回転速度(data-speed / 停止・高速化)などを data 属性と window.NeortCube API から調整できます。

Toggle between normal and simulation view, split each face into panels (data-face-split="2x2") and control the rotation speed (data-speed / stop / faster) via data attributes and the window.NeortCube API.

サンプルコードを見るView sample code

① HTML — data 属性で事前設定① HTML — preset via data attributes

<script src="https://neort-screen-simulators.vercel.app/cube.js"
        data-face-split="2x2"   // 1面を4分割
        data-speed="0"          // 回転を止めて開始
        data-start="artwork">  // 通常表示から開始
</script>
<script src="https://neort-screen-simulators.vercel.app/cube.js"
        data-face-split="2x2"   // split each face into 4 panels
        data-speed="0"          // start with rotation stopped
        data-start="artwork">  // start in normal artwork view
</script>

② sketch.js — コードから制御② sketch.js — control from code

// NeortCube はキューブ構築後に使えるようになるので、
// onNeortCubeReady に書けば確実に反映されます
window.onNeortCubeReady = function (cube) {
  cube.setFaceSplit('2x2');
  cube.setSpeed(0);       // 停止(1.5 で高速化)
  cube.setMode('tile');
};

// 作品側の UI から随時呼ぶことも可能
window.addEventListener('keydown', function (e) {
  if (e.key === ' ') NeortCube.toggle();
});
// NeortCube only exists after the cube is built, so
// configure it inside onNeortCubeReady to be safe
window.onNeortCubeReady = function (cube) {
  cube.setFaceSplit('2x2');
  cube.setSpeed(0);       // stop (1.5 = faster)
  cube.setMode('tile');
};

// or call it any time from the artwork's own UI
window.addEventListener('keydown', function (e) {
  if (e.key === ' ') NeortCube.toggle();
});

Live Code Terminal CODE / OVERLAY

作品の上に、その作品自身の実行中コードをターミナル風に表示します。 ページの JS / CSS / HTML を自動収集し、黒透過レイヤー越しに作品を見せながら 行番号付きでコードを一覧できます(依存ライブラリなし・作品の操作はそのまま可能)。

Shows the work's own running source code over the artwork, terminal style. It collects the page's JS / CSS / HTML automatically and lists it with line numbers on a translucent black layer, with the artwork visible through it (no dependencies; the artwork stays fully interactive).

<script src="https://neort-screen-simulators.vercel.app/code.js"></script>

表示言語の切替(data-lang="js|css|html|all" +内蔵ボタン)、 カラーテーマ(data-theme="green|amber|ice|mono"data-colors でトークン別カスタムも可)、行番号の有無・背景の暗さ・ 文字サイズなどを data 属性と window.NeortCode API から調整できます。 コードが画面より長いときはホイール / スワイプでスクロールできます。

Switch the displayed language (data-lang="js|css|html|all" plus a built-in button), pick a color theme (data-theme="green|amber|ice|mono", with per-token overrides via data-colors), and adjust line numbers, background darkness and font size via data attributes and the window.NeortCode API. When the code is longer than the screen, scroll with wheel / swipe.

サンプルコードを見るView sample code

① HTML — data 属性で事前設定① HTML — preset via data attributes

<script src="https://neort-screen-simulators.vercel.app/code.js"
        data-lang="all"          // HTML→CSS→JS をまとめて表示
        data-theme="amber"       // 琥珀色ターミナル
        data-opacity="0.7">     // 背景をより暗く
</script>
<script src="https://neort-screen-simulators.vercel.app/code.js"
        data-lang="all"          // show HTML→CSS→JS in sequence
        data-theme="amber"       // amber terminal
        data-opacity="0.7">     // darker background
</script>

② sketch.js — コードから制御② sketch.js — control from code

// NeortCode はコード収集後に使えるようになるので、
// onNeortCodeReady に書けば確実に反映されます
window.onNeortCodeReady = function (code) {
  code.setLang('css');                    // 'js' | 'css' | 'html' | 'all'
  code.setTheme('ice');                   // テーマ切替
  code.setColors({ string: '#f80' });     // トークン別に上書き
};

// 作品側の UI から随時呼ぶことも可能
window.addEventListener('keydown', function (e) {
  if (e.key === 'c') NeortCode.toggle();
});
// NeortCode only exists after the page's code is collected,
// so configure it inside onNeortCodeReady to be safe
window.onNeortCodeReady = function (code) {
  code.setLang('css');                    // 'js' | 'css' | 'html' | 'all'
  code.setTheme('ice');                   // switch color theme
  code.setColors({ string: '#f80' });     // per-token overrides
};

// or call it any time from the artwork's own UI
window.addEventListener('keydown', function (e) {
  if (e.key === 'c') NeortCode.toggle();
});

Live Debugger DEBUG / STEP

作品自身のコードを、ページの UI 上で "デバッグ実行" します。行番号のクリックで ブレークポイントを置き、Pause / Step(1文ずつ)/ Continue / Restart で実行を 制御できます。一時停止中はキャンバスが描画途中のまま静止するので、 1文ごとに絵が現れていく過程をそのまま観察できます(依存ライブラリなし・ パーサ同梱のため約140KB)。

"Debug-runs" the work's own code right in the page's UI. Click a line number to set a breakpoint, then control execution with Pause / Step (one statement) / Continue / Restart. While paused the canvas freezes mid-frame, so you can watch the drawing appear statement by statement (no dependencies; ~140KB with the bundled parser).

<script src="https://neort-screen-simulators.vercel.app/debug.js"></script>

コードを解析(同梱の acorn)して全関数を async 化・全文にゲートを挿入した複製を iframe 内で実行する方式です。constructor / getter / setter、式本体のアロー関数、 クロスオリジンのライブラリ(CDN の p5.js 等)の内部では停止できません。

It re-parses the code (bundled acorn), makes every function async, inserts a suspendable gate before every statement, and runs that copy in an iframe. It cannot pause inside constructors / getters / setters, expression-bodied arrows, or cross-origin libraries (CDN p5.js etc.).

サンプルコードを見るView sample code

① HTML — data 属性で事前設定① HTML — preset via data attributes

<script src="https://neort-screen-simulators.vercel.app/debug.js"
        data-start="simulation"  // デバッグ表示から開始(既定は作品表示)
        data-opacity="0.7">     // コードレイヤーの暗さ
</script>
<script src="https://neort-screen-simulators.vercel.app/debug.js"
        data-start="simulation"  // open in debug view (default: artwork)
        data-opacity="0.7">     // darkness of the code layer
</script>

② sketch.js — コードから制御② sketch.js — control from code

window.onNeortDebugReady = function (dbg) {
  // dbg.pause() / dbg.resume() / dbg.step() / dbg.restart()
};

// 作品側の UI から随時呼ぶことも可能
window.addEventListener('keydown', function (e) {
  if (e.key === 'd') NeortDebug.toggle();
  if (e.key === 's') NeortDebug.step();
});
window.onNeortDebugReady = function (dbg) {
  // dbg.pause() / dbg.resume() / dbg.step() / dbg.restart()
};

// or call it any time from the artwork's own UI
window.addEventListener('keydown', function (e) {
  if (e.key === 'd') NeortDebug.toggle();
  if (e.key === 's') NeortDebug.step();
});

Quick start

作品の HTML に <script> を1行足すだけで動きます。 初期設定は data 属性、実行時の制御は各ライブラリの window.* API で行えます。どちらも HTML / sketch.js に事前に書いておけます。 具体例は各ライブラリの「サンプルコードを見る」からどうぞ。

Everything works by adding a single <script> line to your work's HTML. Initial settings go in data attributes; runtime control goes through each library's window.* API. Both can be written ahead of time in your HTML / sketch.js. See "View sample code" in each library for concrete examples.