Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ const observer = new MutationObserver(mutations=>{
|
|
| 29 |
m.addedNodes.forEach(node=>{
|
| 30 |
if(node.classList && node.classList.contains('chat-message')){
|
| 31 |
node.style.opacity = 0;
|
| 32 |
-
node.style.transition = "opacity 0.
|
| 33 |
requestAnimationFrame(()=>{
|
| 34 |
node.style.opacity = 1;
|
| 35 |
});
|
|
@@ -47,16 +47,44 @@ document.addEventListener("DOMContentLoaded", ()=>{
|
|
| 47 |
|
| 48 |
with gr.Blocks(css="""
|
| 49 |
body{background-color:#000; font-family:'Arial',sans-serif;}
|
| 50 |
-
.gradio-container{
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
""") as demo:
|
| 57 |
with gr.Sidebar():
|
| 58 |
gr.LoginButton()
|
| 59 |
-
|
| 60 |
chatbot.render()
|
| 61 |
gr.HTML(fade_js)
|
| 62 |
|
|
|
|
| 29 |
m.addedNodes.forEach(node=>{
|
| 30 |
if(node.classList && node.classList.contains('chat-message')){
|
| 31 |
node.style.opacity = 0;
|
| 32 |
+
node.style.transition = "opacity 0.4s ease";
|
| 33 |
requestAnimationFrame(()=>{
|
| 34 |
node.style.opacity = 1;
|
| 35 |
});
|
|
|
|
| 47 |
|
| 48 |
with gr.Blocks(css="""
|
| 49 |
body{background-color:#000; font-family:'Arial',sans-serif;}
|
| 50 |
+
.gradio-container{
|
| 51 |
+
border-radius:30px;
|
| 52 |
+
padding:25px;
|
| 53 |
+
max-width:700px;
|
| 54 |
+
margin:20px auto;
|
| 55 |
+
background-color:#fff;
|
| 56 |
+
box-shadow:0 5px 20px rgba(0,0,0,0.1);
|
| 57 |
+
}
|
| 58 |
+
.chat-message{
|
| 59 |
+
border-radius:25px;
|
| 60 |
+
padding:14px 18px;
|
| 61 |
+
margin:8px 0;
|
| 62 |
+
display:flex;
|
| 63 |
+
flex-direction:column;
|
| 64 |
+
}
|
| 65 |
+
.chat-message.user{background-color:#dceefc; align-items:flex-end;}
|
| 66 |
+
.chat-message.bot{background-color:#f0f0f0; align-items:flex-start;}
|
| 67 |
+
textarea{
|
| 68 |
+
border:none;
|
| 69 |
+
outline:none;
|
| 70 |
+
border-radius:20px;
|
| 71 |
+
padding:10px;
|
| 72 |
+
background-color:#f7f7f7;
|
| 73 |
+
color:#000;
|
| 74 |
+
font-size:16px;
|
| 75 |
+
}
|
| 76 |
+
button{
|
| 77 |
+
border:none;
|
| 78 |
+
border-radius:20px;
|
| 79 |
+
background-color:#007bff;
|
| 80 |
+
color:#fff;
|
| 81 |
+
padding:8px 15px;
|
| 82 |
+
font-size:16px;
|
| 83 |
+
}
|
| 84 |
""") as demo:
|
| 85 |
with gr.Sidebar():
|
| 86 |
gr.LoginButton()
|
| 87 |
+
|
| 88 |
chatbot.render()
|
| 89 |
gr.HTML(fade_js)
|
| 90 |
|