co-created html and css for the chat page

This commit is contained in:
2025-11-16 09:59:30 +03:00
parent d1cfa0f771
commit 0be78881a7
2 changed files with 94 additions and 2 deletions

View File

@@ -190,6 +190,80 @@ body {
flex-direction: column; flex-direction: column;
} }
.hidden {
display: none !important;
}
/* Chat layout */
#chat-card {
display: flex;
flex-direction: column;
gap: 10px;
}
.chat-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
margin-bottom: 4px;
}
.chat-session {
font-size: 0.85rem;
color: var(--muted);
}
.chat-log {
flex: 1;
min-height: 180px;
max-height: 320px;
margin-bottom: 8px;
padding: 12px;
border-radius: 10px;
background: rgba(3, 16, 32, 0.65);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 8px;
}
.chat-input-row {
display: flex;
gap: 8px;
}
.chat-input-row .input {
flex: 1;
margin-bottom: 0;
}
.chat-message {
padding: 8px 10px;
border-radius: 14px;
font-size: 0.9rem;
max-width: 80%;
}
.chat-message.me {
align-self: flex-end;
background: var(--primary);
color: #ffffff;
}
.chat-message.them {
align-self: flex-start;
background: rgba(255, 255, 255, 0.06);
}
.chat-message.system {
align-self: center;
background: transparent;
color: var(--muted);
font-size: 0.8rem;
}
/* Responsive tweaks */ /* Responsive tweaks */
@media (max-width: 480px) { @media (max-width: 480px) {

View File

@@ -17,7 +17,7 @@
</header> </header>
<main class="app-main"> <main class="app-main">
<section class="card"> <section class="card" id="landing-card">
<div class="actions"> <div class="actions">
<button class="btn btn-primary" id="create-session-btn"> <button class="btn btn-primary" id="create-session-btn">
Create a session Create a session
@@ -34,6 +34,24 @@
</div> </div>
</div> </div>
</section> </section>
<section class="card hidden" id="chat-card">
<div class="chat-header">
<div class="chat-session" id="chat-session-info"></div>
<button class="btn btn-secondary" id="leave-session-btn">
Leave session
</button>
</div>
<div class="chat-log" id="chat-log"></div>
<form class="chat-input-row" id="chat-form">
<input type="text" id="chat-input" class="input" placeholder="Type a message..." autocomplete="off" />
<button class="btn btn-primary" id="chat-send-btn">
Send
</button>
</form>
</section>
</main> </main>
</div> </div>