Skip to content

Commit be6dae3

Browse files
committed
fix: impove full screen transition animation
1 parent f6752fe commit be6dae3

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

custom/ChatSurface.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333

3434
<div
3535
class="w-full h-full flex flex-col"
36-
:class="{ 'ml-4': agentStore.isFullScreen }"
3736
>
38-
<div class="flex items-center justify-between border-b border-gray-200 dark:border-gray-700">
37+
<div
38+
class="flex items-center justify-between border-b border-gray-200 dark:border-gray-700"
39+
:class="{ 'pl-4': agentStore.isFullScreen }"
40+
>
3941
<div
4042
class="flex items-center h-[55px]"
4143
>
@@ -99,9 +101,11 @@
99101
/>
100102

101103
<div
102-
class="w-full mb-2 flex items-center justify-center px-2 bg-transparent relative"
103-
:class="agentStore.isFullScreen ? 'mx-auto' : ''"
104-
:style="{ maxWidth: agentStore.isFullScreen ? agentStore.MAX_WIDTH+'px' : '100%' }"
104+
class="w-full mb-2 flex items-center justify-center px-2 bg-transparent relative translate-x-[-50%] left-1/2"
105+
:style="{
106+
maxWidth: agentStore.isFullScreen ? agentStore.MAX_WIDTH+'px' : '100%',
107+
transition: `transform ${agentTransitions.TRANSITION_DURATION}ms ease-in-out`
108+
}"
105109
>
106110
<textarea
107111
v-model="agentStore.userMessageInput"
@@ -193,7 +197,6 @@ const agentStore = useAgentStore();
193197
const agentTransitions = useAgentTransitions();
194198
const coreStore = useCoreStore();
195199
const isModeMenuOpen = ref(false);
196-
197200
let startX = 0
198201
let startWidth = 0
199202

custom/ConversationArea.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
</div>
1313
<AutoScrollContainer
1414
:enabled="!showScrollToBottomButton"
15-
class="relative flex flex-col overflow-y-auto"
15+
class="relative flex flex-col overflow-y-auto translate-x-[-50%] left-1/2"
1616
ref="scrollContainer"
1717
:threshold="10"
1818
behavior="smooth"
19-
:class="agentStore.isFullScreen ? 'mx-auto' : ''"
2019
:style="{
2120
maxWidth: agentStore.isFullScreen ? agentStore.MAX_WIDTH+'px' : '100%',
22-
transition: `max-width ${agentTransitions.TRANSITION_DURATION}ms ease-in-out`
21+
transition: `
22+
max-width ${agentTransitions.TRANSITION_DURATION}ms ease-in-out,
23+
transform ${agentTransitions.TRANSITION_DURATION}ms ease-in-out
24+
`
2325
}"
2426
>
2527

custom/composables/useAgentTransitions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useAgentStore } from './useAgentStore';
44

55

66
export const useAgentTransitions = defineStore('agentTransitions', () => {
7-
const TRANSITION_DURATION = 200;
7+
const TRANSITION_DURATION = 300;
88

99
const agentStore = useAgentStore();
1010
const appRoot = ref<HTMLElement | null>(null);

0 commit comments

Comments
 (0)