Spaces:
Sleeping
Sleeping
File size: 1,148 Bytes
db315f2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
"""
UI 스타일 관련 정의
"""
import gradio as gr
import os
# UI 기본 테마 설정
theme = "base" # 기본 테마 사용
# CSS 디렉토리 경로 설정
css_dir = os.path.join(os.path.dirname(__file__), "css")
def read_css_file(css_file):
"""CSS 파일명을 받아 파일 내용을 반환하는 함수
Args:
css_file (str): CSS 파일 이름 (예: "base.css")
Returns:
str: CSS 파일 내용
"""
try:
file_path = os.path.join(css_dir, css_file)
with open(file_path, "r", encoding="utf-8") as file:
return file.read()
except Exception as e:
print(f"CSS 파일 읽기 오류 ({css_file}): {e}")
return ""
# CSS 파일 내용 가져오기
base_css = read_css_file("base.css")
interactions_css = read_css_file("interactions.css")
# 애니메이션 CSS 파일 내용 가져오기
fade_out_css = read_css_file("fade-out.css")
fade_in_css = read_css_file("fade-in.css")
fade_visibility_css = read_css_file("fade-visibility.css")
# 모든 CSS 통합
CSS = f"""
{base_css}
{interactions_css}
{fade_out_css}
{fade_in_css}
{fade_visibility_css}
"""
|