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
    )