Youngsun Lim commited on
Commit
b7847f2
Β·
1 Parent(s): a3d46b5

dataset update

Browse files
Files changed (1) hide show
  1. app.py +28 -10
app.py CHANGED
@@ -521,6 +521,7 @@ html, body, #root, .gradio-container {
521
  .gradio-container .h-screen,
522
  .gradio-container .min-h-screen { height: auto !important; min-height: auto !important; }
523
  .gradio-container .overflow-hidden { overflow: visible !important; }
 
524
  """
525
 
526
 
@@ -530,34 +531,51 @@ with gr.Blocks(css=GLOBAL_CSS) as demo:
530
  <script>
531
  (function(){
532
  function allowScroll(){
533
- // μ΅œμƒμœ„μ— 슀크둀 ν—ˆμš©
534
  [document.documentElement, document.body].forEach(el=>{
535
- if(!el) return;
536
  el.style.overflow = 'auto';
537
  el.style.height = 'auto';
538
  el.style.minHeight = '100%';
 
539
  });
540
- // HF Spaces/Gradio 루트 μ»¨ν…Œμ΄λ„ˆλ“€
541
  const root = document.getElementById('root') || document.querySelector('#root,.gradio-container');
542
- if (root) {
543
  root.style.overflow = 'auto';
544
  root.style.height = 'auto';
545
  root.style.minHeight = '100%';
546
  }
547
- // 클래슀 기반 overflow 차단 ν•΄μ œ
548
  document.querySelectorAll('.overflow-hidden, .h-screen, .min-h-screen')
549
- .forEach(el => {
550
  el.classList.remove('overflow-hidden','h-screen','min-h-screen');
551
  el.style.overflow = 'auto';
552
  if (getComputedStyle(el).height === '100vh') el.style.height = 'auto';
553
  if (getComputedStyle(el).minHeight === '100vh') el.style.minHeight = 'auto';
554
  });
555
  }
556
- allowScroll();
557
- // λ™μ μœΌλ‘œ ν΄λž˜μŠ€κ°€ λ‹€μ‹œ λΆ™λŠ” 경우 λŒ€λΉ„
558
- new MutationObserver(allowScroll).observe(document.documentElement, {
559
- subtree: true, attributes: true, attributeFilter: ['class','style']
 
 
 
 
 
 
 
 
 
560
  });
 
 
 
 
 
 
 
 
561
  })();
562
  </script>
563
  """)
 
521
  .gradio-container .h-screen,
522
  .gradio-container .min-h-screen { height: auto !important; min-height: auto !important; }
523
  .gradio-container .overflow-hidden { overflow: visible !important; }
524
+ html, body { position: static !important; }
525
  """
526
 
527
 
 
531
  <script>
532
  (function(){
533
  function allowScroll(){
534
+ // μ΅œμƒμœ„λ“€ κ°•μ œ μ˜€λ²„λΌμ΄λ“œ
535
  [document.documentElement, document.body].forEach(el=>{
536
+ if (!el) return;
537
  el.style.overflow = 'auto';
538
  el.style.height = 'auto';
539
  el.style.minHeight = '100%';
540
+ el.style.position = 'static';
541
  });
 
542
  const root = document.getElementById('root') || document.querySelector('#root,.gradio-container');
543
+ if (root){
544
  root.style.overflow = 'auto';
545
  root.style.height = 'auto';
546
  root.style.minHeight = '100%';
547
  }
548
+ // κ³ μ • λ ˆμ΄μ•„μ›ƒ/μ˜€λ²„ν”Œλ‘œμš° 차단 클래슀 무λ ₯ν™”
549
  document.querySelectorAll('.overflow-hidden, .h-screen, .min-h-screen')
550
+ .forEach(el=>{
551
  el.classList.remove('overflow-hidden','h-screen','min-h-screen');
552
  el.style.overflow = 'auto';
553
  if (getComputedStyle(el).height === '100vh') el.style.height = 'auto';
554
  if (getComputedStyle(el).minHeight === '100vh') el.style.minHeight = 'auto';
555
  });
556
  }
557
+
558
+ const apply = () => requestAnimationFrame(allowScroll);
559
+
560
+ // 초기 1회
561
+ apply();
562
+
563
+ // λ ˆμ΄μ•„μ›ƒ/ν΄λž˜μŠ€κ°€ λ°”λ€” λ•Œλ§ˆλ‹€ 재적용
564
+ const mo = new MutationObserver(apply);
565
+ mo.observe(document.documentElement, {
566
+ subtree: true,
567
+ childList: true,
568
+ attributes: true,
569
+ attributeFilter: ['class','style']
570
  });
571
+
572
+ // 가끔 λ†“μΉ˜λŠ” 경우λ₯Ό μœ„ν•΄ 주기적 λ°±μ—… 적용
573
+ const interval = setInterval(apply, 1500);
574
+
575
+ // νŽ˜μ΄μ§€ μ΄λ²€νŠΈμ—λ„ ν›…
576
+ window.addEventListener('load', apply, { once:false });
577
+ document.addEventListener('visibilitychange', apply);
578
+ window.addEventListener('resize', apply);
579
  })();
580
  </script>
581
  """)