hruday96 commited on
Commit
6ecfcf0
Β·
verified Β·
1 Parent(s): 65dea87

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +61 -0
app.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ # Set page config
4
+ st.set_page_config(page_title="AI Prompt Enhancer", layout="centered")
5
+
6
+ # Dark/Light Mode Toggle
7
+ if "dark_mode" not in st.session_state:
8
+ st.session_state.dark_mode = False
9
+
10
+ def toggle_mode():
11
+ st.session_state.dark_mode = not st.session_state.dark_mode
12
+
13
+ # Apply Custom Styling
14
+ dark_css = """
15
+ <style>
16
+ body { background-color: #121212; color: #ffffff; }
17
+ .stTextArea, .stButton>button { background-color: #1e1e1e; color: #ffffff; }
18
+ .stButton>button { border-radius: 10px; font-size: 16px; padding: 10px 20px; }
19
+ </style>
20
+ """
21
+
22
+ light_css = """
23
+ <style>
24
+ body { background-color: #f5f5f5; color: #000000; }
25
+ .stTextArea, .stButton>button { background-color: #ffffff; color: #000000; }
26
+ .stButton>button { border-radius: 10px; font-size: 16px; padding: 10px 20px; }
27
+ </style>
28
+ """
29
+
30
+ # Apply selected mode
31
+ st.markdown(dark_css if st.session_state.dark_mode else light_css, unsafe_allow_html=True)
32
+
33
+ # Header
34
+ st.title("✨ AI Prompt Enhancer")
35
+
36
+ # Dark Mode Toggle
37
+ st.sidebar.button("πŸŒ™ Toggle Dark Mode" if not st.session_state.dark_mode else "β˜€οΈ Toggle Light Mode", on_click=toggle_mode)
38
+
39
+ # Prompt Input Box
40
+ prompt = st.text_area("πŸ’‘ Prompt Idea Box", placeholder="Type your prompt here...")
41
+
42
+ # Category Selection
43
+ st.subheader("πŸŽ›οΈ Select an Enhancement Type")
44
+
45
+ categories = {
46
+ "πŸ“œ Copywriting": ["Ad Copy", "Blog Intro", "Product Description"],
47
+ "πŸ’» Code Generation": ["Python", "SQL", "Automation Scripts"],
48
+ "πŸ“§ Email & Outreach": ["Cold Emails", "Sales Pitches"],
49
+ "πŸ“ Academic & Research": ["Essays", "Research Summaries"],
50
+ "πŸ” SEO Optimization": ["Keyword Rewrites", "Meta Descriptions"],
51
+ "🎭 Creative Writing": ["Storytelling", "Poetry", "Social Media Posts"]
52
+ }
53
+
54
+ selected_category = st.selectbox("Choose a category:", list(categories.keys()))
55
+
56
+ # Display subcategories as buttons
57
+ selected_subcategory = st.radio("Choose an enhancement type:", categories[selected_category])
58
+
59
+ # Enhance Prompt Button
60
+ if st.button("πŸš€ Enhance Prompt"):
61
+ st.write(f"πŸ”Ή **Enhanced Prompt for {selected_subcategory}:** [Prompt will be generated here]")