Spaces:
Running
Running
Update app.py
Browse files284 unmodified lines28528628728828828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433510 unmodified lines346347348305349350351284 unmodified lines.login-box { max-width: 400px; margin: 100px auto; padding: 30px; border: 1px solid #ddd; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }"""script_js = "function(){ setTimeout(function(){ document.querySelector('#input_text_area textarea').style.fontSize='22px'; document.querySelector('#output_text_area textarea').style.fontSize='22px'; }, 500); }"
# โ
๋๋ฝ๋์๋ ์คํฌ๋กค ๋๊ธฐํ ์๋ฐ์คํฌ๋ฆฝํธ ์ฝ๋ ์๋ฒฝ ๋ณต๊ตฌscript_js = """function() { setTimeout(function() { let ta1 = document.querySelector('#input_text_area textarea'); if(ta1) { ta1.style.fontSize = '22px'; } let ta2 = document.querySelector('#output_text_area textarea'); if(ta2) { ta2.style.fontSize = '22px'; ta2.style.lineHeight = '1.8'; } }, 500);
let isSyncing1 = false; let isSyncing2 = false; let isSyncing3 = false; document.addEventListener('scroll', function(e) { let target = e.target; let ta1 = document.querySelector('#input_text_area textarea'); let ta2 = document.querySelector('#output_text_area textarea'); let div3 = document.getElementById('prompter_output_div'); if (!ta1 || !div3) return;
if (target === ta1) { if (isSyncing1) { isSyncing1 = false; return; } if (ta1.scrollHeight - ta1.clientHeight <= 0) return; isSyncing2 = true; isSyncing3 = true; let percentage = ta1.scrollTop / (ta1.scrollHeight - ta1.clientHeight); if (ta2 && ta2.scrollHeight - ta2.clientHeight > 0) { ta2.scrollTop = percentage * (ta2.scrollHeight - ta2.clientHeight); } if (div3.scrollHeight - div3.clientHeight > 0) { div3.scrollTop = percentage * (div3.scrollHeight - div3.clientHeight); } } else if (target === ta2) { if (isSyncing2) { isSyncing2 = false; return; } if (ta2 && ta2.scrollHeight - ta2.clientHeight <= 0) return; isSyncing1 = true; isSyncing3 = true; let percentage = ta2.scrollTop / (ta2.scrollHeight - ta2.clientHeight); if (ta1.scrollHeight - ta1.clientHeight > 0) { ta1.scrollTop = percentage * (ta1.scrollHeight - ta1.clientHeight); } if (div3.scrollHeight - div3.clientHeight > 0) { div3.scrollTop = percentage * (div3.scrollHeight - div3.clientHeight); } } else if (target === div3) { if (isSyncing3) { isSyncing3 = false; return; } if (div3.scrollHeight - div3.clientHeight <= 0) return; isSyncing1 = true; isSyncing2 = true; let percentage = div3.scrollTop / (div3.scrollHeight - div3.clientHeight); if (ta1.scrollHeight - ta1.clientHeight > 0) { ta1.scrollTop = percentage * (ta1.scrollHeight - ta1.clientHeight); } if (ta2 && ta2.scrollHeight - ta2.clientHeight > 0) { ta2.scrollTop = percentage * (ta2.scrollHeight - ta2.clientHeight); } } }, true);}"""
insert_marker_js = "(t) => { let ta = document.querySelector('#input_text_area textarea'); if (!ta) return t; let s = ta.selectionStart, e = ta.selectionEnd, v = ta.value; ta.value = v.substring(0, s) + '@@' + v.substring(e); ta.dispatchEvent(new Event('input', { bubbles: true })); ta.selectionStart = ta.selectionEnd = s + 2; ta.focus(); return ta.value; }"
with gr.Blocks(theme="default", css=custom_css) as iface:10 unmodified lines with gr.Column(visible=False) as main_app: with gr.Row(elem_classes="header-row"): gr.Markdown("## ๐๏ธ ๋๋ง์ TTS ์ ์ฒ๋ฆฌ ๋ณํ๊ธฐ") # โ
variant="secondary", size="sm", min_width=100 ์ผ๋ก ์ค์ ํ์ฌ ์๊ณ ํ์์ธ ๋ฒํผ์ผ๋ก ๋ง๋ฆ btn_logout = gr.Button("๐ช ๋ก๊ทธ์์", variant="secondary", size="sm", scale=0, min_width=100) with gr.Tabs():app.py+45-2