style: turned the chat bubble into a drawer

This commit is contained in:
Lion Arar 2025-10-07 09:34:05 -04:00
parent 8cc700d0e7
commit ee9121b369
4 changed files with 62 additions and 70 deletions

View File

@ -7,8 +7,18 @@ const toggleChat = () => {
</script> </script>
<template> <template>
<div class="fixed-bottom-right" style="z-index: 9999; margin-bottom: 80px; margin-right: 75px;"> <div
<q-btn round color="primary" size="20px" class="glossy" icon="smart_toy" @click="toggleChat" /> style="z-index: 3; margin-right: 20px"
class="display: flex"
>
<q-btn
flat
color="transparant"
size="20px"
icon="smart_toy"
@click="toggleChat"
style="--q-icon-size: 28px; min-width: auto;"
/>
</div> </div>
</template> </template>

View File

@ -55,83 +55,55 @@ const handleSend = async () => {
</script> </script>
<template> <template>
<transition name="fade-slide"> <q-drawer
<div side="right"
v-if="isChatVisible" v-model="isChatVisible"
class="dialogue" class="chat-drawer"
> :width="370"
<div class="chat-header">AI Assistant</div> >
<div class="chat-body"> <div class="chat-header">AI Assistant</div>
<DialogueContent :messages="messages"></DialogueContent>
</div> <div class="chat-body">
<q-form <DialogueContent :messages="messages" />
v-on:submit="handleSend"
class="row chat-footer"
>
<q-input
v-model="text"
label="Enter a Message"
autogrow
class="col"
style="margin-right: 5px;"
@keydown.enter="handleSend"
/>
</q-form>
</div> </div>
</transition>
<q-form
@submit="handleSend"
class="chat-footer row"
>
<q-input
v-model="text"
label="Enter a Message"
autogrow
class="col"
@keydown.enter="handleSend"
style="margin-left: 10px;"
/>
</q-form>
</q-drawer>
</template> </template>
<style> <style scoped>
.dialogue { .chat-drawer {
position: fixed;
bottom: 150px;
right: 30px;
width: 300px;
height: 400px;
background: white;
border-radius: 6px;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; height: 100%;
} }
/* Header at the top */
.chat-header { .chat-header {
background: #019547; background: #019547;
color: white; color: white;
padding: 10px; padding: 10px;
font-weight: bold; font-weight: bold;
flex-shrink: 0;
} }
/* Scrollable middle */
.chat-body { .chat-body {
flex: 1; flex: 1;
padding: 10px; padding: 10px;
overflow-y: auto; overflow-y: auto;
} height: 85%;
.chat-footer {
padding: 10px;
border-top: 0.1px solid #ccc;
}
.input-wrapper {
display: flex;
align-items: center;
}
.full-width {
flex: 1;
}
.fade-slide-enter-active,
.fade-slide-leave-active {
transition: all 0.2s ease;
}
.fade-slide-enter-from,
.fade-slide-leave-to {
opacity: 0;
transform: translateY(20px);
} }
</style> </style>

View File

@ -1,12 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
import Chatbutton from "src/modules/chatbot/components/chat-button.vue";
import ConversationBox from "../components/conversation-box.vue"; import ConversationBox from "../components/conversation-box.vue";
</script> </script>
<template> <template>
<div> <div>
<ConversationBox></ConversationBox> <ConversationBox></ConversationBox>
<Chatbutton></Chatbutton>
</div> </div>
</template> </template>

View File

@ -1,22 +1,34 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useUiStore } from 'src/stores/ui-store'; import { useUiStore } from 'src/stores/ui-store';
import HeaderBarAvatar from './header-bar-avatar.vue'; import HeaderBarAvatar from './header-bar-avatar.vue';
import Chatbutton from "src/modules/chatbot/components/chat-button.vue";
const uiStore = useUiStore(); const uiStore = useUiStore();
</script> </script>
<template> <template>
<q-header elevated> <q-header elevated>
<q-toolbar> <q-toolbar>
<q-toolbar-title> <q-toolbar-title>
<q-btn flat dense color="white" icon="menu" @click="uiStore.toggleRightDrawer"> <q-btn
<q-img src="src/assets/logo-targo-white.svg" fit="contain" width="150px" height="30px"/> flat
dense
color="white"
icon="menu"
@click="uiStore.toggleRightDrawer"
>
<q-img
src="src/assets/logo-targo-white.svg"
fit="contain"
width="150px"
height="30px"
/>
</q-btn> </q-btn>
</q-toolbar-title> </q-toolbar-title>
<q-item class="q-pa-none"> <q-item class="q-pa-none">
<Chatbutton></Chatbutton>
<HeaderBarAvatar /> <HeaderBarAvatar />
</q-item> </q-item>
</q-toolbar> </q-toolbar>
</q-header> </q-header>
</template> </template>