Spaces:
Sleeping
Sleeping
File size: 4,277 Bytes
3073e30 19348d0 2fb7c58 19348d0 3b56952 2fb7c58 3b56952 d08e094 3b56952 d08e094 3b56952 2fb7c58 3b56952 d08e094 19348d0 2fb7c58 d08e094 2fb7c58 19348d0 2fb7c58 19348d0 2fb7c58 19348d0 2fb7c58 19348d0 2fb7c58 | 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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | 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(
"""
<style>
.block-container { padding-top: 1.25rem !important; }
.logo-wrap { display:flex; justify-content:center; margin: 6px 0 10px; }
.logo-wrap img { width: clamp(160px, 24vw, 320px); height: auto; }
h2.hero-title {
margin: 4px 0 6px !important;
text-align:center; color: var(--text);
font-size: clamp(22px, 3vw, 36px);
line-height: 1.12;
}
p.hero-sub {
margin: 2px 0 8px !important;
text-align:center; color: var(--muted);
}
hr.hr-thin {
border: 0; border-top: 1px solid var(--border);
margin: 10px 0 !important;
}
.notice {
background-color:#2A2F3A; color:#E0E6ED;
padding:10px 16px; border-radius:10px; text-align:center;
max-width:640px; margin: 8px auto 0;
font-weight:600; border:1px solid var(--border);
box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
</style>
""",
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'<div class="logo-wrap"><img src="data:image/png;base64,{logo_b64}" alt="FORMINGSTAR Logo"></div>',
unsafe_allow_html=True
)
else:
st.warning("๋ก๊ณ ํ์ผ(formingstar.png)์ ์ฐพ์ง ๋ชปํ์ด์. Home.py์ ๊ฐ์ ํด๋ ๋๋ /assets ํด๋์ ์๋์ง ํ์ธํด ์ฃผ์ธ์.")
# -------------------------------
# ๐ธ ๋ฉ์ธ ํ์ดํ & ์ค๋ช
# -------------------------------
st.markdown('<h2 class="hero-title">AIโ๋น
๋ฐ์ดํฐ ๊ธฐ๋ฐ ์ฑํ์ฑ ์์ธก ๋ชจ๋ธ</h2>', unsafe_allow_html=True)
st.markdown('<p class="hero-sub">์๋์ฐจ ์ฐจ์ฒด ๊ธํ ํด์ ๊ณผ์ ์ ์ฝ๊ฒ ๋ฐฐ์ฐ๊ณ ์ค์ตํ ์ ์๋ ๊ฐ์ด๋ ํ๋ซํผ์
๋๋ค.</p>', unsafe_allow_html=True)
st.markdown('<hr class="hr-thin">', 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('<hr class="hr-thin">', unsafe_allow_html=True)
# -------------------------------
# ๐ธ ์๋ด ๋ฌธ๊ตฌ
# -------------------------------
st.markdown(
'<div class="notice">์ข์ธก ์ฌ์ด๋๋ฐ์์๋ ์๋ฎฌ๋ ์ด์
๋ฉ๋ด๋ก ์ด๋ํ ์ ์์ต๋๋ค.</div>',
unsafe_allow_html=True
)
|