henrywch2huggingface Claude Fable 5 commited on
Commit
764afa4
·
1 Parent(s): 67f8738

Scrollbars: thumb appears on rail-strip hover (no drawn rail), driven by a page script + scrollbar-color; covers chat and raw views.

Browse files
Files changed (1) hide show
  1. app.py +34 -10
app.py CHANGED
@@ -664,18 +664,18 @@ CSS = """
664
  /* live camera: no record/stop controls — the feed auto-starts (JS below) and
665
  frames only reach the model while a session is live (backend-gated) */
666
  #live-cam .button-wrap { display: none !important; }
667
- /* scrollbars: invisible until the pointer is over the thin scrollbar strip;
668
- no track rail, no arrow buttons. (Firefox has no thumb-hover selector, so
669
- it falls back to a thin transparent bar revealed on container hover.) */
670
- @supports not selector(::-webkit-scrollbar) {
671
- * { scrollbar-width: thin; scrollbar-color: transparent transparent; }
672
- *:hover { scrollbar-color: rgba(128, 128, 128, 0.45) transparent; }
673
- }
674
- ::-webkit-scrollbar { width: 8px; height: 8px; background: transparent !important; }
675
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent !important; }
676
  ::-webkit-scrollbar-button { display: none !important; width: 0 !important; height: 0 !important; }
677
- ::-webkit-scrollbar-thumb { background: transparent !important; border-radius: 4px; }
678
- ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background: rgba(128, 128, 128, 0.55) !important; }
 
679
  """
680
 
681
  # Page-load JS: (1) auto-start the live camera preview whenever the camera
@@ -689,6 +689,30 @@ CSS = """
689
  # the user has scrolled up to read.
690
  PAGE_JS = """
691
  () => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
  if (window.__mossCamWatch) return;
693
  window.__mossCamWatch = setInterval(() => {
694
  if (!window.__mossRawScroll) {
 
664
  /* live camera: no record/stop controls — the feed auto-starts (JS below) and
665
  frames only reach the model while a session is live (backend-gated) */
666
  #live-cam .button-wrap { display: none !important; }
667
+ /* scrollbars: no rail is drawn; the thumb is invisible until the pointer
668
+ enters the rail strip at the scrollable edge (.sb-hot, set by the page
669
+ script) or grabs the thumb itself. scrollbar-color drives modern
670
+ Chrome/Firefox; the ::-webkit rules cover older WebKit. */
671
+ * { scrollbar-width: thin; scrollbar-color: transparent transparent; }
672
+ .sb-hot { scrollbar-color: rgba(128, 128, 128, 0.55) transparent !important; }
673
+ ::-webkit-scrollbar { width: 10px; height: 10px; background: transparent !important; }
 
674
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent !important; }
675
  ::-webkit-scrollbar-button { display: none !important; width: 0 !important; height: 0 !important; }
676
+ ::-webkit-scrollbar-thumb { background: transparent; border-radius: 5px; }
677
+ .sb-hot::-webkit-scrollbar-thumb,
678
+ ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background: rgba(128, 128, 128, 0.6) !important; }
679
  """
680
 
681
  # Page-load JS: (1) auto-start the live camera preview whenever the camera
 
689
  # the user has scrolled up to read.
690
  PAGE_JS = """
691
  () => {
692
+ if (!window.__mossSbHot) {
693
+ window.__mossSbHot = true;
694
+ let hot = null;
695
+ document.addEventListener('mousemove', (e) => {
696
+ let el = e.target instanceof Element ? e.target : null;
697
+ let found = null;
698
+ while (el && el !== document.documentElement) {
699
+ const vs = el.scrollHeight > el.clientHeight + 4;
700
+ const hs = el.scrollWidth > el.clientWidth + 4;
701
+ const cs = vs || hs ? getComputedStyle(el) : null;
702
+ if (cs && /(auto|scroll)/.test(cs.overflowY + cs.overflowX)) {
703
+ const r = el.getBoundingClientRect();
704
+ if ((vs && r.right - e.clientX <= 18) || (hs && r.bottom - e.clientY <= 18)) found = el;
705
+ break;
706
+ }
707
+ el = el.parentElement;
708
+ }
709
+ if (found !== hot) {
710
+ if (hot) hot.classList.remove('sb-hot');
711
+ if (found) found.classList.add('sb-hot');
712
+ hot = found;
713
+ }
714
+ }, {passive: true});
715
+ }
716
  if (window.__mossCamWatch) return;
717
  window.__mossCamWatch = setInterval(() => {
718
  if (!window.__mossRawScroll) {