import streamlit as st from pathlib import Path import base64 from dashboard_theme.theme import inject st.set_page_config(page_title="FormingStar", layout="wide") inject("graphite_gold") PASSWORD = "ajin2025" # ------------------------------- # 세션 초기화 # ------------------------------- if "authenticated" not in st.session_state: st.session_state["authenticated"] = False # ------------------------------- # 로그인 화면 # ------------------------------- if not st.session_state["authenticated"]: st.title("🔒 FormingStar 접속 인증") pwd = st.text_input("비밀번호를 입력하세요", type="password") if st.button("접속하기"): if pwd == PASSWORD: st.session_state["authenticated"] = True st.success("✅ 인증 성공! 이제 상단 탭에서 시뮬레이션으로 이동하세요.") st.rerun() else: st.error("❌ 비밀번호가 틀렸습니다.") # ------------------------------- # 인증 후 메인 화면 # ------------------------------- else: # ------------------------------- # CSS (Home.py와 동일) # ------------------------------- st.markdown( """ """, unsafe_allow_html=True ) # ------------------------------- # 🔸 회사 로고 # ------------------------------- def find_logo(): here = Path(__file__).parent for p in [ here / "formingstar.png", here / "assets" / "formingstar.png", Path.cwd() / "formingstar.png" ]: if p.exists(): return p return None logo_path = find_logo() if logo_path: logo_b64 = base64.b64encode(logo_path.read_bytes()).decode() st.markdown( f'
FORMINGSTAR Logo
', unsafe_allow_html=True ) else: st.warning("로고 파일(formingstar.png)을 찾지 못했어요. Home.py와 같은 폴더 또는 /assets 폴더에 있는지 확인해 주세요.") # ------------------------------- # 🔸 메인 타이틀 & 설명 # ------------------------------- st.markdown('

AI∙빅데이터 기반 성형성 예측 모델

', unsafe_allow_html=True) st.markdown('

자동차 차체 금형 해석 과정을 쉽게 배우고 실습할 수 있는 가이드 플랫폼입니다.

', unsafe_allow_html=True) st.markdown('
', unsafe_allow_html=True) # ------------------------------- # 🔸 버튼 → 페이지 이동 # ------------------------------- left, mid, right = st.columns([1, 1.2, 1]) with mid: if st.button("시뮬레이션 시작하기", use_container_width=True): st.switch_page("pages/1_Simulation.py") st.markdown('
', unsafe_allow_html=True) # ------------------------------- # 🔸 안내 문구 # ------------------------------- st.markdown( '
좌측 사이드바에서도 시뮬레이션 메뉴로 이동할 수 있습니다.
', unsafe_allow_html=True )