Skip to content

Commit 3557bb4

Browse files
authored
Update ticket-chat.html
1 parent acf7ed2 commit 3557bb4

1 file changed

Lines changed: 59 additions & 25 deletions

File tree

ticket-chat.html

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
--primary: #4f46e5;
1717
--primary-2: #6d28d9;
1818
--customer: #1a2242;
19-
--support-bg: linear-gradient(135deg, #4f46e5, #6d28d9);
2019
--danger-bg: rgba(239,68,68,.12);
2120
--danger-border: rgba(239,68,68,.28);
2221
--danger-text: #fecaca;
@@ -36,7 +35,6 @@
3635
.page {
3736
min-height: 100vh;
3837
display: flex;
39-
align-items: center;
4038
justify-content: center;
4139
padding: 14px;
4240
}
@@ -115,9 +113,21 @@
115113
gap: 10px;
116114
}
117115

116+
.msg-row {
117+
display: flex;
118+
width: 100%;
119+
}
120+
121+
.msg-row.customer {
122+
justify-content: flex-start;
123+
}
124+
125+
.msg-row.support {
126+
justify-content: flex-end;
127+
}
128+
118129
.bubble {
119-
display: inline-block;
120-
width: fit-content;
130+
width: auto;
121131
max-width: 82%;
122132
padding: 10px 12px;
123133
border-radius: 18px;
@@ -129,16 +139,14 @@
129139
}
130140

131141
.bubble.customer {
132-
align-self: flex-start;
133142
background: var(--customer);
134143
color: #f8fafc;
135144
border: 1px solid rgba(255,255,255,.05);
136145
border-bottom-left-radius: 8px;
137146
}
138147

139148
.bubble.support {
140-
align-self: flex-end;
141-
background: var(--support-bg);
149+
background: linear-gradient(135deg, var(--primary), var(--primary-2));
142150
color: white;
143151
border: 1px solid rgba(255,255,255,.08);
144152
border-bottom-right-radius: 8px;
@@ -184,14 +192,18 @@
184192
flex-shrink: 0;
185193
}
186194

195+
.composer {
196+
position: relative;
197+
}
198+
187199
.reply-box textarea {
188200
width: 100%;
189201
min-height: 78px;
190202
max-height: 170px;
191203
resize: vertical;
192204
border: 1px solid rgba(255,255,255,.10);
193205
border-radius: 18px;
194-
padding: 12px 14px;
206+
padding: 12px 110px 12px 14px;
195207
font-size: 13px;
196208
font-family: Inter, Arial, sans-serif;
197209
outline: none;
@@ -209,6 +221,26 @@
209221
box-shadow: 0 0 0 4px rgba(99,102,241,.14);
210222
}
211223

224+
.send-inside {
225+
position: absolute;
226+
right: 8px;
227+
bottom: 8px;
228+
border: none;
229+
border-radius: 12px;
230+
padding: 10px 14px;
231+
font-size: 12px;
232+
font-weight: 800;
233+
cursor: pointer;
234+
background: linear-gradient(135deg, var(--primary), var(--primary-2));
235+
color: white;
236+
min-width: 90px;
237+
}
238+
239+
.send-inside:disabled {
240+
opacity: 0.6;
241+
cursor: not-allowed;
242+
}
243+
212244
.reply-actions {
213245
margin-top: 10px;
214246
display: flex;
@@ -227,17 +259,6 @@
227259
min-height: 42px;
228260
}
229261

230-
.btn:disabled {
231-
opacity: 0.6;
232-
cursor: not-allowed;
233-
}
234-
235-
.btn.primary {
236-
background: linear-gradient(135deg, var(--primary), var(--primary-2));
237-
color: white;
238-
flex: 1;
239-
}
240-
241262
.btn.secondary {
242263
background: #111827;
243264
color: #fff;
@@ -316,6 +337,15 @@
316337
.file-label {
317338
min-width: unset;
318339
}
340+
341+
.reply-box textarea {
342+
padding-right: 98px;
343+
}
344+
345+
.send-inside {
346+
min-width: 82px;
347+
padding: 9px 12px;
348+
}
319349
}
320350
</style>
321351
</head>
@@ -341,7 +371,10 @@ <h1>Support Ticket</h1>
341371
</div>
342372

343373
<div id="replyBox" class="reply-box" style="display:none;">
344-
<textarea id="replyMessage" placeholder="Write your message here..."></textarea>
374+
<div class="composer">
375+
<textarea id="replyMessage" placeholder="Write your message here..."></textarea>
376+
<button id="sendBtn" class="send-inside">Send</button>
377+
</div>
345378

346379
<div class="reply-actions">
347380
<label class="file-label" for="fileInput">
@@ -355,7 +388,6 @@ <h1>Support Ticket</h1>
355388
accept=".png,.jpg,.jpeg,.pdf,.doc,.docx"
356389
/>
357390

358-
<button id="sendBtn" class="btn primary">Send Reply</button>
359391
<button id="refreshBtn" class="btn secondary" type="button">Refresh</button>
360392
</div>
361393

@@ -505,10 +537,12 @@ <h1>Support Ticket</h1>
505537
}
506538

507539
chatList.innerHTML = messages.map(msg => `
508-
<div class="bubble ${msg.type}">
509-
<div class="bubble-header">${escapeHtml(msg.sender)}</div>
510-
<div>${escapeHtml(msg.text)}</div>
511-
<div class="bubble-time">${escapeHtml(msg.time)}</div>
540+
<div class="msg-row ${msg.type}">
541+
<div class="bubble ${msg.type}">
542+
<div class="bubble-header">${escapeHtml(msg.sender)}</div>
543+
<div>${escapeHtml(msg.text)}</div>
544+
<div class="bubble-time">${escapeHtml(msg.time)}</div>
545+
</div>
512546
</div>
513547
`).join("");
514548
}

0 commit comments

Comments
 (0)