Kim Juwon
commited on
Commit
·
ea24680
1
Parent(s):
517d30a
update UI/UX
Browse files
app.py
CHANGED
|
@@ -82,30 +82,16 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
| 82 |
|
| 83 |
# Custom CSS styles
|
| 84 |
custom_css = """
|
| 85 |
-
:root {
|
| 86 |
-
--primary-color: #2196f3;
|
| 87 |
-
--primary-hover: #1976d2;
|
| 88 |
-
--background-color: #f8f9fa;
|
| 89 |
-
--text-color: #333333;
|
| 90 |
-
--border-color: #e0e0e0;
|
| 91 |
-
--chat-user-bg: #e3f2fd;
|
| 92 |
-
--chat-bot-bg: #f5f5f5;
|
| 93 |
-
--panel-bg: #ffffff;
|
| 94 |
-
--spacing-unit: 16px;
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
.gradio-container {
|
| 98 |
-
font-family: 'Helvetica Neue', Arial, sans-serif;
|
| 99 |
max-width: 1200px;
|
| 100 |
margin: auto;
|
| 101 |
-
padding:
|
| 102 |
-
background-color: var(--background-color);
|
| 103 |
}
|
| 104 |
|
| 105 |
.container {
|
| 106 |
max-width: 800px;
|
| 107 |
margin: auto;
|
| 108 |
-
padding:
|
| 109 |
}
|
| 110 |
|
| 111 |
/* Chat container styles */
|
|
@@ -113,146 +99,116 @@ custom_css = """
|
|
| 113 |
display: flex;
|
| 114 |
flex-direction: column;
|
| 115 |
height: 100%;
|
| 116 |
-
background:
|
| 117 |
-
border-radius:
|
| 118 |
-
box-shadow: 0 2px
|
| 119 |
-
margin-bottom:
|
| 120 |
}
|
| 121 |
|
| 122 |
/* Chat message styles */
|
| 123 |
.chat-message {
|
| 124 |
-
padding:
|
| 125 |
-
margin:
|
| 126 |
-
border-radius:
|
| 127 |
max-width: 85%;
|
| 128 |
line-height: 1.5;
|
| 129 |
-
position: relative;
|
| 130 |
}
|
| 131 |
|
| 132 |
/* User message styles */
|
| 133 |
.user-message {
|
| 134 |
-
background-color:
|
| 135 |
margin-left: auto;
|
| 136 |
-
border-bottom-right-radius: 4px;
|
| 137 |
}
|
| 138 |
|
| 139 |
/* Bot message styles */
|
| 140 |
.bot-message {
|
| 141 |
-
background-color:
|
| 142 |
margin-right: auto;
|
| 143 |
-
border-bottom-left-radius: 4px;
|
| 144 |
}
|
| 145 |
|
| 146 |
/* Input area styles */
|
| 147 |
.input-container {
|
| 148 |
display: flex;
|
| 149 |
-
gap:
|
| 150 |
-
padding:
|
| 151 |
-
background:
|
| 152 |
-
border-top: 1px solid
|
| 153 |
position: sticky;
|
| 154 |
bottom: 0;
|
| 155 |
-
border-bottom-left-radius: 12px;
|
| 156 |
-
border-bottom-right-radius: 12px;
|
| 157 |
}
|
| 158 |
|
| 159 |
/* Input field styles */
|
| 160 |
input[type="text"] {
|
| 161 |
flex: 1;
|
| 162 |
-
padding:
|
| 163 |
-
border: 1px solid
|
| 164 |
-
border-radius:
|
| 165 |
-
font-size:
|
| 166 |
-
transition: border-color 0.3s ease;
|
| 167 |
-
background-color: var(--panel-bg);
|
| 168 |
}
|
| 169 |
|
| 170 |
input[type="text"]:focus {
|
| 171 |
-
border-color:
|
| 172 |
outline: none;
|
| 173 |
}
|
| 174 |
|
| 175 |
/* Button styles */
|
| 176 |
button {
|
| 177 |
-
padding:
|
| 178 |
border: none;
|
| 179 |
-
border-radius:
|
| 180 |
-
background-color:
|
| 181 |
color: white;
|
| 182 |
-
font-weight:
|
| 183 |
cursor: pointer;
|
| 184 |
-
transition: background-color 0.3s ease;
|
| 185 |
}
|
| 186 |
|
| 187 |
button:hover {
|
| 188 |
-
background-color:
|
| 189 |
}
|
| 190 |
|
| 191 |
/* Settings panel styles */
|
| 192 |
.settings-panel {
|
| 193 |
-
background:
|
| 194 |
-
padding:
|
| 195 |
-
border-radius:
|
| 196 |
-
box-shadow: 0 2px
|
| 197 |
-
margin-bottom:
|
| 198 |
}
|
| 199 |
|
| 200 |
/* Dropdown styles */
|
| 201 |
select {
|
| 202 |
width: 100%;
|
| 203 |
-
padding:
|
| 204 |
-
border: 1px solid
|
| 205 |
-
border-radius:
|
| 206 |
-
margin-bottom:
|
| 207 |
-
background-color: var(--panel-bg);
|
| 208 |
}
|
| 209 |
|
| 210 |
/* Slider styles */
|
| 211 |
input[type="range"] {
|
| 212 |
width: 100%;
|
| 213 |
-
margin:
|
| 214 |
}
|
| 215 |
|
| 216 |
/* Markdown styles */
|
| 217 |
.markdown {
|
| 218 |
-
|
| 219 |
-
margin-bottom: var(--spacing-unit);
|
| 220 |
}
|
| 221 |
|
| 222 |
/* Group styles */
|
| 223 |
.group {
|
| 224 |
-
margin-bottom:
|
| 225 |
}
|
| 226 |
|
| 227 |
/* Label styles */
|
| 228 |
label {
|
| 229 |
-
|
| 230 |
-
margin-bottom: calc(var(--spacing-unit) * 0.5);
|
| 231 |
font-weight: 500;
|
| 232 |
}
|
| 233 |
|
| 234 |
/* Header styles */
|
| 235 |
h1, h2, h3 {
|
| 236 |
-
|
| 237 |
-
margin-bottom: var(--spacing-unit);
|
| 238 |
-
}
|
| 239 |
-
|
| 240 |
-
/* Scrollbar styles */
|
| 241 |
-
::-webkit-scrollbar {
|
| 242 |
-
width: 8px;
|
| 243 |
-
}
|
| 244 |
-
|
| 245 |
-
::-webkit-scrollbar-track {
|
| 246 |
-
background: var(--background-color);
|
| 247 |
-
}
|
| 248 |
-
|
| 249 |
-
::-webkit-scrollbar-thumb {
|
| 250 |
-
background: var(--border-color);
|
| 251 |
-
border-radius: 4px;
|
| 252 |
-
}
|
| 253 |
-
|
| 254 |
-
::-webkit-scrollbar-thumb:hover {
|
| 255 |
-
background: var(--primary-color);
|
| 256 |
}
|
| 257 |
"""
|
| 258 |
|
|
|
|
| 82 |
|
| 83 |
# Custom CSS styles
|
| 84 |
custom_css = """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
.gradio-container {
|
|
|
|
| 86 |
max-width: 1200px;
|
| 87 |
margin: auto;
|
| 88 |
+
padding: 16px;
|
|
|
|
| 89 |
}
|
| 90 |
|
| 91 |
.container {
|
| 92 |
max-width: 800px;
|
| 93 |
margin: auto;
|
| 94 |
+
padding: 16px;
|
| 95 |
}
|
| 96 |
|
| 97 |
/* Chat container styles */
|
|
|
|
| 99 |
display: flex;
|
| 100 |
flex-direction: column;
|
| 101 |
height: 100%;
|
| 102 |
+
background: white;
|
| 103 |
+
border-radius: 8px;
|
| 104 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
| 105 |
+
margin-bottom: 16px;
|
| 106 |
}
|
| 107 |
|
| 108 |
/* Chat message styles */
|
| 109 |
.chat-message {
|
| 110 |
+
padding: 12px;
|
| 111 |
+
margin: 8px;
|
| 112 |
+
border-radius: 8px;
|
| 113 |
max-width: 85%;
|
| 114 |
line-height: 1.5;
|
|
|
|
| 115 |
}
|
| 116 |
|
| 117 |
/* User message styles */
|
| 118 |
.user-message {
|
| 119 |
+
background-color: #e3f2fd;
|
| 120 |
margin-left: auto;
|
|
|
|
| 121 |
}
|
| 122 |
|
| 123 |
/* Bot message styles */
|
| 124 |
.bot-message {
|
| 125 |
+
background-color: #f5f5f5;
|
| 126 |
margin-right: auto;
|
|
|
|
| 127 |
}
|
| 128 |
|
| 129 |
/* Input area styles */
|
| 130 |
.input-container {
|
| 131 |
display: flex;
|
| 132 |
+
gap: 8px;
|
| 133 |
+
padding: 12px;
|
| 134 |
+
background: white;
|
| 135 |
+
border-top: 1px solid #e0e0e0;
|
| 136 |
position: sticky;
|
| 137 |
bottom: 0;
|
|
|
|
|
|
|
| 138 |
}
|
| 139 |
|
| 140 |
/* Input field styles */
|
| 141 |
input[type="text"] {
|
| 142 |
flex: 1;
|
| 143 |
+
padding: 8px;
|
| 144 |
+
border: 1px solid #e0e0e0;
|
| 145 |
+
border-radius: 4px;
|
| 146 |
+
font-size: 14px;
|
|
|
|
|
|
|
| 147 |
}
|
| 148 |
|
| 149 |
input[type="text"]:focus {
|
| 150 |
+
border-color: #2196f3;
|
| 151 |
outline: none;
|
| 152 |
}
|
| 153 |
|
| 154 |
/* Button styles */
|
| 155 |
button {
|
| 156 |
+
padding: 8px 16px;
|
| 157 |
border: none;
|
| 158 |
+
border-radius: 4px;
|
| 159 |
+
background-color: #2196f3;
|
| 160 |
color: white;
|
| 161 |
+
font-weight: 500;
|
| 162 |
cursor: pointer;
|
|
|
|
| 163 |
}
|
| 164 |
|
| 165 |
button:hover {
|
| 166 |
+
background-color: #1976d2;
|
| 167 |
}
|
| 168 |
|
| 169 |
/* Settings panel styles */
|
| 170 |
.settings-panel {
|
| 171 |
+
background: white;
|
| 172 |
+
padding: 16px;
|
| 173 |
+
border-radius: 8px;
|
| 174 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
| 175 |
+
margin-bottom: 16px;
|
| 176 |
}
|
| 177 |
|
| 178 |
/* Dropdown styles */
|
| 179 |
select {
|
| 180 |
width: 100%;
|
| 181 |
+
padding: 8px;
|
| 182 |
+
border: 1px solid #e0e0e0;
|
| 183 |
+
border-radius: 4px;
|
| 184 |
+
margin-bottom: 8px;
|
|
|
|
| 185 |
}
|
| 186 |
|
| 187 |
/* Slider styles */
|
| 188 |
input[type="range"] {
|
| 189 |
width: 100%;
|
| 190 |
+
margin: 8px 0;
|
| 191 |
}
|
| 192 |
|
| 193 |
/* Markdown styles */
|
| 194 |
.markdown {
|
| 195 |
+
margin-bottom: 16px;
|
|
|
|
| 196 |
}
|
| 197 |
|
| 198 |
/* Group styles */
|
| 199 |
.group {
|
| 200 |
+
margin-bottom: 16px;
|
| 201 |
}
|
| 202 |
|
| 203 |
/* Label styles */
|
| 204 |
label {
|
| 205 |
+
margin-bottom: 8px;
|
|
|
|
| 206 |
font-weight: 500;
|
| 207 |
}
|
| 208 |
|
| 209 |
/* Header styles */
|
| 210 |
h1, h2, h3 {
|
| 211 |
+
margin-bottom: 16px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
}
|
| 213 |
"""
|
| 214 |
|