Merge pull request #210 from gitbutlerapp/ian/gb-212-make-chatgbtlr-a-little-less-ugly

Updated visual style subtly and added a way to have a "greeting" bef…
This commit is contained in:
Ian Donahue 2023-04-19 22:37:44 +02:00 committed by GitHub
commit bce0f1671f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,7 +116,7 @@
</script>
<div class="GitBTLR-container h-full p-4">
<div class="flex h-full flex-col rounded border border-zinc-700 bg-card-default shadow">
<div class="relative flex h-full flex-col rounded border border-zinc-700 bg-card-default shadow">
<div class="flex justify-between gap-2 border-b border-zinc-700 bg-card-active p-2">
<div class="flex gap-2 text-[18px]">Chat GitButler</div>
@ -136,13 +136,43 @@
</div>
</div>
<div class="chat-container flex h-full flex-col overflow-auto border-zinc-700">
<div class="chat-container flex h-full flex-col overflow-auto border-zinc-700 pb-[122px]">
<ul class="flex flex-col gap-2 p-4">
<div class="flex items-start gap-2 align-top">
<div class="rounded-full bg-zinc-900 p-4">
<svg
width="20"
height="20"
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.5614 12.4668C14.3108 12.3265 14.0786 12.1555 13.8712 11.9587C13.4477 11.5571 13.1091 11.0403 12.8663 10.4225L12.1828 8.68652L11.4994 10.4225C11.2561 11.0403 10.918 11.5571 10.4945 11.9587C10.2861 12.1564 10.0539 12.3274 9.80476 12.4673L8.66333 13.108L9.80476 13.7482C10.0539 13.888 10.2861 14.059 10.494 14.2567C10.918 14.6583 11.2561 15.1757 11.4989 15.7929L12.1823 17.5289L12.8658 15.7929C13.1091 15.1751 13.4472 14.6583 13.8707 14.2567C14.0791 14.059 14.3113 13.8875 14.5609 13.7482L15.7029 13.1075L14.5614 12.4668Z"
fill="#F4F4F5"
/>
<path
d="M11.9573 4.05509C11.7746 3.95585 11.6049 3.83459 11.4532 3.69517C11.1469 3.41352 10.9033 3.05324 10.7293 2.62445L10.4759 2L10.2226 2.62445C10.0486 3.05322 9.80498 3.41349 9.49868 3.69517C9.34626 3.83529 9.1769 3.95655 8.99493 4.05544L8.57153 4.28572L8.99493 4.516C9.1769 4.6149 9.34626 4.73615 9.49868 4.87627C9.80497 5.15757 10.0486 5.51784 10.2226 5.94699L10.4759 6.57143L10.7293 5.94699C10.9033 5.51823 11.1469 5.15795 11.4532 4.87627C11.6056 4.73615 11.775 4.61489 11.9573 4.516L12.3811 4.28537L11.9573 4.05509Z"
fill="#F4F4F5"
/>
<path
d="M8.56381 8.66611C8.31754 8.52816 8.08878 8.35963 7.88429 8.16583C7.47143 7.77434 7.14309 7.27356 6.90848 6.67755L6.56702 5.80957L6.22556 6.67755C5.99096 7.27353 5.66262 7.7743 5.24974 8.16583C5.04429 8.3606 4.816 8.52915 4.57071 8.6666L4 8.98668L4.57071 9.30677C4.81601 9.44423 5.04429 9.61277 5.24974 9.80754C5.66261 10.1985 5.99094 10.6993 6.22556 11.2958L6.56702 12.1638L6.90848 11.2958C7.14308 10.6999 7.47142 10.1991 7.88429 9.80754C8.08975 9.61277 8.31804 9.44422 8.56381 9.30677L9.13502 8.9862L8.56381 8.66611Z"
fill="#F4F4F5"
/>
</svg>
</div>
<div class="message-block flex flex-col gap-2">
<div class="automated-message">
<div class="automated-text">Hello and welcome.</div>
</div>
<div class="automated-message">
<div class="automated-text">How may I serve you?</div>
</div>
</div>
</div>
{#each chatHistory as pair}
<div class="flex justify-end">
<div
class="text-blue-100 w-[fit-content] max-w-[80%] cursor-text select-text rounded-[18px] rounded-tr-md bg-blue-700 py-3 px-4"
>
<div class="user-message ">
{pair[0]}
</div>
</div>
@ -169,15 +199,26 @@
/>
</svg>
</div>
<div class=" max-w-[500px] rounded-[18px] rounded-tl-md bg-zinc-300 text-zinc-700 ">
<div class="automated-text w-full cursor-text select-text px-4 py-3">{pair[1]}</div>
<div class="message-block flex max-w-[500px] flex-col gap-2">
<div class="automated-message">
<div class="automated-text">{pair[1]}</div>
</div>
</div>
</div>
{/each}
</ul>
</div>
<div class="flex flex-col gap-2 border-t border-zinc-700 p-4">
<div
class="absolute bottom-0 flex w-full flex-col gap-2 border-t border-zinc-700 p-4 "
style="
border-width: 0.5px;
-webkit-backdrop-filter: blur(5px) saturate(190%) contrast(70%) brightness(80%);
backdrop-filter: blur(5px) saturate(190%) contrast(70%) brightness(80%);
background-color: rgba(24, 24, 27, 0.60);
border: 0.5px solid rgba(63, 63, 70, 0.50);
"
>
<div class="flex gap-2 pt-2">
<input bind:value={chatInput} placeholder="Send a message..." class="w-full" />
<Button
@ -242,3 +283,15 @@
}}>Reset</Button
>
</div>
<style>
.automated-message {
@apply max-w-[500px] rounded-[18px] rounded-tl-md bg-zinc-200 text-[14px] font-medium text-zinc-800;
}
.automated-text {
@apply w-full cursor-text select-text px-4 py-3 text-[14px];
}
.user-message {
@apply w-[fit-content] max-w-[80%] cursor-text select-text rounded-[18px] rounded-tr-md bg-blue-700 py-3 px-4 text-[14px] font-medium text-white;
}
</style>