feat: ZQSD turn keys + wordmark-only welcome modal
- physical A/D keys (Q/D on AZERTY) now turn instead of strafing; strafe moves to the physical Q/E row (A/E on AZERTY) - welcome modal drops the floating duck sticker, keeps the wordmark Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
BIN
Binary file not shown.
+4
-16
@@ -281,21 +281,11 @@
|
||||
from { transform: translateY(18px) scale(0.94); opacity: 0; }
|
||||
to { transform: none; opacity: 1; }
|
||||
}
|
||||
#welcome .logo-duck {
|
||||
display: block;
|
||||
height: 7.5rem;
|
||||
margin: 0 auto 0.4rem;
|
||||
filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
|
||||
animation: badge-bob 3.2s ease-in-out infinite;
|
||||
}
|
||||
@keyframes badge-bob {
|
||||
0%, 100% { transform: translateY(0) rotate(-2deg); }
|
||||
50% { transform: translateY(-6px) rotate(2deg); }
|
||||
}
|
||||
#welcome .logo-wordmark {
|
||||
display: block;
|
||||
width: min(78%, 300px);
|
||||
margin: 0 auto;
|
||||
margin: 0.3rem auto 0;
|
||||
filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
|
||||
}
|
||||
#welcome .subtitle {
|
||||
margin-top: 0.55rem;
|
||||
@@ -410,7 +400,6 @@
|
||||
|
||||
<div id="welcome" hidden>
|
||||
<div class="card" role="dialog" aria-modal="true" aria-label="Microduck playground">
|
||||
<img class="logo-duck" id="logo-duck" alt="" />
|
||||
<img class="logo-wordmark" id="logo-wordmark" alt="Microduck" />
|
||||
<div class="subtitle">RL playground</div>
|
||||
<p class="tagline">
|
||||
@@ -419,7 +408,7 @@
|
||||
at 50 Hz. No server, no pre-baked animation.
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>Move</b><span>Arrow keys to run and turn, A / E to strafe, drag to orbit.</span></li>
|
||||
<li><b>Move</b><span>Arrows or ZQSD to run and turn, A / E to strafe, drag to orbit.</span></li>
|
||||
<li><b>Roll</b><span>Space triggers a barrel roll, then it gets back up.</span></li>
|
||||
<li><b>Gamepad</b><span>Plug one in - same mapping as the real robot.</span></li>
|
||||
<li><b>Ghosts</b><span>Other visitors right now appear as translucent ducks, live.</span></li>
|
||||
@@ -438,7 +427,6 @@
|
||||
// on the private Space (rl.js hasn't installed its signer yet).
|
||||
const sign = new URLSearchParams(location.search).get("__sign");
|
||||
const signedUrl = (u) => (sign ? `${u}?__sign=${encodeURIComponent(sign)}` : u);
|
||||
document.getElementById("logo-duck").src = signedUrl("./assets/logo-duck.png");
|
||||
document.getElementById("logo-wordmark").src = signedUrl("./assets/logo-wordmark.png");
|
||||
const open = () => {
|
||||
modal.hidden = false;
|
||||
@@ -470,7 +458,7 @@
|
||||
appended: a plain src attribute can 401 when the browser blocks the
|
||||
*.static.hf.space auth cookie inside the hub iframe. -->
|
||||
<script type="module">
|
||||
const V = "21"; // bump on rl.js changes to defeat heuristic caching
|
||||
const V = "22"; // bump on rl.js changes to defeat heuristic caching
|
||||
const sign = new URLSearchParams(location.search).get("__sign");
|
||||
const suffix = sign ? `&__sign=${encodeURIComponent(sign)}` : "";
|
||||
import(`./rl.js?v=${V}${suffix}`);
|
||||
|
||||
@@ -553,11 +553,14 @@ function refreshVelCmd() {
|
||||
velCmd[2] = held.has("turnl") ? VEL_ANG : held.has("turnr") ? -VEL_ANG : 0;
|
||||
}
|
||||
|
||||
// e.code is physical position, so one map covers QWERTY and AZERTY:
|
||||
// WASD/ZQSD run + turn, the physical Q/E row (A/E on AZERTY) strafes.
|
||||
const KEYMAP = {
|
||||
ArrowUp: "fwd", KeyW: "fwd", KeyZ: "fwd",
|
||||
ArrowUp: "fwd", KeyW: "fwd",
|
||||
ArrowDown: "back", KeyS: "back",
|
||||
ArrowLeft: "turnl", ArrowRight: "turnr",
|
||||
KeyA: "left", KeyQ: "left", KeyE: "right", KeyD: "right",
|
||||
ArrowLeft: "turnl", KeyA: "turnl",
|
||||
ArrowRight: "turnr", KeyD: "turnr",
|
||||
KeyQ: "left", KeyE: "right",
|
||||
};
|
||||
|
||||
window.addEventListener("keydown", (e) => {
|
||||
|
||||
Reference in New Issue
Block a user