tfrere HF Staff Cursor commited on
Commit
ee2d470
·
1 Parent(s): ab9dec2

feat: ZQSD turn keys + wordmark-only welcome modal

Browse files

- 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>

Files changed (3) hide show
  1. assets/logo-duck.png +0 -3
  2. index.html +4 -16
  3. rl.js +6 -3
assets/logo-duck.png DELETED

Git LFS Details

  • SHA256: 976af27e4c25e1b8b7afb6e30aa4bde33752d9ea451a0a1f39e8c13c4a98cf1a
  • Pointer size: 131 Bytes
  • Size of remote file: 165 kB
index.html CHANGED
@@ -281,21 +281,11 @@
281
  from { transform: translateY(18px) scale(0.94); opacity: 0; }
282
  to { transform: none; opacity: 1; }
283
  }
284
- #welcome .logo-duck {
285
- display: block;
286
- height: 7.5rem;
287
- margin: 0 auto 0.4rem;
288
- filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
289
- animation: badge-bob 3.2s ease-in-out infinite;
290
- }
291
- @keyframes badge-bob {
292
- 0%, 100% { transform: translateY(0) rotate(-2deg); }
293
- 50% { transform: translateY(-6px) rotate(2deg); }
294
- }
295
  #welcome .logo-wordmark {
296
  display: block;
297
  width: min(78%, 300px);
298
- margin: 0 auto;
 
299
  }
300
  #welcome .subtitle {
301
  margin-top: 0.55rem;
@@ -410,7 +400,6 @@
410
 
411
  <div id="welcome" hidden>
412
  <div class="card" role="dialog" aria-modal="true" aria-label="Microduck playground">
413
- <img class="logo-duck" id="logo-duck" alt="" />
414
  <img class="logo-wordmark" id="logo-wordmark" alt="Microduck" />
415
  <div class="subtitle">RL playground</div>
416
  <p class="tagline">
@@ -419,7 +408,7 @@
419
  at 50&nbsp;Hz. No server, no pre-baked animation.
420
  </p>
421
  <ul>
422
- <li><b>Move</b><span>Arrow keys to run and turn, A / E to strafe, drag to orbit.</span></li>
423
  <li><b>Roll</b><span>Space triggers a barrel roll, then it gets back up.</span></li>
424
  <li><b>Gamepad</b><span>Plug one in - same mapping as the real robot.</span></li>
425
  <li><b>Ghosts</b><span>Other visitors right now appear as translucent ducks, live.</span></li>
@@ -438,7 +427,6 @@
438
  // on the private Space (rl.js hasn't installed its signer yet).
439
  const sign = new URLSearchParams(location.search).get("__sign");
440
  const signedUrl = (u) => (sign ? `${u}?__sign=${encodeURIComponent(sign)}` : u);
441
- document.getElementById("logo-duck").src = signedUrl("./assets/logo-duck.png");
442
  document.getElementById("logo-wordmark").src = signedUrl("./assets/logo-wordmark.png");
443
  const open = () => {
444
  modal.hidden = false;
@@ -470,7 +458,7 @@
470
  appended: a plain src attribute can 401 when the browser blocks the
471
  *.static.hf.space auth cookie inside the hub iframe. -->
472
  <script type="module">
473
- const V = "21"; // bump on rl.js changes to defeat heuristic caching
474
  const sign = new URLSearchParams(location.search).get("__sign");
475
  const suffix = sign ? `&__sign=${encodeURIComponent(sign)}` : "";
476
  import(`./rl.js?v=${V}${suffix}`);
 
281
  from { transform: translateY(18px) scale(0.94); opacity: 0; }
282
  to { transform: none; opacity: 1; }
283
  }
 
 
 
 
 
 
 
 
 
 
 
284
  #welcome .logo-wordmark {
285
  display: block;
286
  width: min(78%, 300px);
287
+ margin: 0.3rem auto 0;
288
+ filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
289
  }
290
  #welcome .subtitle {
291
  margin-top: 0.55rem;
 
400
 
401
  <div id="welcome" hidden>
402
  <div class="card" role="dialog" aria-modal="true" aria-label="Microduck playground">
 
403
  <img class="logo-wordmark" id="logo-wordmark" alt="Microduck" />
404
  <div class="subtitle">RL playground</div>
405
  <p class="tagline">
 
408
  at 50&nbsp;Hz. No server, no pre-baked animation.
409
  </p>
410
  <ul>
411
+ <li><b>Move</b><span>Arrows or ZQSD to run and turn, A / E to strafe, drag to orbit.</span></li>
412
  <li><b>Roll</b><span>Space triggers a barrel roll, then it gets back up.</span></li>
413
  <li><b>Gamepad</b><span>Plug one in - same mapping as the real robot.</span></li>
414
  <li><b>Ghosts</b><span>Other visitors right now appear as translucent ducks, live.</span></li>
 
427
  // on the private Space (rl.js hasn't installed its signer yet).
428
  const sign = new URLSearchParams(location.search).get("__sign");
429
  const signedUrl = (u) => (sign ? `${u}?__sign=${encodeURIComponent(sign)}` : u);
 
430
  document.getElementById("logo-wordmark").src = signedUrl("./assets/logo-wordmark.png");
431
  const open = () => {
432
  modal.hidden = false;
 
458
  appended: a plain src attribute can 401 when the browser blocks the
459
  *.static.hf.space auth cookie inside the hub iframe. -->
460
  <script type="module">
461
+ const V = "22"; // bump on rl.js changes to defeat heuristic caching
462
  const sign = new URLSearchParams(location.search).get("__sign");
463
  const suffix = sign ? `&__sign=${encodeURIComponent(sign)}` : "";
464
  import(`./rl.js?v=${V}${suffix}`);
rl.js CHANGED
@@ -553,11 +553,14 @@ function refreshVelCmd() {
553
  velCmd[2] = held.has("turnl") ? VEL_ANG : held.has("turnr") ? -VEL_ANG : 0;
554
  }
555
 
 
 
556
  const KEYMAP = {
557
- ArrowUp: "fwd", KeyW: "fwd", KeyZ: "fwd",
558
  ArrowDown: "back", KeyS: "back",
559
- ArrowLeft: "turnl", ArrowRight: "turnr",
560
- KeyA: "left", KeyQ: "left", KeyE: "right", KeyD: "right",
 
561
  };
562
 
563
  window.addEventListener("keydown", (e) => {
 
553
  velCmd[2] = held.has("turnl") ? VEL_ANG : held.has("turnr") ? -VEL_ANG : 0;
554
  }
555
 
556
+ // e.code is physical position, so one map covers QWERTY and AZERTY:
557
+ // WASD/ZQSD run + turn, the physical Q/E row (A/E on AZERTY) strafes.
558
  const KEYMAP = {
559
+ ArrowUp: "fwd", KeyW: "fwd",
560
  ArrowDown: "back", KeyS: "back",
561
+ ArrowLeft: "turnl", KeyA: "turnl",
562
+ ArrowRight: "turnr", KeyD: "turnr",
563
+ KeyQ: "left", KeyE: "right",
564
  };
565
 
566
  window.addEventListener("keydown", (e) => {