seawolf2357 commited on
Commit
8de6487
·
verified ·
1 Parent(s): cf06324

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -3
app.py CHANGED
@@ -1,17 +1,41 @@
1
  import gradio as gr
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  def app():
4
  # Gradio 인터페이스 구성
5
- with gr.Blocks() as demo:
 
6
  with gr.Row():
7
  # 첫 번째 HTML 컴포넌트로 IFrame 구현
8
  with gr.Column():
9
- gr.Markdown("### 첫 번째 URL")
10
  gr.HTML(value='<iframe src="https://www.chatbase.co/chatbot-iframe/100-daum-net-eurma-q2o" height="700" width="600"></iframe>')
11
 
12
  # 두 번째 HTML 컴포넌트로 IFrame 구현
13
  with gr.Column():
14
- gr.Markdown("### 두 번째 URL")
15
  gr.HTML(value='<iframe src="https://seawolf2357-frametest1.hf.space" height="700" width="600"></iframe>')
16
 
17
  return demo
 
1
  import gradio as gr
2
 
3
+ # CSS 스타일 정의
4
+ css_style = """
5
+ body {
6
+ font-family: Arial, sans-serif;
7
+ background-color: #f0f0f9;
8
+ }
9
+
10
+ h4 {
11
+ color: #333;
12
+ }
13
+
14
+ iframe {
15
+ border: 2px solid #007bff;
16
+ border-radius: 8px;
17
+ }
18
+
19
+ .gr-column {
20
+ padding: 10px;
21
+ }
22
+
23
+ /* 마크다운 및 HTML 컴포넌트의 스타일을 추가 정의할 수 있음 */
24
+ """
25
+
26
  def app():
27
  # Gradio 인터페이스 구성
28
+ with gr.Blocks(css=css_style) as demo:
29
+ gr.Markdown("## IFrame으로 웹 페이지 임베딩하기", elem_id="main-title")
30
  with gr.Row():
31
  # 첫 번째 HTML 컴포넌트로 IFrame 구현
32
  with gr.Column():
33
+ gr.Markdown("### 첫 번째 URL", elem_id="title-1")
34
  gr.HTML(value='<iframe src="https://www.chatbase.co/chatbot-iframe/100-daum-net-eurma-q2o" height="700" width="600"></iframe>')
35
 
36
  # 두 번째 HTML 컴포넌트로 IFrame 구현
37
  with gr.Column():
38
+ gr.Markdown("### 두 번째 URL", elem_id="title-2")
39
  gr.HTML(value='<iframe src="https://seawolf2357-frametest1.hf.space" height="700" width="600"></iframe>')
40
 
41
  return demo