Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,12 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import uuid
|
| 3 |
import os
|
| 4 |
from components import (
|
|
@@ -14,14 +22,6 @@ api_key = os.getenv("ANTHROPIC_API_KEY")
|
|
| 14 |
if not api_key:
|
| 15 |
st.error("β οΈ ANTHROPIC_API_KEY environment variable not found. The app will use fallback content generation.")
|
| 16 |
|
| 17 |
-
# Set page config - must be the first Streamlit command
|
| 18 |
-
st.set_page_config(
|
| 19 |
-
page_title="AI PowerPoint Creator",
|
| 20 |
-
page_icon="π",
|
| 21 |
-
layout="wide",
|
| 22 |
-
initial_sidebar_state="expanded"
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
# Add custom CSS
|
| 26 |
st.markdown("""
|
| 27 |
<style>
|
|
@@ -57,6 +57,33 @@ st.markdown("""
|
|
| 57 |
transform: translateY(-5px) !important;
|
| 58 |
box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
|
| 59 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
</style>
|
| 61 |
""", unsafe_allow_html=True)
|
| 62 |
|
|
@@ -80,31 +107,50 @@ if "slides_content" not in st.session_state:
|
|
| 80 |
|
| 81 |
# Sidebar
|
| 82 |
with st.sidebar:
|
| 83 |
-
|
| 84 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# Display API information
|
| 87 |
if api_key:
|
| 88 |
-
st.success("Claude
|
| 89 |
else:
|
| 90 |
-
st.error("Claude
|
| 91 |
|
| 92 |
# Display current progress
|
| 93 |
-
st.write("##
|
| 94 |
-
stages = [
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
progress_value = (current_stage_idx) / (len(stages) - 1)
|
| 97 |
st.progress(progress_value)
|
| 98 |
|
| 99 |
# Display all stages and highlight current
|
| 100 |
for i, stage in enumerate(stages):
|
| 101 |
if i == current_stage_idx:
|
| 102 |
-
st.markdown(f"###
|
| 103 |
else:
|
| 104 |
-
st.markdown(f"###
|
| 105 |
|
| 106 |
st.write("---")
|
| 107 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
# Jump to stage buttons (for development/testing)
|
| 110 |
if st.checkbox("Development Mode", value=False):
|
|
@@ -112,13 +158,20 @@ with st.sidebar:
|
|
| 112 |
col1, col2 = st.columns(2)
|
| 113 |
for i, stage in enumerate(stages):
|
| 114 |
with col1 if i % 2 == 0 else col2:
|
| 115 |
-
if st.button(stage, key=f"jump_{stage}"):
|
| 116 |
-
st.session_state.current_stage = stage.lower()
|
| 117 |
st.rerun()
|
| 118 |
|
| 119 |
# Main content
|
| 120 |
-
st.
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
# Display different UI based on current stage
|
| 124 |
if st.session_state.current_stage == "ideation":
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
# Set page config - must be the first Streamlit command
|
| 3 |
+
st.set_page_config(
|
| 4 |
+
page_title="SlideGator.AI",
|
| 5 |
+
page_icon="π",
|
| 6 |
+
layout="wide",
|
| 7 |
+
initial_sidebar_state="expanded"
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
import uuid
|
| 11 |
import os
|
| 12 |
from components import (
|
|
|
|
| 22 |
if not api_key:
|
| 23 |
st.error("β οΈ ANTHROPIC_API_KEY environment variable not found. The app will use fallback content generation.")
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Add custom CSS
|
| 26 |
st.markdown("""
|
| 27 |
<style>
|
|
|
|
| 57 |
transform: translateY(-5px) !important;
|
| 58 |
box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
|
| 59 |
}
|
| 60 |
+
|
| 61 |
+
/* SlideGator branding */
|
| 62 |
+
.logo-text {
|
| 63 |
+
color: #4CAF50;
|
| 64 |
+
font-weight: bold;
|
| 65 |
+
font-family: 'Arial', sans-serif;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
/* Stage icons */
|
| 69 |
+
.stage-icon {
|
| 70 |
+
font-size: 1.5rem;
|
| 71 |
+
margin-right: 0.5rem;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/* Custom button styles */
|
| 75 |
+
.gator-button {
|
| 76 |
+
background-color: #4CAF50;
|
| 77 |
+
color: white;
|
| 78 |
+
border-radius: 5px;
|
| 79 |
+
padding: 8px 16px;
|
| 80 |
+
font-weight: bold;
|
| 81 |
+
transition: all 0.3s;
|
| 82 |
+
}
|
| 83 |
+
.gator-button:hover {
|
| 84 |
+
background-color: #45a049;
|
| 85 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
|
| 86 |
+
}
|
| 87 |
</style>
|
| 88 |
""", unsafe_allow_html=True)
|
| 89 |
|
|
|
|
| 107 |
|
| 108 |
# Sidebar
|
| 109 |
with st.sidebar:
|
| 110 |
+
# Custom SlideGator logo and title
|
| 111 |
+
st.markdown("""
|
| 112 |
+
<div style="display: flex; align-items: center; margin-bottom: 1rem;">
|
| 113 |
+
<div style="font-size: 2.5rem; margin-right: 0.5rem;">π</div>
|
| 114 |
+
<div>
|
| 115 |
+
<div style="font-size: 1.5rem; font-weight: bold; color: #4CAF50;">SlideGator.AI</div>
|
| 116 |
+
<div style="font-size: 0.8rem; color: #666;">Snapping up presentation perfection</div>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
""", unsafe_allow_html=True)
|
| 120 |
|
| 121 |
# Display API information
|
| 122 |
if api_key:
|
| 123 |
+
st.success("π’ Claude AI engine connected")
|
| 124 |
else:
|
| 125 |
+
st.error("π΄ Claude AI engine not connected")
|
| 126 |
|
| 127 |
# Display current progress
|
| 128 |
+
st.write("## Your Journey")
|
| 129 |
+
stages = [
|
| 130 |
+
{"name": "Ideation", "icon": "π‘"},
|
| 131 |
+
{"name": "Storyboard", "icon": "π"},
|
| 132 |
+
{"name": "Template", "icon": "π¨"},
|
| 133 |
+
{"name": "Slides", "icon": "πΌοΈ"},
|
| 134 |
+
{"name": "Export", "icon": "π€"}
|
| 135 |
+
]
|
| 136 |
+
current_stage_idx = stages.index(next((s for s in stages if s["name"].lower() == st.session_state.current_stage), stages[0]))
|
| 137 |
progress_value = (current_stage_idx) / (len(stages) - 1)
|
| 138 |
st.progress(progress_value)
|
| 139 |
|
| 140 |
# Display all stages and highlight current
|
| 141 |
for i, stage in enumerate(stages):
|
| 142 |
if i == current_stage_idx:
|
| 143 |
+
st.markdown(f"### {stage['icon']} {stage['name']} β")
|
| 144 |
else:
|
| 145 |
+
st.markdown(f"### {stage['icon']} {stage['name']}")
|
| 146 |
|
| 147 |
st.write("---")
|
| 148 |
+
st.markdown("""
|
| 149 |
+
<div style="text-align: center;">
|
| 150 |
+
<div>Made with π by SlideGator.AI</div>
|
| 151 |
+
<div style="font-size: 0.8rem; color: #666;">Powered by Claude AI</div>
|
| 152 |
+
</div>
|
| 153 |
+
""", unsafe_allow_html=True)
|
| 154 |
|
| 155 |
# Jump to stage buttons (for development/testing)
|
| 156 |
if st.checkbox("Development Mode", value=False):
|
|
|
|
| 158 |
col1, col2 = st.columns(2)
|
| 159 |
for i, stage in enumerate(stages):
|
| 160 |
with col1 if i % 2 == 0 else col2:
|
| 161 |
+
if st.button(f"{stage['icon']} {stage['name']}", key=f"jump_{stage['name']}"):
|
| 162 |
+
st.session_state.current_stage = stage['name'].lower()
|
| 163 |
st.rerun()
|
| 164 |
|
| 165 |
# Main content
|
| 166 |
+
st.markdown("""
|
| 167 |
+
<div style="display: flex; align-items: center; margin-bottom: 1rem;">
|
| 168 |
+
<div style="font-size: 3rem; margin-right: 1rem;">π</div>
|
| 169 |
+
<div>
|
| 170 |
+
<h1 style="margin: 0; color: #4CAF50;">SlideGator.AI</h1>
|
| 171 |
+
<div style="font-size: 1.2rem;">Create professional presentations with AI-powered storyboarding and content generation</div>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
""", unsafe_allow_html=True)
|
| 175 |
|
| 176 |
# Display different UI based on current stage
|
| 177 |
if st.session_state.current_stage == "ideation":
|