diff --git a/public/assets/js/base.js b/public/assets/js/base.js index 3e26579..11fe3a0 100644 --- a/public/assets/js/base.js +++ b/public/assets/js/base.js @@ -264,13 +264,6 @@ document.addEventListener('DOMContentLoaded', () => { const msg = document.createElement('div'); msg.className = 'message ' + role; - if (role === "user") { - const svg = '\n' + - ' \n' + - ''; - html = svg + ' ' + html; - } - const bubble = document.createElement('div'); bubble.className = 'bubble ' + extra; bubble.innerHTML = html; diff --git a/public/assets/styles/base.css b/public/assets/styles/base.css index 8687e86..626986c 100644 --- a/public/assets/styles/base.css +++ b/public/assets/styles/base.css @@ -94,6 +94,8 @@ input, textarea, select { scrollbar-color: #324054 transparent; } + + .message { margin-bottom: .7rem; } @@ -105,6 +107,29 @@ input, textarea, select { .message.user .bubble { margin-left: auto; color: #86b7fe; + position: relative; +} + +.message.user .bubble::after { + content: ""; + position: absolute; + top: 50%; + right: -10px; + transform: translateY(-50%); + + width: 16px; + height: 16px; + background-color: currentColor; + + -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4.414a1 1 0 0 0-.707.293L.854 15.146A.5.5 0 0 1 0 14.793zm3.5 1a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1zm0 2.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1zm0 2.5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1z'/%3E%3C/svg%3E"); + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center; + -webkit-mask-size: contain; + + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4.414a1 1 0 0 0-.707.293L.854 15.146A.5.5 0 0 1 0 14.793zm3.5 1a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1zm0 2.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1zm0 2.5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1z'/%3E%3C/svg%3E"); + mask-repeat: no-repeat; + mask-position: center; + mask-size: contain; } .message.assistant .bubble {