Spaces:
Running
Running
Update index.html
Browse files- index.html +7 -1
index.html
CHANGED
|
@@ -174,7 +174,13 @@
|
|
| 174 |
const tpl=document.getElementById('msg-template'); const node=tpl.content.firstElementChild.cloneNode(true);
|
| 175 |
const avatar=node.querySelector('.avatar'); const nameEl=node.querySelector('.name'); const timeEl=node.querySelector('.time'); const bubble=node.querySelector('.bubble'); const copyBtn=node.querySelector('.copy');
|
| 176 |
nameEl.textContent=name; timeEl.textContent=now();
|
| 177 |
-
if(role==='user'){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
else { avatar.innerHTML=`<span class="inline-flex h-8 w-8 items-center justify-center rounded-full ${AVATAR_BG[name]||'bg-white/10'} ring-1 ring-white/10"><img src="${LOGOS[name]||'https://cdn.simpleicons.org/circle/ffffff'}" alt="${name}" class="h-4 w-4"/></span>`; bubble.className+=' bg-white/5 border border-white/10'; copyBtn.addEventListener('click',()=>{navigator.clipboard.writeText(text); setStatus('Copied '+name+' response.'); setTimeout(clearStatus,1200);}); }
|
| 179 |
// Markdown rendering with sanitization (supports tables, lists, code)
|
| 180 |
const raw=decodeEntities(text).replace(/\u0000/g,'');
|
|
|
|
| 174 |
const tpl=document.getElementById('msg-template'); const node=tpl.content.firstElementChild.cloneNode(true);
|
| 175 |
const avatar=node.querySelector('.avatar'); const nameEl=node.querySelector('.name'); const timeEl=node.querySelector('.time'); const bubble=node.querySelector('.bubble'); const copyBtn=node.querySelector('.copy');
|
| 176 |
nameEl.textContent=name; timeEl.textContent=now();
|
| 177 |
+
if(role==='user'){
|
| 178 |
+
node.classList.add('flex-row-reverse');
|
| 179 |
+
avatar.innerHTML='<span class="inline-flex h-8 w-8 items-center justify-center rounded-full bg-white/10 ring-1 ring-white/10 text-white/70"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="h-4 w-4"><path d="M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5Zm0 2c-5 0-9 2.5-9 5.5V22h18v-2.5C21 16.5 17 14 12 14Z"/></svg></span>';
|
| 180 |
+
bubble.className+=' bg-brand text-black rounded-br-md';
|
| 181 |
+
node.querySelector('.header').classList.add('flex-row-reverse','gap-2');
|
| 182 |
+
copyBtn.classList.add('hidden');
|
| 183 |
+
}
|
| 184 |
else { avatar.innerHTML=`<span class="inline-flex h-8 w-8 items-center justify-center rounded-full ${AVATAR_BG[name]||'bg-white/10'} ring-1 ring-white/10"><img src="${LOGOS[name]||'https://cdn.simpleicons.org/circle/ffffff'}" alt="${name}" class="h-4 w-4"/></span>`; bubble.className+=' bg-white/5 border border-white/10'; copyBtn.addEventListener('click',()=>{navigator.clipboard.writeText(text); setStatus('Copied '+name+' response.'); setTimeout(clearStatus,1200);}); }
|
| 185 |
// Markdown rendering with sanitization (supports tables, lists, code)
|
| 186 |
const raw=decodeEntities(text).replace(/\u0000/g,'');
|