code-slicer commited on
Commit
957a99c
·
verified ·
1 Parent(s): df7fc6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -10
app.py CHANGED
@@ -192,21 +192,29 @@ BG_URL = "https://plus.unsplash.com/premium_photo-1679830513869-cd3648acb1db?q=8
192
 
193
  st.markdown(f"""
194
  <style>
195
- /* 본문 위에, 배경 이미지만 담긴 고정 레이어를 올립니다 */
196
- .stApp::before {{
 
 
 
 
 
 
 
197
  content: "";
198
- position: fixed; inset: 0;
199
- background: url('{BG_URL}') center/cover no-repeat;
200
- opacity: .5; /* 투명도 50% */
201
- pointer-events: none; /* 클릭 막지 않기 */
 
202
  z-index: 0;
203
  }}
204
- /* 컨텐츠는 위로 */
205
- .block-container {{ position: relative; z-index: 1; }}
206
 
207
- /* 모바일(일부 브라우저)에서 고정 배경 이슈 대응 */
208
  @media (max-width: 768px){{
209
- .stApp::before{{ background-attachment: initial; }}
210
  }}
211
  </style>
212
  """, unsafe_allow_html=True)
 
192
 
193
  st.markdown(f"""
194
  <style>
195
+ /* 0) 이전에 깔아 '전체 배경' 비활성화(있다면) */
196
+ .stApp::before {{ content: none !important; }}
197
+
198
+ /* 1) 가운데 컬럼(.block-container)만 배경 사용 */
199
+ .block-container {{
200
+ position: relative;
201
+ min-height: 100vh; /* 화면 높이 만큼만(=빨간 박스 높이 느낌) */
202
+ }}
203
+ .block-container::before {{
204
  content: "";
205
+ position: absolute; inset: 0; /* 컬럼 영역에만 덮기 */
206
+ background: url('{BG_URL}') center / cover no-repeat;
207
+ opacity: .8; /* 투명도 80% */
208
+ pointer-events: none;
209
+ border-radius: 0px; /* 모서리 둥글게(원하면 제거) */
210
  z-index: 0;
211
  }}
212
+ /* 2) 실제 콘텐츠가 배경 위에 오도록 */
213
+ .block-container > * {{ position: relative; z-index: 1; }}
214
 
215
+ /* 모바일에선 고정 배경 이슈 방지 */
216
  @media (max-width: 768px){{
217
+ .block-container::before{{ background-attachment: initial; }}
218
  }}
219
  </style>
220
  """, unsafe_allow_html=True)