Skip to content

Commit b2941d5

Browse files
authored
🐛 Fix glitchy kangaroo bounce animation on welcome screen (#10035)
The kangaroo logo on the welcome screen had a visual glitch where it would instantly jump to the top position when hovering, instead of smoothly starting the bounce from its resting position. Changes: - Added custom smooth-bounce keyframe animation in index.css that explicitly starts from translateY(0) - Updated RooHero component to use hover state tracking with the new animation - Removed Tailwind's animate-bounce class which was causing the glitch The animation now smoothly bounces from the resting position without any jarring visual jumps.
1 parent 710e7dd commit b2941d5

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

webview-ui/src/components/welcome/RooHero.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ const RooHero = () => {
55
const w = window as any
66
return w.IMAGES_BASE_URI || ""
77
})
8+
const [isHovered, setIsHovered] = useState(false)
89

910
return (
10-
<div className="mb-4 relative forced-color-adjust-none group flex flex-col items-center w-30 pt-4 overflow-clip">
11+
<div
12+
className="mb-4 relative forced-color-adjust-none group flex flex-col items-center w-30 pt-4 overflow-clip"
13+
onMouseEnter={() => setIsHovered(true)}
14+
onMouseLeave={() => setIsHovered(false)}>
1115
<div
1216
style={{
1317
backgroundColor: "var(--vscode-foreground)",
@@ -17,8 +21,9 @@ const RooHero = () => {
1721
maskImage: `url('${imagesBaseUri}/roo-logo.svg')`,
1822
maskRepeat: "no-repeat",
1923
maskSize: "contain",
24+
animation: isHovered ? "smooth-bounce 1s ease-in-out infinite" : "none",
2025
}}
21-
className="z-5 mr-auto group-hover:animate-bounce translate-y-0 transition-transform duration-500">
26+
className="z-5 mr-auto translate-y-0 transition-transform duration-500">
2227
<img src={imagesBaseUri + "/roo-logo.svg"} alt="Roo logo" className="h-8 opacity-0" />
2328
</div>
2429
<div

webview-ui/src/index.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,29 @@
205205
.history-item-highlight {
206206
@apply underline;
207207
}
208+
209+
/* Custom smooth bounce animation for Roo hero */
210+
@keyframes smooth-bounce {
211+
0% {
212+
transform: translateY(0);
213+
}
214+
25% {
215+
transform: translateY(-25%);
216+
}
217+
50% {
218+
transform: translateY(0);
219+
}
220+
75% {
221+
transform: translateY(-12.5%);
222+
}
223+
100% {
224+
transform: translateY(0);
225+
}
226+
}
227+
228+
.animate-smooth-bounce {
229+
animation: smooth-bounce 1s ease-in-out infinite;
230+
}
208231
}
209232

210233
/* Form Element Focus States */

0 commit comments

Comments
 (0)