Spaces:
Running
Running
File size: 1,929 Bytes
28e7fd6 1a353ec c217967 28e7fd6 ca3a9c8 1a89634 76b1b72 ee225de ca3a9c8 b8523b7 73d1f25 ca3a9c8 36e1e5a a8a25ed 36e1e5a e23907d a8a25ed ca3a9c8 a8a25ed 0ba5b95 ca3a9c8 1a89634 b8523b7 0a67d05 28e7fd6 1a89634 b8523b7 100b6c8 0602068 b8523b7 ee225de ca3a9c8 ab2413a 1a353ec c61b525 ee225de 73d1f25 |
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 |
import streamlit as st
from layout import init_session_state, apply_theme
from code_editor import render_code_editor
from chatbot import render_chatbot
# ββ Page Config ββββββββββββββββββββββββββββββ
st.set_page_config(
page_title="Pro Code Playground",
page_icon="π»",
layout="wide"
)
init_session_state()
# ββ Header βββββββββββββββββββββββββββββββββββ
st.title("Pro Code Playground")
st.markdown("Write, execute & export multi-language snippets, with builtβin AI assistance.")
# ββ Theme Toggle βββββββββββββββββββββββββββββ
_, _, theme_col = st.columns([3, 6, 1])
with theme_col:
if st.button("π Dark Mode" if not st.session_state.dark_mode else "βοΈ Light Mode"):
st.session_state.dark_mode = not st.session_state.dark_mode
st.rerun()
# ββ Apply Theme ββββββββββββββββββββββββββββββ
colors, ace_theme = apply_theme()
# ββ Layout βββββββββββββββββββββββββββββββββββ
editor_col, assistant_col = st.columns((2, 1), gap="large")
with editor_col:
st.subheader("Editor")
render_code_editor(ace_theme)
with assistant_col:
st.subheader("Code Assistant")
render_chatbot(
st.session_state.code,
st.session_state.get("stdin", ""),
st.session_state.get("code_output", ""),
st.session_state.get("error_output", "")
)
# ββ Footer βββββββββββββββββββββββββββββββββββ
st.markdown("""
<div style='text-align:center; margin-top:1rem; opacity:0.6;'>
Built with β€οΈ & Streamlit by Vaibhav
</div>
""", unsafe_allow_html=True)
|