Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ from layout import init_session_state, apply_theme
|
|
| 3 |
from code_editor import render_code_editor
|
| 4 |
from chatbot import render_chatbot
|
| 5 |
|
| 6 |
-
# ββ Page Config ββββββββββββββββββββββββββββββ
|
| 7 |
st.set_page_config(
|
| 8 |
page_title="Pro Code Playground",
|
| 9 |
page_icon="π»",
|
|
@@ -11,37 +10,23 @@ st.set_page_config(
|
|
| 11 |
)
|
| 12 |
init_session_state()
|
| 13 |
|
| 14 |
-
# ββ Header βββββββββββββββββββββββββββββββββββ
|
| 15 |
st.title("Pro Code Playground")
|
| 16 |
st.markdown("Write, execute & export multi-language snippets, with builtβin AI assistance.")
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
with lang_col:
|
| 22 |
-
selected_lang = st.selectbox(
|
| 23 |
-
"Language",
|
| 24 |
-
["Python", "C", "C++", "Java", "JavaScript", "C#"],
|
| 25 |
-
index=0
|
| 26 |
-
)
|
| 27 |
-
|
| 28 |
with theme_col:
|
| 29 |
-
|
| 30 |
-
toggle = st.button("π Dark Mode" if not is_dark else "βοΈ Light Mode")
|
| 31 |
-
if toggle:
|
| 32 |
st.session_state.dark_mode = not st.session_state.dark_mode
|
| 33 |
st.rerun()
|
| 34 |
|
| 35 |
-
# ββ Theme Colors βββββββββββββββββββββββββββββ
|
| 36 |
colors, ace_theme = apply_theme()
|
| 37 |
|
| 38 |
-
# ββ Main Layout: Editor (2/3) + Chatbot (1/3) β
|
| 39 |
editor_col, assistant_col = st.columns((2, 1), gap="large")
|
| 40 |
|
| 41 |
with editor_col:
|
| 42 |
st.subheader("Editor")
|
| 43 |
-
|
| 44 |
-
render_code_editor(selected_lang, ace_theme, editor_key)
|
| 45 |
|
| 46 |
with assistant_col:
|
| 47 |
st.subheader("Code Assistant")
|
|
@@ -51,7 +36,6 @@ with assistant_col:
|
|
| 51 |
st.session_state.get("error_output", "")
|
| 52 |
)
|
| 53 |
|
| 54 |
-
# ββ Footer βββββββββββββββββββββββββββββββββββ
|
| 55 |
st.markdown("""
|
| 56 |
<div style='text-align:center; margin-top:1rem; opacity:0.6;'>
|
| 57 |
Built with β€οΈ & Streamlit by Vaibhav
|
|
|
|
| 3 |
from code_editor import render_code_editor
|
| 4 |
from chatbot import render_chatbot
|
| 5 |
|
|
|
|
| 6 |
st.set_page_config(
|
| 7 |
page_title="Pro Code Playground",
|
| 8 |
page_icon="π»",
|
|
|
|
| 10 |
)
|
| 11 |
init_session_state()
|
| 12 |
|
|
|
|
| 13 |
st.title("Pro Code Playground")
|
| 14 |
st.markdown("Write, execute & export multi-language snippets, with builtβin AI assistance.")
|
| 15 |
|
| 16 |
+
# Theme toggle only
|
| 17 |
+
_, _, theme_col = st.columns([3, 6, 1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
with theme_col:
|
| 19 |
+
if st.button("π Dark Mode" if not st.session_state.dark_mode else "βοΈ Light Mode"):
|
|
|
|
|
|
|
| 20 |
st.session_state.dark_mode = not st.session_state.dark_mode
|
| 21 |
st.rerun()
|
| 22 |
|
|
|
|
| 23 |
colors, ace_theme = apply_theme()
|
| 24 |
|
|
|
|
| 25 |
editor_col, assistant_col = st.columns((2, 1), gap="large")
|
| 26 |
|
| 27 |
with editor_col:
|
| 28 |
st.subheader("Editor")
|
| 29 |
+
render_code_editor(ace_theme)
|
|
|
|
| 30 |
|
| 31 |
with assistant_col:
|
| 32 |
st.subheader("Code Assistant")
|
|
|
|
| 36 |
st.session_state.get("error_output", "")
|
| 37 |
)
|
| 38 |
|
|
|
|
| 39 |
st.markdown("""
|
| 40 |
<div style='text-align:center; margin-top:1rem; opacity:0.6;'>
|
| 41 |
Built with β€οΈ & Streamlit by Vaibhav
|