Pabloler21 Claude Opus 4.8 commited on
Commit
c304ef4
·
1 Parent(s): 38eac0e

fix(game): finale cues play after the line (not cutting it) + hide chat scrollbar

Browse files

- one-shot finale audios (sigh/flatline/sting) carried class=cue-audio and
route through the client voice queue instead of autoplaying, so the relief
sigh no longer talks over the child's still-playing line. Looping heartbeat
unchanged.
- hide the inner chatbot scroll thumb (the stray purple bar right of the text).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Files changed (3) hide show
  1. app.py +2 -2
  2. render.py +3 -3
  3. styles.css +4 -0
app.py CHANGED
@@ -323,8 +323,8 @@ _HEAD_JS = """
323
  m.addedNodes.forEach(function (n) {
324
  if (n.nodeType !== 1) return;
325
  var nodes = [];
326
- if (n.matches && n.matches('.voice-channel audio')) nodes.push(n);
327
- if (n.querySelectorAll) n.querySelectorAll('.voice-channel audio').forEach(function (x) { nodes.push(x); });
328
  nodes.forEach(function (a) { enqueue(a.currentSrc || a.src); a.remove(); });
329
  });
330
  });
 
323
  m.addedNodes.forEach(function (n) {
324
  if (n.nodeType !== 1) return;
325
  var nodes = [];
326
+ if (n.matches && n.matches('.voice-channel audio, audio.cue-audio')) nodes.push(n);
327
+ if (n.querySelectorAll) n.querySelectorAll('.voice-channel audio, audio.cue-audio').forEach(function (x) { nodes.push(x); });
328
  nodes.forEach(function (a) { enqueue(a.currentSrc || a.src); a.remove(); });
329
  });
330
  });
render.py CHANGED
@@ -159,7 +159,7 @@ def render_entity(affinity: int, mode: str = "idle", seq: int = 0,
159
  ghost = (
160
  '<div class="entity-ghost entity-ghost-frenzy" '
161
  f"style=\"background-image:url('{_src('terror')}')\"></div>"
162
- f'<audio autoplay src="data:audio/wav;base64,{_STING}"></audio>'
163
  )
164
  tint = '<div class="entity-rage-tint"></div>'
165
  elif mode == "convulse_good":
@@ -224,7 +224,7 @@ def render_entity(affinity: int, mode: str = "idle", seq: int = 0,
224
  'drop-shadow(0 0 42px rgba(90,70,120,0.20));opacity:1;">'
225
  "</div>"
226
  )
227
- ghost = f'<audio autoplay src="data:audio/wav;base64,{_FLATLINE}"></audio>'
228
  elif mode == "peace":
229
  # redemption: the first true smile, fully clear, no ghost, no menace
230
  figure = (
@@ -248,7 +248,7 @@ def render_entity(affinity: int, mode: str = "idle", seq: int = 0,
248
  'drop-shadow(0 0 54px rgba(120,100,160,0.22));opacity:1;">'
249
  "</div>"
250
  )
251
- ghost = f'<audio autoplay src="data:audio/wav;base64,{_SIGH}"></audio>'
252
  elif mode == "peace_dissolve":
253
  # the happy child dissolves into the fog — released, not taken
254
  figure = (
 
159
  ghost = (
160
  '<div class="entity-ghost entity-ghost-frenzy" '
161
  f"style=\"background-image:url('{_src('terror')}')\"></div>"
162
+ f'<audio class="cue-audio" src="data:audio/wav;base64,{_STING}"></audio>'
163
  )
164
  tint = '<div class="entity-rage-tint"></div>'
165
  elif mode == "convulse_good":
 
224
  'drop-shadow(0 0 42px rgba(90,70,120,0.20));opacity:1;">'
225
  "</div>"
226
  )
227
+ ghost = f'<audio class="cue-audio" src="data:audio/wav;base64,{_FLATLINE}"></audio>'
228
  elif mode == "peace":
229
  # redemption: the first true smile, fully clear, no ghost, no menace
230
  figure = (
 
248
  'drop-shadow(0 0 54px rgba(120,100,160,0.22));opacity:1;">'
249
  "</div>"
250
  )
251
+ ghost = f'<audio class="cue-audio" src="data:audio/wav;base64,{_SIGH}"></audio>'
252
  elif mode == "peace_dissolve":
253
  # the happy child dissolves into the fog — released, not taken
254
  figure = (
styles.css CHANGED
@@ -1688,6 +1688,10 @@ footer { display: none !important; }
1688
  padding: 0 !important;
1689
  overflow: hidden; /* old lines fade out, no scrollbar */
1690
  }
 
 
 
 
1691
  /* transparent rows, centered text — kill Gradio's bubble chrome */
1692
  #game-dialogue .message-row,
1693
  #game-dialogue .message,
 
1688
  padding: 0 !important;
1689
  overflow: hidden; /* old lines fade out, no scrollbar */
1690
  }
1691
+ /* kill the inner scroll thumb Gradio shows on the message area (the stray
1692
+ purple vertical bar to the right of the subtitle) */
1693
+ #game-dialogue, #game-dialogue * { scrollbar-width: none !important; }
1694
+ #game-dialogue ::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
1695
  /* transparent rows, centered text — kill Gradio's bubble chrome */
1696
  #game-dialogue .message-row,
1697
  #game-dialogue .message,