Update app.py
Browse files
app.py
CHANGED
|
@@ -42,12 +42,12 @@ st.set_page_config(page_title="Advanced AI Code Assistant", page_icon="💻", la
|
|
| 42 |
|
| 43 |
st.markdown("""
|
| 44 |
<style>
|
| 45 |
-
@import url('https://fonts.googleapis.com/css2?family=
|
| 46 |
|
| 47 |
body {
|
| 48 |
-
font-family: '
|
| 49 |
-
background-color: #
|
| 50 |
-
color: #
|
| 51 |
}
|
| 52 |
.stApp {
|
| 53 |
max-width: 1200px;
|
|
@@ -55,106 +55,99 @@ st.markdown("""
|
|
| 55 |
padding: 2rem;
|
| 56 |
}
|
| 57 |
.main-container {
|
| 58 |
-
background: #
|
| 59 |
-
border-radius:
|
| 60 |
-
padding:
|
| 61 |
-
box-shadow: 0
|
| 62 |
}
|
| 63 |
h1 {
|
| 64 |
-
font-size:
|
| 65 |
-
font-weight:
|
| 66 |
-
color: #
|
| 67 |
text-align: center;
|
| 68 |
margin-bottom: 1rem;
|
| 69 |
-
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
|
| 70 |
}
|
| 71 |
.subtitle {
|
| 72 |
-
font-size:
|
| 73 |
text-align: center;
|
| 74 |
-
color: #
|
| 75 |
-
margin-bottom:
|
| 76 |
}
|
| 77 |
.stTextArea textarea {
|
| 78 |
-
border:
|
| 79 |
-
border-radius:
|
| 80 |
font-size: 1rem;
|
| 81 |
-
padding:
|
| 82 |
-
transition:
|
| 83 |
-
background: #1e1e1e;
|
| 84 |
-
color: #e0e0e0;
|
| 85 |
-
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
|
| 86 |
}
|
| 87 |
.stTextArea textarea:focus {
|
| 88 |
-
border-color: #
|
| 89 |
-
|
| 90 |
}
|
| 91 |
.stButton button {
|
| 92 |
-
background-color: #
|
| 93 |
-
color:
|
| 94 |
border: none;
|
| 95 |
-
border-radius:
|
| 96 |
-
font-size:
|
| 97 |
-
font-weight:
|
| 98 |
-
padding: 0.
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
box-shadow: 0 4px 6px rgba(130, 170, 255, 0.3);
|
| 102 |
}
|
| 103 |
.stButton button:hover {
|
| 104 |
-
background-color: #
|
| 105 |
transform: translateY(-2px);
|
| 106 |
-
box-shadow: 0 6px 8px rgba(130, 170, 255, 0.4);
|
| 107 |
}
|
| 108 |
.output-container {
|
| 109 |
-
background: #
|
| 110 |
-
border-radius:
|
| 111 |
-
padding:
|
| 112 |
-
margin-top:
|
| 113 |
-
border: 1px solid #
|
| 114 |
}
|
| 115 |
.code-block {
|
| 116 |
-
background-color: #
|
| 117 |
-
border-radius:
|
| 118 |
-
padding:
|
| 119 |
margin-top: 1rem;
|
| 120 |
overflow-x: auto;
|
| 121 |
}
|
| 122 |
.stAlert {
|
| 123 |
-
background-color: #
|
| 124 |
-
color: #
|
| 125 |
-
border-radius:
|
| 126 |
border: none;
|
| 127 |
-
padding: 1rem
|
| 128 |
margin-bottom: 1rem;
|
| 129 |
}
|
| 130 |
.stSpinner {
|
| 131 |
-
color: #
|
| 132 |
}
|
| 133 |
/* Custom scrollbar */
|
| 134 |
::-webkit-scrollbar {
|
| 135 |
width: 8px;
|
| 136 |
-
height: 8px;
|
| 137 |
}
|
| 138 |
::-webkit-scrollbar-track {
|
| 139 |
-
background: #
|
| 140 |
border-radius: 4px;
|
| 141 |
}
|
| 142 |
::-webkit-scrollbar-thumb {
|
| 143 |
-
background: #
|
| 144 |
border-radius: 4px;
|
| 145 |
}
|
| 146 |
::-webkit-scrollbar-thumb:hover {
|
| 147 |
-
background: #
|
| 148 |
}
|
| 149 |
.source {
|
| 150 |
font-family: 'Fira Code', monospace;
|
| 151 |
font-size: 0.9rem;
|
| 152 |
-
line-height: 1.
|
| 153 |
}
|
| 154 |
.source .linenos {
|
| 155 |
-
color: #
|
| 156 |
-
padding-right:
|
| 157 |
-
border-right: 1px solid #
|
| 158 |
user-select: none;
|
| 159 |
}
|
| 160 |
.source pre {
|
|
@@ -168,7 +161,7 @@ st.markdown('<div class="main-container">', unsafe_allow_html=True)
|
|
| 168 |
st.title("💻 Advanced AI Code Assistant")
|
| 169 |
st.markdown('<p class="subtitle">Powered by Google Gemini - Expert-level coding solutions</p>', unsafe_allow_html=True)
|
| 170 |
|
| 171 |
-
prompt = st.text_area("What advanced coding challenge can I assist you with today?", height=
|
| 172 |
|
| 173 |
if st.button("Generate Expert Code"):
|
| 174 |
if prompt.strip() == "":
|
|
@@ -194,7 +187,7 @@ if st.button("Generate Expert Code"):
|
|
| 194 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 195 |
|
| 196 |
st.markdown("""
|
| 197 |
-
<div style='text-align: center; margin-top: 2rem; color: #
|
| 198 |
Crafted with ❤️ by Your Advanced AI Code Assistant
|
| 199 |
</div>
|
| 200 |
""", unsafe_allow_html=True)
|
|
|
|
| 42 |
|
| 43 |
st.markdown("""
|
| 44 |
<style>
|
| 45 |
+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
|
| 46 |
|
| 47 |
body {
|
| 48 |
+
font-family: 'Roboto', sans-serif;
|
| 49 |
+
background-color: #e9ecef;
|
| 50 |
+
color: #212529;
|
| 51 |
}
|
| 52 |
.stApp {
|
| 53 |
max-width: 1200px;
|
|
|
|
| 55 |
padding: 2rem;
|
| 56 |
}
|
| 57 |
.main-container {
|
| 58 |
+
background: #ffffff;
|
| 59 |
+
border-radius: 12px;
|
| 60 |
+
padding: 2rem;
|
| 61 |
+
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
| 62 |
}
|
| 63 |
h1 {
|
| 64 |
+
font-size: 2.5rem;
|
| 65 |
+
font-weight: 600;
|
| 66 |
+
color: #0d6efd;
|
| 67 |
text-align: center;
|
| 68 |
margin-bottom: 1rem;
|
|
|
|
| 69 |
}
|
| 70 |
.subtitle {
|
| 71 |
+
font-size: 1rem;
|
| 72 |
text-align: center;
|
| 73 |
+
color: #6c757d;
|
| 74 |
+
margin-bottom: 2rem;
|
| 75 |
}
|
| 76 |
.stTextArea textarea {
|
| 77 |
+
border: 1px solid #ced4da;
|
| 78 |
+
border-radius: 8px;
|
| 79 |
font-size: 1rem;
|
| 80 |
+
padding: 0.75rem;
|
| 81 |
+
transition: border-color 0.3s;
|
|
|
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
.stTextArea textarea:focus {
|
| 84 |
+
border-color: #0d6efd;
|
| 85 |
+
outline: none;
|
| 86 |
}
|
| 87 |
.stButton button {
|
| 88 |
+
background-color: #0d6efd;
|
| 89 |
+
color: white;
|
| 90 |
border: none;
|
| 91 |
+
border-radius: 8px;
|
| 92 |
+
font-size: 1rem;
|
| 93 |
+
font-weight: 500;
|
| 94 |
+
padding: 0.5rem 1.5rem;
|
| 95 |
+
cursor: pointer;
|
| 96 |
+
transition: background-color 0.3s, transform 0.2s;
|
|
|
|
| 97 |
}
|
| 98 |
.stButton button:hover {
|
| 99 |
+
background-color: #0b5ed7;
|
| 100 |
transform: translateY(-2px);
|
|
|
|
| 101 |
}
|
| 102 |
.output-container {
|
| 103 |
+
background: #f8f9fa;
|
| 104 |
+
border-radius: 8px;
|
| 105 |
+
padding: 1rem;
|
| 106 |
+
margin-top: 1.5rem;
|
| 107 |
+
border: 1px solid #dee2e6;
|
| 108 |
}
|
| 109 |
.code-block {
|
| 110 |
+
background-color: #343a40;
|
| 111 |
+
border-radius: 8px;
|
| 112 |
+
padding: 1rem;
|
| 113 |
margin-top: 1rem;
|
| 114 |
overflow-x: auto;
|
| 115 |
}
|
| 116 |
.stAlert {
|
| 117 |
+
background-color: #cce5ff;
|
| 118 |
+
color: #004085;
|
| 119 |
+
border-radius: 8px;
|
| 120 |
border: none;
|
| 121 |
+
padding: 1rem;
|
| 122 |
margin-bottom: 1rem;
|
| 123 |
}
|
| 124 |
.stSpinner {
|
| 125 |
+
color: #0d6efd;
|
| 126 |
}
|
| 127 |
/* Custom scrollbar */
|
| 128 |
::-webkit-scrollbar {
|
| 129 |
width: 8px;
|
|
|
|
| 130 |
}
|
| 131 |
::-webkit-scrollbar-track {
|
| 132 |
+
background: #f1f3f5;
|
| 133 |
border-radius: 4px;
|
| 134 |
}
|
| 135 |
::-webkit-scrollbar-thumb {
|
| 136 |
+
background: #868e96;
|
| 137 |
border-radius: 4px;
|
| 138 |
}
|
| 139 |
::-webkit-scrollbar-thumb:hover {
|
| 140 |
+
background: #495057;
|
| 141 |
}
|
| 142 |
.source {
|
| 143 |
font-family: 'Fira Code', monospace;
|
| 144 |
font-size: 0.9rem;
|
| 145 |
+
line-height: 1.5;
|
| 146 |
}
|
| 147 |
.source .linenos {
|
| 148 |
+
color: #6c757d;
|
| 149 |
+
padding-right: 8px;
|
| 150 |
+
border-right: 1px solid #495057;
|
| 151 |
user-select: none;
|
| 152 |
}
|
| 153 |
.source pre {
|
|
|
|
| 161 |
st.title("💻 Advanced AI Code Assistant")
|
| 162 |
st.markdown('<p class="subtitle">Powered by Google Gemini - Expert-level coding solutions</p>', unsafe_allow_html=True)
|
| 163 |
|
| 164 |
+
prompt = st.text_area("What advanced coding challenge can I assist you with today?", height=100)
|
| 165 |
|
| 166 |
if st.button("Generate Expert Code"):
|
| 167 |
if prompt.strip() == "":
|
|
|
|
| 187 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 188 |
|
| 189 |
st.markdown("""
|
| 190 |
+
<div style='text-align: center; margin-top: 2rem; color: #6c757d;'>
|
| 191 |
Crafted with ❤️ by Your Advanced AI Code Assistant
|
| 192 |
</div>
|
| 193 |
""", unsafe_allow_html=True)
|