Skip to content

Commit fc9947f

Browse files
committed
chore: change debouncing animation
1 parent fcb1859 commit fc9947f

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/Preview.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,23 @@ export const Preview: FC = () => {
8989
)}
9090
>
9191
<div className="flex w-full items-center justify-between">
92-
<p className="font-semibold text-3xl text-content-primary">
93-
Parameters
94-
</p>
92+
<div className="flex items-center justify-center gap-4">
93+
<p className="font-semibold text-3xl text-content-primary">
94+
Parameters
95+
</p>
96+
97+
<AnimatePresence>
98+
{isDebouncing && $wasmState === "loaded" ? (
99+
<motion.div
100+
initial={{ opacity: 0, scale: 0.75 }}
101+
animate={{ opacity: 1, scale: 1 }}
102+
exit={{ opacity: 0, scale: 0.75 }}
103+
>
104+
<LoaderIcon className="animate-spin text-content-primary" />
105+
</motion.div>
106+
) : null}
107+
</AnimatePresence>
108+
</div>
95109
<Button variant="destructive">Reset form</Button>
96110
</div>
97111

@@ -100,9 +114,6 @@ export const Preview: FC = () => {
100114
"flex h-full w-full items-center justify-center overflow-x-clip rounded-xl border p-4",
101115
output && "block overflow-y-scroll",
102116
)}
103-
style={{
104-
opacity: isDebouncing && $wasmState === "loaded" ? 0.5 : 1,
105-
}}
106117
>
107118
{output ? (
108119
<div className="flex flex-col gap-4">
@@ -217,7 +228,7 @@ const ErrorPane = () => {
217228
transition={{
218229
when: "afterChildren",
219230
}}
220-
exit={{ opacity: 0}}
231+
exit={{ opacity: 0 }}
221232
className={cn(
222233
"absolute bottom-0 left-0 flex max-h-[60%] w-full flex-col justify-start",
223234
$errors.show && "h-auto",

0 commit comments

Comments
 (0)