File size: 1,633 Bytes
2902b7d 0d33a14 2902b7d 0d33a14 2902b7d 0d33a14 2902b7d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
css = '''
<style>
.chat-message {
padding: 1.5rem; border-radius: 0.5rem; margin-bottom: 1rem; display: flex
}
.chat-message.user {
background-color: #2b313e
}
.chat-message.bot {
background-color: #475063
}
.chat-message .avatar {
width: 20%;
}
.chat-message .avatar img {
max-width: 78px;
max-height: 78px;
border-radius: 50%;
object-fit: cover;
}
.chat-message .message {
width: 80%;
padding: 0 1.5rem;
color: #fff;
}
'''
bot_template = '''
<div style="display: flex; align-items: center; margin-bottom: 10px; background-color: #B22222; padding: 10px; border-radius: 10px; border: 1px solid #7A0000;">
<div style="flex-shrink: 0; margin-right: 10px;">
<img src="https://raw.githubusercontent.com/AalaaAyman24/Test/main/chatbot.png"
style="max-height: 50px; max-width: 50px; object-fit: cover;">
</div>
<div style="background-color: #B22222; color: white; padding: 10px; border-radius: 10px; max-width: 75%; word-wrap: break-word; overflow-wrap: break-word;">
{{MSG}}
</div>
</div>
'''
user_template = '''
<div style="display: flex; align-items: center; margin-bottom: 10px; justify-content: flex-end;">
<div style="flex-shrink: 0; margin-left: 10px;">
<img src="https://raw.githubusercontent.com/AalaaAyman24/Test/main/question.png"
style="max-height: 50px; max-width: 50px; border-radius: 50%; object-fit: cover;">
</div>
<div style="background-color: #757882; color: white; padding: 10px; border-radius: 10px; max-width: 75%; word-wrap: break-word; overflow-wrap: break-word;">
{{MSG}}
</div>
</div>
''' |