Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,7 @@ from PIL import Image
|
|
| 11 |
from io import BytesIO
|
| 12 |
import base64
|
| 13 |
import time
|
|
|
|
| 14 |
|
| 15 |
def take_screenshot(url):
|
| 16 |
"""웹사이트 스크린샷 촬영 함수 (로딩 대기 시간 추가)"""
|
|
@@ -825,14 +826,45 @@ def get_user_spaces():
|
|
| 825 |
<p>Please try again later.</p>
|
| 826 |
</div>
|
| 827 |
"""
|
| 828 |
-
|
| 829 |
|
| 830 |
-
|
| 831 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 832 |
|
| 833 |
-
|
| 834 |
-
html_output = gr.HTML(value=get_user_spaces())
|
| 835 |
|
| 836 |
-
if __name__ == "__main__":
|
| 837 |
-
demo.launch()
|
| 838 |
|
|
|
|
| 11 |
from io import BytesIO
|
| 12 |
import base64
|
| 13 |
import time
|
| 14 |
+
from mouse import demo as mouse_demo # mouse.py의 demo 객체를 import
|
| 15 |
|
| 16 |
def take_screenshot(url):
|
| 17 |
"""웹사이트 스크린샷 촬영 함수 (로딩 대기 시간 추가)"""
|
|
|
|
| 826 |
<p>Please try again later.</p>
|
| 827 |
</div>
|
| 828 |
"""
|
|
|
|
| 829 |
|
| 830 |
+
def create_main_interface():
|
| 831 |
+
"""메인 인터페이스 생성 함수"""
|
| 832 |
+
|
| 833 |
+
# 갤러리 탭용 Blocks 객체 생성
|
| 834 |
+
gallery_tab = gr.Blocks()
|
| 835 |
+
with gallery_tab:
|
| 836 |
+
gr.HTML(value=get_user_spaces())
|
| 837 |
+
|
| 838 |
+
# 전체 인터페이스를 Blocks으로 감싸고 Tabs 추가
|
| 839 |
+
demo = gr.Blocks(css="""
|
| 840 |
+
.main-tabs > div.tab-nav > button {
|
| 841 |
+
font-size: 1.1em !important;
|
| 842 |
+
padding: 0.5em 1em !important;
|
| 843 |
+
background: rgba(255, 255, 255, 0.8) !important;
|
| 844 |
+
border: none !important;
|
| 845 |
+
border-radius: 8px 8px 0 0 !important;
|
| 846 |
+
margin-right: 4px !important;
|
| 847 |
+
}
|
| 848 |
+
.main-tabs > div.tab-nav > button.selected {
|
| 849 |
+
background: linear-gradient(45deg, #0084ff, #00a3ff) !important;
|
| 850 |
+
color: white !important;
|
| 851 |
+
}
|
| 852 |
+
.main-tabs {
|
| 853 |
+
margin-top: -20px !important;
|
| 854 |
+
border-radius: 0 0 15px 15px !important;
|
| 855 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
|
| 856 |
+
}
|
| 857 |
+
""")
|
| 858 |
+
|
| 859 |
+
with demo:
|
| 860 |
+
with gr.Tabs(elem_classes="main-tabs") as tabs:
|
| 861 |
+
with gr.Tab("갤러리", elem_id="gallery-tab"):
|
| 862 |
+
gr.HTML(value=get_user_spaces())
|
| 863 |
+
|
| 864 |
+
with gr.Tab("MOUSE", elem_id="mouse-tab"):
|
| 865 |
+
# mouse.py의 인터페이스를 여기에 포함
|
| 866 |
+
mouse_demo.render()
|
| 867 |
|
| 868 |
+
return demo
|
|
|
|
| 869 |
|
|
|
|
|
|
|
| 870 |
|