perf(topbar): optimize scroll up/down animation with GPU acceleration

This commit is contained in:
Tom (plebeius.eth)
2025-02-20 00:07:26 +01:00
parent 88b3effdf4
commit fbd46cb6ab
2 changed files with 4 additions and 2 deletions

View File

@@ -4,7 +4,9 @@
position: fixed;
width: 100%;
z-index: 6;
transition: top 0.2s ease-in-out;
will-change: transform;
transform: translateY(0);
transition: transform 0.2s ease-in-out;
align-items: center;
justify-content: space-around;
}

View File

@@ -24,7 +24,7 @@ const StickyHeader = () => {
}, []);
return (
<div className={styles.content} style={{ top: visible ? 0 : '-40px' }}>
<div className={styles.content} style={{ transform: visible ? 'translateY(0)' : 'translateY(-40px)' }}>
<TopBar />
<AccountBar />
</div>