Spaces:
Sleeping
Sleeping
Youngsun Lim
commited on
Commit
Β·
b7847f2
1
Parent(s):
a3d46b5
dataset update
Browse files
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 |
-
//
|
| 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 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
""")
|