Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -121,42 +121,67 @@ def chat_with_portfolio(message, history):
|
|
| 121 |
|
| 122 |
# Aesthetics
|
| 123 |
# Purple Gradient
|
|
|
|
| 124 |
custom_css = """
|
| 125 |
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');
|
| 126 |
|
| 127 |
-
*
|
| 128 |
-
|
| 129 |
-
}
|
| 130 |
|
|
|
|
| 131 |
.gradio-container {
|
| 132 |
-
|
| 133 |
-
background:
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
}
|
| 136 |
|
| 137 |
-
/*
|
| 138 |
-
.
|
| 139 |
-
background
|
| 140 |
-
|
| 141 |
-
|
| 142 |
}
|
| 143 |
"""
|
| 144 |
|
| 145 |
-
# Layout Gradio UI
|
| 146 |
with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
|
|
|
|
|
|
|
|
|
| 147 |
gr.ChatInterface(
|
| 148 |
fn=chat_with_portfolio,
|
| 149 |
-
|
| 150 |
-
description="Ask me anything about Adda's portfolio, experience, and background!",
|
| 151 |
examples=[
|
| 152 |
"What is Adda's experience with Python?",
|
| 153 |
"Tell me about her education.",
|
| 154 |
"What projects has Adda worked on?"
|
| 155 |
],
|
| 156 |
-
#
|
| 157 |
-
type="messages"
|
| 158 |
)
|
| 159 |
|
| 160 |
-
# Apply the 'Pretty' settings here
|
| 161 |
if __name__ == "__main__":
|
| 162 |
demo.launch()
|
|
|
|
| 121 |
|
| 122 |
# Aesthetics
|
| 123 |
# Purple Gradient
|
| 124 |
+
# Modern Glassmorphism CSS for Gradio 5
|
| 125 |
custom_css = """
|
| 126 |
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');
|
| 127 |
|
| 128 |
+
/* Global Font and Body */
|
| 129 |
+
* { font-family: 'Quicksand', sans-serif !important; }
|
|
|
|
| 130 |
|
| 131 |
+
/* The Main Background */
|
| 132 |
.gradio-container {
|
| 133 |
+
background: linear-gradient(135deg, #a78bfa 0%, #6366f1 50%, #3b82f6 100%) !important;
|
| 134 |
+
background-attachment: fixed !important;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
/* Glassmorphism for the Chat bubbles */
|
| 138 |
+
.message {
|
| 139 |
+
background: rgba(255, 255, 255, 0.15) !important;
|
| 140 |
+
backdrop-filter: blur(12px) !important;
|
| 141 |
+
-webkit-backdrop-filter: blur(12px) !important;
|
| 142 |
+
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 143 |
+
border-radius: 20px !important;
|
| 144 |
+
color: white !important;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/* Fix the Input Box so it's also Glassy */
|
| 148 |
+
footer { display: none !important; } /* Hides the 'built with Gradio' footer */
|
| 149 |
+
|
| 150 |
+
#input-box textarea {
|
| 151 |
+
background: rgba(255, 255, 255, 0.1) !important;
|
| 152 |
+
backdrop-filter: blur(8px) !important;
|
| 153 |
+
color: white !important;
|
| 154 |
+
border: 1px solid rgba(255, 255, 255, 0.3) !important;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
/* IMPORTANT: Fixes the "Giant Icon" bug by containing the button size */
|
| 158 |
+
button.primary {
|
| 159 |
+
max-width: 150px !important;
|
| 160 |
+
height: auto !important;
|
| 161 |
}
|
| 162 |
|
| 163 |
+
/* Glass effect for the examples buttons */
|
| 164 |
+
.load-example-btn {
|
| 165 |
+
background: rgba(255, 255, 255, 0.1) !important;
|
| 166 |
+
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 167 |
+
color: white !important;
|
| 168 |
}
|
| 169 |
"""
|
| 170 |
|
|
|
|
| 171 |
with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
| 172 |
+
# Title with specific white color for contrast
|
| 173 |
+
gr.Markdown("<h1 style='text-align: center; color: white;'>πββ¬ Chat with Adda-Bot</h1>")
|
| 174 |
+
|
| 175 |
gr.ChatInterface(
|
| 176 |
fn=chat_with_portfolio,
|
| 177 |
+
description="<span style='color: white;'>Ask me anything about Adda's portfolio!</span>",
|
|
|
|
| 178 |
examples=[
|
| 179 |
"What is Adda's experience with Python?",
|
| 180 |
"Tell me about her education.",
|
| 181 |
"What projects has Adda worked on?"
|
| 182 |
],
|
| 183 |
+
type="messages", # Ensures modern formatting
|
|
|
|
| 184 |
)
|
| 185 |
|
|
|
|
| 186 |
if __name__ == "__main__":
|
| 187 |
demo.launch()
|