Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit21fd3b9

Browse files
committed
add animation to text area on submit
1 parente059494 commit21fd3b9

File tree

1 file changed

+79
-11
lines changed

1 file changed

+79
-11
lines changed

‎site/src/modules/tasks/TaskPrompt/TaskPrompt.tsx‎

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -458,17 +458,85 @@ async function createTaskWithLatestTemplateVersion(
458458
});
459459
}
460460

461-
constPromptTextarea:FC<TextareaAutosizeProps>=(props)=>{
461+
typePromptTextareaProps=TextareaAutosizeProps&{
462+
isSubmitting?:boolean;
463+
};
464+
465+
constPromptTextarea:FC<PromptTextareaProps>=({
466+
isSubmitting,
467+
...props
468+
})=>{
462469
return(
463-
<TextareaAutosize
464-
{...props}
465-
required
466-
id="prompt"
467-
name="prompt"
468-
placeholder="Prompt your AI agent to start a task..."
469-
className={`border-0 px-3 py-2 resize-none w-full h-full bg-transparent rounded-lg
470-
outline-none flex min-h-24 text-sm shadow-sm text-content-primary
471-
placeholder:text-content-secondary md:text-sm${props.readOnly ?"opacity-60 cursor-not-allowed" :""}`}
472-
/>
470+
<divclassName="relative">
471+
<TextareaAutosize
472+
{...props}
473+
required
474+
id="prompt"
475+
name="prompt"
476+
placeholder="Prompt your AI agent to start a task..."
477+
className={`border-0 px-3 py-2 resize-none w-full h-full bg-transparent rounded-lg
478+
outline-none flex min-h-24 text-sm shadow-sm text-content-primary
479+
placeholder:text-content-secondary md:text-sm${props.readOnly||isSubmitting ?"opacity-60 cursor-not-allowed" :""}`}
480+
/>
481+
{isSubmitting&&(
482+
<divclassName="absolute inset-0 pointer-events-none overflow-hidden">
483+
<divclassName="caret-scanner"/>
484+
</div>
485+
)}
486+
<style>{`
487+
@keyframes caretScan {
488+
0%, 100% {
489+
left: 0%;
490+
top: 10%;
491+
}
492+
10% {
493+
left: 70%;
494+
top: 10%;
495+
}
496+
20% {
497+
left: 30%;
498+
top: 30%;
499+
}
500+
30% {
501+
left: 90%;
502+
top: 20%;
503+
}
504+
40% {
505+
left: 20%;
506+
top: 50%;
507+
}
508+
50% {
509+
left: 80%;
510+
top: 60%;
511+
}
512+
60% {
513+
left: 40%;
514+
top: 70%;
515+
}
516+
70% {
517+
left: 60%;
518+
top: 40%;
519+
}
520+
80% {
521+
left: 10%;
522+
top: 80%;
523+
}
524+
90% {
525+
left: 50%;
526+
top: 90%;
527+
}
528+
}
529+
530+
.caret-scanner {
531+
position: absolute;
532+
width: 12px;
533+
height: 20px;
534+
background-color: rgba(99, 102, 241, 0.5);
535+
border: 1px solid rgb(99, 102, 241);
536+
animation: caretScan 3s ease-in-out infinite;
537+
border-radius: 2px;
538+
}
539+
`}</style>
540+
</div>
473541
);
474542
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp