cwadayi commited on
Commit
8fe26ab
·
verified ·
1 Parent(s): 37993b2

Update ui/layouts.py

Browse files
Files changed (1) hide show
  1. ui/layouts.py +20 -3
ui/layouts.py CHANGED
@@ -64,6 +64,20 @@ def create_ui(visit_count_html: str, theme: gr.Theme):
64
  font-size: 1rem;
65
  color: #c7254e;
66
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  @media (max-width: 768px) {
68
  .custom-header { padding: 3rem 1rem; border-radius: 0; }
69
  .custom-header h1 { font-size: 2.5rem; }
@@ -77,10 +91,13 @@ def create_ui(visit_count_html: str, theme: gr.Theme):
77
  """
78
  )
79
 
80
- # --- ✨ 修改 Tabs 容器,使用 id 進行預設選擇 ---
81
- with gr.Tabs(selected="goals_tab"):
 
 
 
 
82
 
83
- # --- ✨ 為預設分頁加上對應的 id ---
84
  with gr.TabItem("🎯 課程目標", id="goals_tab"):
85
  gr.Markdown(content.course_goals_md)
86
 
 
64
  font-size: 1rem;
65
  color: #c7254e;
66
  }
67
+ /* Style for the homepage image */
68
+ .homepage-image-container {
69
+ margin-top: 1rem; /* 圖片與上方 Header 的間距 */
70
+ margin-bottom: 2rem; /* 圖片與下方 Tabs 的間距 */
71
+ border-radius: 12px;
72
+ overflow: hidden; /* 確保圖片圓角 */
73
+ box-shadow: 0 6px 20px rgba(0,0,0,0.2);
74
+ }
75
+ .homepage-image-container img {
76
+ width: 100%;
77
+ height: auto;
78
+ display: block;
79
+ }
80
+
81
  @media (max-width: 768px) {
82
  .custom-header { padding: 3rem 1rem; border-radius: 0; }
83
  .custom-header h1 { font-size: 2.5rem; }
 
91
  """
92
  )
93
 
94
+ # --- ✨ 修改圖片路徑以符合與 app.py 同層目錄 ---
95
+ # 請確保 'homepage_image.png' 就是您的圖片檔名
96
+ with gr.Row(elem_classes="homepage-image-container"):
97
+ gr.Image(value="homepage_image.png", show_label=False, interactive=False, container=False)
98
+
99
+ with gr.Tabs():
100
 
 
101
  with gr.TabItem("🎯 課程目標", id="goals_tab"):
102
  gr.Markdown(content.course_goals_md)
103