Spaces:
Sleeping
Sleeping
""" | |
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} | |
""" | |