rizzdeep commited on
Commit
618bbac
·
verified ·
1 Parent(s): 42ad55e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -27
app.py CHANGED
@@ -58,8 +58,13 @@ st.set_page_config(
58
  # ------------- Custom CSS Styling -------------
59
  st.markdown("""
60
  <style>
61
- /* Remove padding */
62
- .block-container { padding-top: 2rem; padding-bottom: 2rem; }
 
 
 
 
 
63
 
64
  /* Title styling */
65
  .title {
@@ -67,50 +72,57 @@ st.markdown("""
67
  font-weight: bold;
68
  color: #4A90E2;
69
  text-align: center;
70
- margin-bottom: 2rem;
71
- }
72
-
73
- /* Chat area container */
74
- .chat-container {
75
- max-width: 750px;
76
- margin: 0 auto;
77
  }
78
 
79
- /* Chat history box */
80
  .chat-history {
81
- height: 500px;
82
  overflow-y: auto;
83
  background-color: #F9F9F9;
84
- border-radius: 12px;
85
  padding: 1rem;
86
  border: 1px solid #DDD;
87
  margin-bottom: 1rem;
88
  }
89
 
90
- /* Message bubbles */
91
  .message-user {
92
  background-color: #DDF3FF;
93
- padding: 0.8rem;
94
  border-radius: 12px;
95
- margin-bottom: 0.5rem;
 
 
 
96
  }
 
 
97
  .message-bot {
98
  background-color: #E3FFE1;
99
- padding: 0.8rem;
100
  border-radius: 12px;
101
- margin-bottom: 0.5rem;
 
 
 
102
  }
103
 
104
- /* Input field */
105
  .stTextInput > div > input {
106
  font-size: 1rem;
107
- padding: 0.7rem;
108
- border-radius: 8px;
 
 
 
 
 
109
  }
110
 
111
- /* Button style */
112
  .stButton>button {
113
- border-radius: 8px;
114
  background-color: #4A90E2;
115
  color: white;
116
  font-size: 1rem;
@@ -120,15 +132,15 @@ st.markdown("""
120
  background-color: #357ABD;
121
  }
122
 
123
- /* Sidebar logo alignment */
124
  .sidebar-logo {
125
- display: flex;
126
- justify-content: center;
127
- margin-bottom: 20px;
128
  }
129
  </style>
130
  """, unsafe_allow_html=True)
131
 
 
132
  # ------------- Sidebar -------------
133
  with st.sidebar:
134
  st.markdown("<div class='sidebar-logo'><img src='https://cdn-icons-png.flaticon.com/512/4712/4712027.png' width='100'></div>", unsafe_allow_html=True)
@@ -182,4 +194,4 @@ with st.container():
182
  st.markdown(f"<div class='message-bot'><b>🤖 Bot:</b> {msg['content']}</div>", unsafe_allow_html=True)
183
  st.markdown("</div>", unsafe_allow_html=True)
184
 
185
- st.markdown("</div>", unsafe_allow_html=True) # End chat container
 
58
  # ------------- Custom CSS Styling -------------
59
  st.markdown("""
60
  <style>
61
+ /* Remove padding and center content */
62
+ .block-container {
63
+ padding-top: 2rem;
64
+ padding-bottom: 2rem;
65
+ max-width: 800px;
66
+ margin: auto;
67
+ }
68
 
69
  /* Title styling */
70
  .title {
 
72
  font-weight: bold;
73
  color: #4A90E2;
74
  text-align: center;
75
+ margin-bottom: 1.5rem;
 
 
 
 
 
 
76
  }
77
 
78
+ /* Chat container */
79
  .chat-history {
80
+ height: 450px;
81
  overflow-y: auto;
82
  background-color: #F9F9F9;
83
+ border-radius: 16px;
84
  padding: 1rem;
85
  border: 1px solid #DDD;
86
  margin-bottom: 1rem;
87
  }
88
 
89
+ /* User message styling */
90
  .message-user {
91
  background-color: #DDF3FF;
92
+ padding: 0.9rem;
93
  border-radius: 12px;
94
+ margin-bottom: 0.6rem;
95
+ text-align: left;
96
+ font-size: 1rem;
97
+ font-weight: 500;
98
  }
99
+
100
+ /* Bot message styling */
101
  .message-bot {
102
  background-color: #E3FFE1;
103
+ padding: 0.9rem;
104
  border-radius: 12px;
105
+ margin-bottom: 0.6rem;
106
+ text-align: left;
107
+ font-size: 1rem;
108
+ font-weight: 500;
109
  }
110
 
111
+ /* Text input compact styling */
112
  .stTextInput > div > input {
113
  font-size: 1rem;
114
+ padding: 0.6rem;
115
+ border-radius: 10px;
116
+ margin-bottom: 0.2rem;
117
+ }
118
+ /* Hide text input label text */
119
+ .stTextInput label {
120
+ display: none;
121
  }
122
 
123
+ /* Send button styling */
124
  .stButton>button {
125
+ border-radius: 10px;
126
  background-color: #4A90E2;
127
  color: white;
128
  font-size: 1rem;
 
132
  background-color: #357ABD;
133
  }
134
 
135
+ /* Sidebar image center */
136
  .sidebar-logo {
137
+ text-align: center;
138
+ margin-bottom: 1rem;
 
139
  }
140
  </style>
141
  """, unsafe_allow_html=True)
142
 
143
+
144
  # ------------- Sidebar -------------
145
  with st.sidebar:
146
  st.markdown("<div class='sidebar-logo'><img src='https://cdn-icons-png.flaticon.com/512/4712/4712027.png' width='100'></div>", unsafe_allow_html=True)
 
194
  st.markdown(f"<div class='message-bot'><b>🤖 Bot:</b> {msg['content']}</div>", unsafe_allow_html=True)
195
  st.markdown("</div>", unsafe_allow_html=True)
196
 
197
+ # End chat container