[object Object]

← back to Dead Agentabrams

Sync ROOM 01: Dancing Bears count slider (1-10)

292a3a60e24cbfbde9ae69927a6629e8a762c3cf · 2026-09-01 22:06:59 -0700 · Steve Abrams

Files touched

Diff

commit 292a3a60e24cbfbde9ae69927a6629e8a762c3cf
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Sep 1 22:06:59 2026 -0700

    Sync ROOM 01: Dancing Bears count slider (1-10)
---
 room/index.html | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/room/index.html b/room/index.html
index 54fb9a7..c717101 100644
--- a/room/index.html
+++ b/room/index.html
@@ -280,6 +280,10 @@
         <label for="animals">Animal Visibility <span class="val" id="animalsV">All</span></label>
         <input type="range" id="animals" min="0" max="100" value="100" aria-valuetext="All">
       </div>
+      <div class="field">
+        <label for="bears">Dancing Bears <span class="val" id="bearsV">3</span></label>
+        <input type="range" id="bears" min="1" max="10" value="3" step="1" aria-valuetext="3">
+      </div>
     </div>
   </div>
 
@@ -328,6 +332,7 @@ const S = {
   lantern: 0.7,
   crowd: 0.8,
   animals: 1.0,
+  bears: 3,           // dancing-bear count (1..10)
   cam: 'wide',        // wide | deck | over
   chapter: 0,         // 0..2 (target)
   chapterMix: 0,      // eased 0..2 for palette blend
@@ -777,7 +782,7 @@ function drawAnimals(){
   heron(W*0.40, baseY-4, 1*scaleA, t, accent);
   rabbit(W*0.63, baseY-4, 1*scaleA, t, accent);
   bearAndFireflies(W*0.85, baseY-2, 1.1*scaleA, t, accent);
-  drawBearCubs(W*0.85, baseY-2, t, scaleA);
+  drawBearCubs(t, scaleA, baseY);
   drawSongbirds(t, scaleA, baseY);
 
   ctx.restore();
@@ -914,10 +919,17 @@ function bearCub(x,y,s,t,ph,FUR){
   ctx.fillStyle=OUTLINE; ctx.beginPath(); ctx.arc(0,-29,1.1,0,7); ctx.fill();      // nose
   ctx.restore();
 }
-function drawBearCubs(bx,by,t,scaleA){   // a colorful dancing-bear troupe (our own design, not the GD trademark)
-  bearCub(bx-70, by, 1.00*scaleA, t, 0.0, 'rgba(206,66,116,0.98)');   // rose
-  bearCub(bx+50, by, 0.96*scaleA, t, 1.6, 'rgba(232,160,52,0.98)');   // gold
-  bearCub(bx+104,by, 0.90*scaleA, t, 3.1, 'rgba(72,172,150,0.98)');   // teal
+// a user-sized colorful dancing-bear troupe (1..10), auto-distributed + scaled across the shore (our own design, not the GD trademark)
+const BEAR_COLORS=['rgba(206,66,116,0.98)','rgba(232,160,52,0.98)','rgba(72,172,150,0.98)','rgba(124,110,224,0.98)','rgba(226,96,60,0.98)','rgba(96,182,96,0.98)','rgba(232,120,182,0.98)','rgba(82,158,224,0.98)','rgba(214,182,60,0.98)','rgba(154,92,204,0.98)'];
+function drawBearCubs(t,scaleA,baseY){
+  const W=S.W, N=Math.max(1,Math.min(10,Math.round(S.bears)));
+  const margin=W*0.05, span=W-2*margin;
+  const size=Math.max(0.9, Math.min(2.1, 13/(N+2.5)))*scaleA;   // fewer bears bigger, more bears smaller to fit
+  for(let i=0;i<N;i++){
+    const x = (N===1) ? W*0.16 : margin + span*(i/(N-1));
+    const yj = ((i*53)%9)-4;                                    // slight stagger so the row isn't a flat line
+    bearCub(x, baseY+8+yj, size, t, i*1.3, BEAR_COLORS[i%BEAR_COLORS.length]);
+  }
 }
 
 // shoreline songbirds that "sing" the music — note-bubbles pop on the beat (♪♫♬, never lyrics)
@@ -1134,6 +1146,14 @@ wireSlider('lantern','lanternV',lanternWords,val=>S.lantern=val);
 wireSlider('crowd','crowdV',crowdWords,val=>S.crowd=val);
 wireSlider('animals','animalsV',animalWords,val=>S.animals=val);
 
+// Dancing Bears count (1..10) — plain integer slider
+const bearsEl=document.getElementById('bears');
+bearsEl.addEventListener('input',e=>{
+  S.bears=+e.target.value; const v=String(S.bears);
+  document.getElementById('bearsV').textContent=v; e.target.setAttribute('aria-valuetext',v);
+  announce(v+' dancing '+(S.bears==1?'bear':'bears')+'.');
+});
+
 // Sync every label to its true computed word on load (no hardcoded mismatch)
 ['tempo','lantern','crowd','animals'].forEach(id=>{
   document.getElementById(id).dispatchEvent(new Event('input'));

← c315f1a Sync ROOM 01: colorful dancing-bear troupe synced to music  ·  back to Dead Agentabrams  ·  Sync ROOM 01: dancing bears on the boat decks 8f3ddb3 →