<!-- RUBY-BACKUP · part 81 -->
or3().subVectors(pt,mouseGrab.worldPt);
    f.group.position.copy(mouseGrab.groupPos).add(delta);
  }
  e.preventDefault();
}
function onMouseUp(){
  if(mouseGrab){ mouseGrab.frame.driven[mouseGrab.corner]=false; mouseGrab=null; }
}

/* ---------------- wire it up ---------------- */
function init(){
  var cv=document.getElementById('view');
  if(cv){
    cv.addEventListener('touchstart',onTouchStart,{passive:false,capture:true});
    cv.addEventListener('touchmove',onTouchMove,{passive:false,capture:true});
    cv.addEventListener('touchend',onTouchEnd,{passive:false,capture:true});
    cv.addEventListener('touchcancel',onTouchEnd,{passive:false,capture:true});
    cv.addEventListener('mousedown',onMouseDown,{capture:true});
    window.addEventListener('mousemove',onMouseMove,{capture:true});
    window.addEventListener('mouseup',onMouseUp,{capture:true});
  }
  /* codes: wrap runLine */
  try{
    var orig=window.runLine;
    window.runLine=function(line){
      var tl=String(line==null?'':line).trim().toLowerCase();
      if(tl==='ropedeform'){ spawnDeformDemo(); return; }
      if(tl==='ropedeformreset'){ resetDeformDemo(); return; }
      if(tl==='ropedeformclear'){ clearDeformDemo(); status('rope lab cleared'); return; }
      if(tl==='diamond'){ spawnDeformDemo(); status('pull opposite gold rings — make the diamond'); return; }
      if(typeof orig==='function') return orig(line);
    };
  }catch(e){}
}
if(document.readyState==='loading'){
  document.addEventListener('DOMContentLoaded',init);
}else{ init(); }

})();


===== FILE: public/ruby-backup/ruby-buttons.js =====
/* ============================================================================
   THE REGIME CHANGE — the one code fits all
   Named by the King, 2026-10-03. This is the single startup that loads
   every button, joystick, compass, and UI element on /ruby.
   ============================================================================
*/
/* GTA5 JET MODE — initialized on startup (King's order) */
(function(){
  window._jetThrottle = 0;
  window._flightStickX = 0;
  window._flightStickY = 0;
})();
/* Version banner */
(function(){
  var vb = document.createElement('div');
  vb.id = 'ruby-version';
  vb.style.cssText = 'position:fixed;top:2px;right:8px;font-size:10px;color:#d8a920;font-family:monospace;z-index:9999;opacity:0.7;pointer-events:none;';
  vb.textContent = 'v959 b102';
  document.body.appendChild(vb);
})();
/* No pinch-zoom — the game handles its own touches (King's order) */
(function(){
  document.addEventListener('gesturestart', function(e){ e.preventDefault(); }, {passive:false});
  document.addEventListener('gesturechange', function(e){ e.preventDefault(); }, {passive:false});
  document.addEventListener('gestureend', function(e){ e.preventDefault(); }, {passive:false});
  var st2 = document.createElement('style');
  st2.textContent = 'html, body{ touch-action: none !important; overscroll-behavior: none !important; } canvas{ touch-action: none !important; }';
  document.head.appendChild(st2);
})();
/* No copy-paste — the game is for playing, not selecting text (King's order) */
(function(){
  var st = document.createElement('style');
  st.textContent = '*{ -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; } input, textarea{ -webkit-user-select: text !important; user-select: text !important; }';
  document.head.appendChild(st);
})();
/*
   Rebuilt fresh 2026-10-03 by the King's order: "Make the OS again new."

   THE LAWS:
   - Gold buttons from /coders100, never changed, never on any other game.
   - The Human Thumb Law: every button tappable, no overlaps, nothing floats.
   - The old buttons are The Unjoyful Sticks — archived, never used.

   FEATURES:
   - CORE table: all game functions in gold
   - SOLID table: Solid's tools
   - Pulley: collapse the table home to the pulley button
   - Swipe: swipe table down/right to collapse
   - OS cycling: tap pulley to cycle through functions
   - Long-press pulley: reset cycle to start
   - Code box in CORE header
   - os1-osN codes for every function
   - The Hidden Station: Solid's heart, behind the map
   ============================================================================ */
(function(){
  'use strict';
  if(window.__rubyOS) return;
  window.__rubyOS = true;

  /* --------------------------------------------------------------------------
     Code pipeline
     -------------------------------------------------------------------------- */
  function code(c){
    if(window.runLine){ try{ window.runLine(c); }catch(e){} }
  }
  function say(m){
    if(window.say){ try{ window.say(m); }catch(e){} }
  }
  function status(m){
    try{ if(typeof codeStatus==='function') codeStatus(m); }catch(e){}
  }

  /* --------------------------------------------------------------------------
     Button factory — gold CORE style, thumb-sized, iOS-ready
     ------------------------------------