96 lines
2.7 KiB
HTML
96 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>{{ title }}</title>
|
|
<style>
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background-color: #1a1a2e;
|
|
color: #e0e0e0;
|
|
line-height: 1.6;
|
|
padding: 20px;
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
}
|
|
h1 {
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
color: #6d4aff;
|
|
}
|
|
.chat-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16px;
|
|
}
|
|
.message {
|
|
max-width: 75%;
|
|
padding: 12px 18px;
|
|
border-radius: 18px;
|
|
}
|
|
.message.user {
|
|
align-self: flex-end;
|
|
background-color: #6d4aff;
|
|
border-bottom-right-radius: 4px;
|
|
}
|
|
.message.assistant {
|
|
align-self: flex-start;
|
|
background-color: #2d2d44;
|
|
border-bottom-left-radius: 4px;
|
|
}
|
|
.message-role {
|
|
font-size: 0.75em;
|
|
opacity: 0.7;
|
|
margin-bottom: 4px;
|
|
font-weight: 600;
|
|
}
|
|
.message-content { word-wrap: break-word; }
|
|
.message-content pre {
|
|
background-color: rgba(0, 0, 0, 0.3);
|
|
padding: 8px 12px;
|
|
border-radius: 8px;
|
|
overflow-x: auto;
|
|
margin: 8px 0;
|
|
}
|
|
.message-content code {
|
|
font-family: 'Monaco', 'Menlo', monospace;
|
|
font-size: 0.9em;
|
|
}
|
|
.message-images {
|
|
margin-top: 10px;
|
|
display: flex;
|
|
gap: 8px;
|
|
flex-wrap: wrap;
|
|
}
|
|
.message-images img {
|
|
max-width: 150px;
|
|
border-radius: 8px;
|
|
object-fit: cover;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>{{ title }}</h1>
|
|
<div class="chat-container">
|
|
{% for msg in messages %}
|
|
<div class="message {{ msg.role }}">
|
|
<span class="message-role">
|
|
{{ "User" if msg.role == "user" else "Assistant" }}
|
|
</span>
|
|
<div class="message-content">{{ msg.content_esc }}</div>
|
|
{% if msg.images %}
|
|
<div class="message-images">
|
|
{% for img in msg.images %}
|
|
{% if img.url %}
|
|
<img src="{{ img.url }}" alt="Image {{ loop.index }}">
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</body>
|
|
</html>
|