openfree commited on
Commit
0d826d3
·
verified ·
1 Parent(s): 9ce8650

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -7
app.py CHANGED
@@ -601,11 +601,15 @@ with gr.Blocks(css_paths=["app.css"], theme=theme) as demo:
601
  session_history = gr.HTML(elem_classes="session-history")
602
  close_btn = antd.Button("닫기", type="default", elem_classes="close-btn")
603
 
 
 
 
 
604
  with antd.Row(gutter=[32, 12], align="top", elem_classes="equal-height-container") as layout:
605
 
606
  # 좌측 미리보기
607
  with antd.Col(span=24, md=16, elem_classes="equal-height-col"):
608
- with ms.Div(elem_classes="right_panel panel"):
609
  gr.HTML(r"""
610
  <div class="render_header">
611
  <span class="header_btn"></span>
@@ -615,13 +619,13 @@ with gr.Blocks(css_paths=["app.css"], theme=theme) as demo:
615
  """)
616
  with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
617
  with antd.Tabs.Item(key="empty"):
618
- empty = antd.Empty(description="게임을 만들려면 설명을 입력하세요", elem_classes="right_content")
619
  with antd.Tabs.Item(key="loading"):
620
  loading = antd.Spin(
621
- True, tip="게임 코드 생성 중...", size="large", elem_classes="right_content"
622
  )
623
  with antd.Tabs.Item(key="render"):
624
- sandbox = gr.HTML(elem_classes="html_content")
625
 
626
  # 우측 입력/버튼/배포
627
  with antd.Col(span=24, md=8, elem_classes="equal-height-col"):
@@ -638,17 +642,20 @@ with gr.Blocks(css_paths=["app.css"], theme=theme) as demo:
638
  deploy_btn = antd.Button("배포", type="default", size="large", elem_classes="deploy-btn")
639
  clear_btn = antd.Button("클리어", type="default", size="large", elem_classes="clear-btn")
640
 
641
- with antd.Flex(vertical=True, gap="middle", wrap=True, elem_classes="input-panel"):
 
 
642
  input_text = antd.InputTextarea(
643
  size="large",
644
  allow_clear=True,
645
  placeholder=random.choice(DEMO_LIST)['description'],
646
- max_length=100000
 
647
  )
648
  gr.HTML('<div class="help-text">💡 원하는 게임의 설명을 입력하세요. 예: "테트리스 게임 제작해줘."</div>')
649
 
650
  # 가장 기본적인 방식의 배포 결과 표시
651
- deploy_result = gr.Markdown("", label="배포 결과")
652
 
653
  # 더 이상 자바스크립트 삽입 없음
654
  js_trigger = gr.HTML(elem_id="js-trigger", visible=False)
@@ -784,6 +791,7 @@ with gr.Blocks(css_paths=["app.css"], theme=theme) as demo:
784
  inputs=[code_output],
785
  outputs=[deploy_result]
786
  )
 
787
  # ------------------------
788
  # 8) 실제 실행
789
  # ------------------------
 
601
  session_history = gr.HTML(elem_classes="session-history")
602
  close_btn = antd.Button("닫기", type="default", elem_classes="close-btn")
603
 
604
+ # 높이 일관성을 위한 변수 정의
605
+ panel_height = "900px"
606
+ content_height = "870px" # 헤더(30px)를 제외한 높이
607
+
608
  with antd.Row(gutter=[32, 12], align="top", elem_classes="equal-height-container") as layout:
609
 
610
  # 좌측 미리보기
611
  with antd.Col(span=24, md=16, elem_classes="equal-height-col"):
612
+ with ms.Div(elem_classes="right_panel panel", style=f"height: {panel_height};"):
613
  gr.HTML(r"""
614
  <div class="render_header">
615
  <span class="header_btn"></span>
 
619
  """)
620
  with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
621
  with antd.Tabs.Item(key="empty"):
622
+ empty = antd.Empty(description="게임을 만들려면 설명을 입력하세요", elem_classes="right_content", style=f"height: {content_height};")
623
  with antd.Tabs.Item(key="loading"):
624
  loading = antd.Spin(
625
+ True, tip="게임 코드 생성 중...", size="large", elem_classes="right_content", style=f"height: {content_height};"
626
  )
627
  with antd.Tabs.Item(key="render"):
628
+ sandbox = gr.HTML(elem_classes="html_content", style=f"height: {content_height};")
629
 
630
  # 우측 입력/버튼/배포
631
  with antd.Col(span=24, md=8, elem_classes="equal-height-col"):
 
642
  deploy_btn = antd.Button("배포", type="default", size="large", elem_classes="deploy-btn")
643
  clear_btn = antd.Button("클리어", type="default", size="large", elem_classes="clear-btn")
644
 
645
+ # 우측 입력 패널에 고정된 높이 지정
646
+ with antd.Flex(vertical=True, gap="middle", wrap=True, elem_classes="input-panel", style=f"height: {content_height}; max-height: {content_height}; overflow: hidden;"):
647
+ # 입력창의 높이를 조정하여 배포 결과 영역을 고려
648
  input_text = antd.InputTextarea(
649
  size="large",
650
  allow_clear=True,
651
  placeholder=random.choice(DEMO_LIST)['description'],
652
+ max_length=100000,
653
+ style="height: 750px; max-height: 750px;" # 높이 조정
654
  )
655
  gr.HTML('<div class="help-text">💡 원하는 게임의 설명을 입력하세요. 예: "테트리스 게임 제작해줘."</div>')
656
 
657
  # 가장 기본적인 방식의 배포 결과 표시
658
+ deploy_result = gr.Markdown("", label="배포 결과", elem_classes="deploy-result")
659
 
660
  # 더 이상 자바스크립트 삽입 없음
661
  js_trigger = gr.HTML(elem_id="js-trigger", visible=False)
 
791
  inputs=[code_output],
792
  outputs=[deploy_result]
793
  )
794
+
795
  # ------------------------
796
  # 8) 실제 실행
797
  # ------------------------