Skip to content

Commit f620112

Browse files
author
Jicheng Lu
committed
refine thinking content
1 parent 0b0659c commit f620112

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

src/routes/chat/[agentId]/[conversationId]/rich-content/rc-message.svelte

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import RcJsInterpreter from "./rc-js-interpreter.svelte";
55
import { Icon, Sparkles } from "svelte-hero-icons";
66
import Loader from "$lib/common/spinners/Loader.svelte";
7+
import { slide, fade } from "svelte/transition";
8+
import { cubicOut } from "svelte/easing";
79
810
/**
911
* @type {{
@@ -55,7 +57,7 @@
5557
class="thinking-toggle"
5658
onclick={() => isThinkingExpanded = !isThinkingExpanded}
5759
>
58-
<span class="thinking-sparkle"><Icon src={Sparkles} solid size="16" /></span>
60+
<span class="thinking-sparkle" class:pulsing={isThinking}><Icon src={Sparkles} solid size="16" /></span>
5961
<span class="font-bold">{'Thinking'}</span>
6062
{#if isThinking}
6163
<Loader disableDefaultStyles size={14} color="#4285f4" containerStyles="display: flex; align-items: center;" />
@@ -66,8 +68,13 @@
6668
{/if}
6769
</button>
6870
{#if isThinkingExpanded}
69-
<div class="thinking-content">
70-
<Markdown containerStyles="color: #444 !important;" text={thinkingText} rawText />
71+
<div
72+
class="thinking-content"
73+
transition:slide={{ duration: 200, easing: cubicOut }}
74+
>
75+
<div in:fade={{ duration: 200, delay: 80 }}>
76+
<Markdown containerStyles="color: #444 !important;" text={thinkingText} rawText />
77+
</div>
7178
</div>
7279
{/if}
7380
</div>
@@ -110,9 +117,24 @@
110117
align-items: center;
111118
}
112119
120+
.thinking-sparkle.pulsing {
121+
animation: thinking-sparkle-pulse 1.4s ease-in-out infinite;
122+
}
123+
124+
@keyframes thinking-sparkle-pulse {
125+
0%, 100% {
126+
opacity: 1;
127+
transform: scale(1);
128+
}
129+
50% {
130+
opacity: 0.55;
131+
transform: scale(1.15);
132+
}
133+
}
134+
113135
.thinking-chevron {
114136
font-size: 1em;
115-
transition: transform 0.2s ease;
137+
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
116138
display: inline-block;
117139
}
118140

0 commit comments

Comments
 (0)