diablo2-web/net.html

47 lines
2.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>d2web · 联机合作(M5)</title>
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: #0d0b09; color: #e8dcc8;
font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
header { padding: 10px 16px; border-bottom: 1px solid #33291f;
display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
h1 { font-size: 14px; margin: 0; color: #c8a15a; letter-spacing: .06em; }
a { color: #c8a15a; }
#net { color: #9c8d78; }
#net b { color: #c8a15a; font-weight: 600; }
#net .bad { color: #d96a5a; }
#status { margin: 10px 16px 6px; color: #9c8d78; }
#peers { margin: 0 16px 8px; color: #9c8d78; }
#peers span.you { color: #7fd08a; }
canvas { display: block; margin: 0 16px; background: #000; border: 1px solid #33291f;
width: 960px; height: 560px; }
#help { margin: 8px 16px 16px; color: #6f6252; max-width: 900px; }
</style>
</head>
<body>
<header>
<h1>d2web · 双人联机合作</h1>
<a href="/">资源检查器</a>
<a href="/map.html?data=samples/fixtures">单人地图场景</a>
<span id="net">未联机</span>
</header>
<p id="status">正在加载地图…</p>
<div id="peers"></div>
<canvas id="view" width="960" height="560"></canvas>
<p id="help">
移动 WASD / 方向键,空格或 J 攻击。每个浏览器页开一个(2–4 人都可以,人数用
<code>&amp;peers=</code> 指定,<code>&amp;peer=</code> 是本页编号):
<code>?data=samples/fixtures&amp;ws=ws://127.0.0.1:8787&amp;peers=3&amp;peer=0</code>,
另外两页把 <code>peer</code> 换成 1 和 2。世界由每台机器各自模拟,网络上只传按键;
同一 tick 的哈希不一致时页面会立刻报出分歧。
</p>
<script type="module" src="/src/scene/net-scene.ts"></script>
</body>
</html>