haepada commited on
Commit
57e126d
·
verified ·
1 Parent(s): af7b3a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -16
app.py CHANGED
@@ -694,6 +694,23 @@ def create_interface():
694
  </div>
695
  """
696
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  css = """
698
  /* 전체 컨테이너 width 제한 */
699
  .gradio-container {
@@ -704,6 +721,14 @@ def create_interface():
704
 
705
  /* 모바일 뷰 */
706
  @media (max-width: 600px) {
 
 
 
 
 
 
 
 
707
  .mobile-logo {
708
  display: none !important;
709
  }
@@ -740,6 +765,14 @@ def create_interface():
740
 
741
  /* 데스크톱 뷰 (601px 이상) */
742
  @media (min-width: 601px) {
 
 
 
 
 
 
 
 
743
  .main-image {
744
  width: 600px;
745
  max-width: 600px;
@@ -763,10 +796,6 @@ def create_interface():
763
  overflow-x: auto !important;
764
  max-width: 100% !important;
765
  }
766
- }
767
-
768
- /* 데스크톱 뷰 */
769
- @media (min-width: 601px) {
770
  .logo-container {
771
  padding: 20px 0;
772
  width: 100%;
@@ -1093,7 +1122,8 @@ def create_interface():
1093
  /* 이미지 컨테이너 스타일 */
1094
  .location-image-container {
1095
  width: 100%;
1096
- margin: 1rem 0;
 
1097
  text-align: center;
1098
  }
1099
 
@@ -1196,17 +1226,8 @@ def create_interface():
1196
  본격적인 의식을 시작하기 전, 마음을 정화하고 감각을 열어 경험에 몰입할 준비를 마치세요
1197
  """)
1198
  location_image = encode_image_to_base64("static/location.png")
1199
- gr.HTML("""
1200
- <div class="location-image-container">
1201
- <picture>
1202
- <!-- 모바일 이미지 -->
1203
- <source media="(max-width: 600px)" srcset="static/location.png">
1204
- <!-- 데스크톱 이미지 -->
1205
- <source media="(min-width: 601px)" srcset="static/location_w.png">
1206
- <img src="static/location.png" alt="위치 안내 이미지" class="location-image">
1207
- </picture>
1208
- </div>
1209
- """)
1210
  gr.Markdown("""
1211
  **보다 몰입된 경험을 위해**
1212
  이 경험은 부산 동래구 온천장역에서 시작하여, 금정구 장전역까지 온천천을 따라 신화적 공간과 연결될 수 있도록 설계되었습니다.
 
694
  </div>
695
  """
696
 
697
+ # 모바일 및 데스크톱용 위치 이미지를 Base64로 인코딩
698
+ location_image_mobile = encode_image_to_base64("static/location.png")
699
+ location_image_desktop = encode_image_to_base64("static/location_w.png")
700
+
701
+ # location_html 정의
702
+ if not location_image_mobile or not location_image_desktop:
703
+ location_html = """
704
+ <div style="text-align: center; padding: 20px;">
705
+ <h2>위치 안내</h2>
706
+ </div>
707
+ """
708
+ else:
709
+ location_html = f"""
710
+ <img class="location-image-mobile" src="data:image/png;base64,{location_image_mobile}" alt="위치 안내 이미지 (모바일)">
711
+ <img class="location-image-desktop" src="data:image/png;base64,{location_image_desktop}" alt="위치 안내 이미지 (데스크톱)">
712
+ """
713
+
714
  css = """
715
  /* 전체 컨테이너 width 제한 */
716
  .gradio-container {
 
721
 
722
  /* 모바일 뷰 */
723
  @media (max-width: 600px) {
724
+ .location-image-mobile {
725
+ display: none !important;
726
+ }
727
+ .location-image-desktop {
728
+ display: block !important;
729
+ width: 100%;
730
+ height: auto;
731
+ }
732
  .mobile-logo {
733
  display: none !important;
734
  }
 
765
 
766
  /* 데스크톱 뷰 (601px 이상) */
767
  @media (min-width: 601px) {
768
+ .location-image-desktop {
769
+ display: none !important;
770
+ }
771
+ .location-image-mobile {
772
+ display: block !important;
773
+ width: 100%;
774
+ height: auto;
775
+ }
776
  .main-image {
777
  width: 600px;
778
  max-width: 600px;
 
796
  overflow-x: auto !important;
797
  max-width: 100% !important;
798
  }
 
 
 
 
799
  .logo-container {
800
  padding: 20px 0;
801
  width: 100%;
 
1122
  /* 이미지 컨테이너 스타일 */
1123
  .location-image-container {
1124
  width: 100%;
1125
+ max-width: 800px;
1126
+ margin: 20px auto;
1127
  text-align: center;
1128
  }
1129
 
 
1226
  본격적인 의식을 시작하기 전, 마음을 정화하고 감각을 열어 경험에 몰입할 준비를 마치세요
1227
  """)
1228
  location_image = encode_image_to_base64("static/location.png")
1229
+ with gr.Column():
1230
+ gr.HTML(location_html)
 
 
 
 
 
 
 
 
 
1231
  gr.Markdown("""
1232
  **보다 몰입된 경험을 위해**
1233
  이 경험은 부산 동래구 온천장역에서 시작하여, 금정구 장전역까지 온천천을 따라 신화적 공간과 연결될 수 있도록 설계되었습니다.