Skip to content

Commit 137e9b4

Browse files
committed
adjust animation timing
1 parent a650652 commit 137e9b4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

@theme/components/Navbar/Navbar.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@ export function AlertBanner({ message, button, link, show }) {
2424
React.useEffect(() => {
2525
const banner = bannerRef.current;
2626
if (!banner) return;
27-
28-
// Define the event handler
2927
const handleMouseEnter = () => {
3028
banner.classList.add('has-hover');
3129
};
32-
3330
// Attach the event listener
3431
banner.addEventListener('mouseenter', handleMouseEnter);
35-
3632
// Clean up the event listener on unmount
3733
return () => {
3834
banner.removeEventListener('mouseenter', handleMouseEnter);

static/css/devportal2024-v1.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles/_top-banner.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
color: $white;
1515
.button-icon{
1616
animation: iconJitter 1s ease-in-out forwards;
17+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
1718
}
1819
}
1920
color: $white !important;
@@ -35,13 +36,14 @@
3536
z-index: 0;
3637
transform: scaleX(0); // Start scaled down to 0
3738
transform-origin: left; // Scale from the left edge
38-
transition: transform 1s cubic-bezier(0.25, 0.8, 0.25, 1);
39+
transition: transform 0.7s cubic-bezier(0.7, 0, 0.84, 0);
3940
will-change: transform; // Hint for smoother animations
4041
}
4142

4243
// On hover, scale to full width
4344
&:hover::after {
4445
transform: scaleX(1);
46+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
4547
}
4648
// Ensure direct children are above the pseudo-element
4749
> * {
@@ -107,7 +109,7 @@
107109
width: 12.5px; // Scaled down from 13.8px
108110
animation: none;
109111
transform: rotateZ(0deg);
110-
transition: transform 0.5s ease-in-out; // Adjust duration as needed
112+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); // Adjust duration as needed
111113
@media (max-width: 524px) {
112114
width: 9px; // Scaled down from 10px
113115
}
@@ -151,6 +153,7 @@
151153
.button-icon {
152154
animation: iconJitter 1s ease-in-out;
153155
animation-iteration-count: 1;
156+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
154157
}
155158
@keyframes iconReturn {
156159
from {
@@ -163,4 +166,5 @@
163166
/* After the banner has been hovered once, on unhover run the reverse animation */
164167
.web-banner.has-hover:not(:hover) .button-icon {
165168
animation: iconReturn 1s ease-in-out forwards;
169+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
166170
}

0 commit comments

Comments
 (0)