Skip to content

Commit ff084a9

Browse files
committed
Nice glow effect
1 parent 60997f9 commit ff084a9

File tree

2 files changed

+77
-50
lines changed

2 files changed

+77
-50
lines changed

apps/webapp/app/components/runs/v3/AIFilterInput.tsx

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function AIFilterInput() {
8686
stiffness: 300,
8787
damping: 30,
8888
}}
89-
className="relative"
89+
className="relative h-6 min-w-44"
9090
>
9191
<AnimatePresence>
9292
{isFocused && (
@@ -95,60 +95,62 @@ export function AIFilterInput() {
9595
animate={{ opacity: 1 }}
9696
exit={{ opacity: 0 }}
9797
transition={{ duration: 0.2, ease: "linear" }}
98-
className="animated-gradient-glow pointer-events-none absolute inset-0"
98+
className="animated-gradient-glow-small pointer-events-none absolute inset-0 h-6"
9999
/>
100100
)}
101101
</AnimatePresence>
102-
<Input
103-
type="text"
104-
name="text"
105-
variant="secondary-small"
106-
placeholder="Describe your filters…"
107-
value={text}
108-
onChange={(e) => setText(e.target.value)}
109-
disabled={isLoading}
110-
fullWidth
111-
ref={inputRef}
112-
className={cn(
113-
"disabled:text-text-dimmed/50",
114-
isFocused && "placeholder:text-text-dimmed"
115-
)}
116-
containerClassName="has-[:disabled]:opacity-100"
117-
onKeyDown={(e) => {
118-
if (e.key === "Enter" && text.trim() && !isLoading) {
119-
e.preventDefault();
120-
const form = e.currentTarget.closest("form");
121-
if (form) {
122-
form.requestSubmit();
102+
<div className="absolute inset-0 left-0 top-0 h-6">
103+
<Input
104+
type="text"
105+
name="text"
106+
variant="secondary-small"
107+
placeholder="Describe your filters…"
108+
value={text}
109+
onChange={(e) => setText(e.target.value)}
110+
disabled={isLoading}
111+
fullWidth
112+
ref={inputRef}
113+
className={cn(
114+
"disabled:text-text-dimmed/50",
115+
isFocused && "placeholder:text-text-dimmed"
116+
)}
117+
containerClassName="has-[:disabled]:opacity-100"
118+
onKeyDown={(e) => {
119+
if (e.key === "Enter" && text.trim() && !isLoading) {
120+
e.preventDefault();
121+
const form = e.currentTarget.closest("form");
122+
if (form) {
123+
form.requestSubmit();
124+
}
123125
}
126+
}}
127+
onFocus={() => setIsFocused(true)}
128+
onBlur={() => {
129+
// Only blur if the text is empty or we're not loading
130+
if (text.length === 0 || !isLoading) {
131+
setIsFocused(false);
132+
}
133+
}}
134+
icon={<AISparkleIcon className="size-4" />}
135+
accessory={
136+
isLoading ? (
137+
<Spinner
138+
color={{
139+
background: "rgba(99, 102, 241, 1)",
140+
foreground: "rgba(217, 70, 239, 1)",
141+
}}
142+
className="size-4 opacity-80"
143+
/>
144+
) : text.length > 0 ? (
145+
<ShortcutKey
146+
shortcut={{ key: "enter" }}
147+
variant="small"
148+
className={cn("transition-opacity", text.length === 0 && "opacity-0")}
149+
/>
150+
) : undefined
124151
}
125-
}}
126-
onFocus={() => setIsFocused(true)}
127-
onBlur={() => {
128-
// Only blur if the text is empty or we're not loading
129-
if (text.length === 0 || !isLoading) {
130-
setIsFocused(false);
131-
}
132-
}}
133-
icon={<AISparkleIcon className="size-4" />}
134-
accessory={
135-
isLoading ? (
136-
<Spinner
137-
color={{
138-
background: "rgba(99, 102, 241, 1)",
139-
foreground: "rgba(217, 70, 239, 1)",
140-
}}
141-
className="size-4"
142-
/>
143-
) : text.length > 0 ? (
144-
<ShortcutKey
145-
shortcut={{ key: "enter" }}
146-
variant="small"
147-
className={cn("transition-opacity", text.length === 0 && "opacity-0")}
148-
/>
149-
) : undefined
150-
}
151-
/>
152+
/>
153+
</div>
152154
</motion.div>
153155
</ErrorPopover>
154156
</fetcher.Form>

apps/webapp/app/tailwind.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,31 @@
7171
filter: blur(0.5rem);
7272
opacity: 0.1;
7373
}
74+
75+
.animated-gradient-glow-small {
76+
position: relative;
77+
overflow: visible;
78+
}
79+
80+
.animated-gradient-glow-small::before {
81+
content: "";
82+
position: absolute;
83+
inset: -1px;
84+
z-index: -1;
85+
background: conic-gradient(
86+
from var(--gradient-angle),
87+
rgb(99 102 241),
88+
rgb(245 158 11),
89+
rgb(236 72 153),
90+
rgb(245 158 11),
91+
rgb(99 102 241)
92+
);
93+
border-radius: inherit;
94+
animation: gradient-rotation 3s linear infinite;
95+
pointer-events: none;
96+
filter: blur(0.2rem);
97+
opacity: 0.3;
98+
}
7499
}
75100

76101
@keyframes gradient-rotation {

0 commit comments

Comments
 (0)