Update app.py
Browse files
app.py
CHANGED
|
@@ -54,56 +54,106 @@ def get_chatbot_response(user_message, insurance_type, country, conversation_his
|
|
| 54 |
|
| 55 |
return conversation_history, chat_display
|
| 56 |
|
| 57 |
-
# ✅ Styling and Theme with
|
| 58 |
theme = gr.themes.Base().set(
|
| 59 |
-
body_background_fill="#
|
| 60 |
-
button_primary_background_fill="#
|
| 61 |
-
button_primary_text_color="
|
| 62 |
)
|
| 63 |
|
| 64 |
custom_css = """
|
| 65 |
-
/*
|
| 66 |
.title-text {
|
| 67 |
-
background: linear-gradient(90deg, #
|
| 68 |
-webkit-background-clip: text;
|
| 69 |
background-clip: text;
|
| 70 |
color: transparent;
|
| 71 |
-webkit-text-fill-color: transparent;
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
font-weight: bold;
|
| 75 |
text-align: center;
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
}
|
| 78 |
|
| 79 |
-
/*
|
| 80 |
body, .gradio-container {
|
| 81 |
-
color: #FFD700 !important; /*
|
|
|
|
| 82 |
}
|
| 83 |
|
| 84 |
-
/*
|
| 85 |
.chat-message {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
color: white !important;
|
| 87 |
}
|
| 88 |
|
| 89 |
-
/*
|
| 90 |
.insurance-button {
|
| 91 |
-
border:
|
| 92 |
-
background
|
| 93 |
-
font-size:
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
| 98 |
}
|
|
|
|
|
|
|
| 99 |
.insurance-button:hover {
|
| 100 |
-
background: linear-gradient(90deg, #FFD700, #
|
| 101 |
-
color:
|
|
|
|
|
|
|
| 102 |
}
|
| 103 |
|
| 104 |
-
/* Chatbot
|
| 105 |
.gradio-container .block.markdown {
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
}
|
| 108 |
"""
|
| 109 |
|
|
|
|
| 54 |
|
| 55 |
return conversation_history, chat_display
|
| 56 |
|
| 57 |
+
# ✅ Styling and Theme with a Sophisticated UI
|
| 58 |
theme = gr.themes.Base().set(
|
| 59 |
+
body_background_fill="linear-gradient(to right, #001F3F, #0052CC)", # Dark navy to royal blue
|
| 60 |
+
button_primary_background_fill="linear-gradient(135deg, #FFD700, #FFAA00)", # Golden gradient
|
| 61 |
+
button_primary_text_color="black"
|
| 62 |
)
|
| 63 |
|
| 64 |
custom_css = """
|
| 65 |
+
/* Elegant title styling with a gold-illuminated effect */
|
| 66 |
.title-text {
|
| 67 |
+
background: linear-gradient(90deg, #FFD700, #FFAA00);
|
| 68 |
-webkit-background-clip: text;
|
| 69 |
background-clip: text;
|
| 70 |
color: transparent;
|
| 71 |
-webkit-text-fill-color: transparent;
|
| 72 |
+
font-weight: 700;
|
| 73 |
+
font-size: 48px;
|
|
|
|
| 74 |
text-align: center;
|
| 75 |
+
text-transform: uppercase;
|
| 76 |
+
letter-spacing: 1.5px;
|
| 77 |
+
text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.3);
|
| 78 |
}
|
| 79 |
|
| 80 |
+
/* Sophisticated body text - Gold on Dark Background */
|
| 81 |
body, .gradio-container {
|
| 82 |
+
color: #FFD700 !important; /* Premium gold text */
|
| 83 |
+
font-family: 'Inter', sans-serif;
|
| 84 |
}
|
| 85 |
|
| 86 |
+
/* Chat messages - Glassmorphic styling */
|
| 87 |
.chat-message {
|
| 88 |
+
background: rgba(255, 255, 255, 0.1); /* Subtle transparent white */
|
| 89 |
+
border-radius: 12px;
|
| 90 |
+
padding: 12px;
|
| 91 |
+
backdrop-filter: blur(10px);
|
| 92 |
color: white !important;
|
| 93 |
}
|
| 94 |
|
| 95 |
+
/* Buttons - Glassmorphism with subtle glow */
|
| 96 |
.insurance-button {
|
| 97 |
+
border: 2px solid rgba(255, 215, 0, 0.8);
|
| 98 |
+
background: rgba(0, 0, 0, 0.2);
|
| 99 |
+
font-size: 16px;
|
| 100 |
+
font-weight: bold;
|
| 101 |
+
padding: 8px 20px;
|
| 102 |
+
border-radius: 24px;
|
| 103 |
+
margin: 5px;
|
| 104 |
+
color: #FFD700; /* Gold text */
|
| 105 |
+
transition: all 0.3s ease-in-out;
|
| 106 |
}
|
| 107 |
+
|
| 108 |
+
/* Button hover effect with glowing effect */
|
| 109 |
.insurance-button:hover {
|
| 110 |
+
background: linear-gradient(90deg, #FFD700, #FFAA00);
|
| 111 |
+
color: black !important;
|
| 112 |
+
transform: scale(1.05);
|
| 113 |
+
box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
|
| 114 |
}
|
| 115 |
|
| 116 |
+
/* Chatbot container - Transparent glass panel */
|
| 117 |
.gradio-container .block.markdown {
|
| 118 |
+
background: rgba(255, 255, 255, 0.1);
|
| 119 |
+
border-radius: 12px;
|
| 120 |
+
padding: 15px;
|
| 121 |
+
backdrop-filter: blur(12px);
|
| 122 |
+
color: #FFD700 !important; /* Gold text */
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
/* Input field - Premium styling */
|
| 126 |
+
textarea {
|
| 127 |
+
background: rgba(255, 255, 255, 0.05);
|
| 128 |
+
border: 1px solid rgba(255, 215, 0, 0.5);
|
| 129 |
+
border-radius: 8px;
|
| 130 |
+
color: white !important;
|
| 131 |
+
font-size: 16px;
|
| 132 |
+
padding: 10px;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/* Glow effect on input focus */
|
| 136 |
+
textarea:focus {
|
| 137 |
+
box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
|
| 138 |
+
border-color: #FFD700;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
/* Send button - Luxurious design */
|
| 142 |
+
button.primary {
|
| 143 |
+
background: linear-gradient(135deg, #FFD700, #FFAA00);
|
| 144 |
+
border: none;
|
| 145 |
+
color: black !important;
|
| 146 |
+
font-weight: bold;
|
| 147 |
+
text-transform: uppercase;
|
| 148 |
+
border-radius: 20px;
|
| 149 |
+
padding: 10px 20px;
|
| 150 |
+
transition: all 0.3s ease-in-out;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
/* Send button hover */
|
| 154 |
+
button.primary:hover {
|
| 155 |
+
transform: scale(1.1);
|
| 156 |
+
box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
|
| 157 |
}
|
| 158 |
"""
|
| 159 |
|