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

This commit is contained in:
Tom (plebeius.eth)
2025-02-20 00:12:06 +01:00
parent 3f7b436f37
commit 31c3482831
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -52,7 +52,9 @@
position: fixed;
width: 100%;
z-index: 3;
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;
}
+1 -1
View File
@@ -194,7 +194,7 @@ const TopBarMobile = ({ subplebbitAddress }: { subplebbitAddress: string }) => {
}, []);
return (
<div className={styles.boardNavMobile} id='sticky-menu' style={{ top: visible ? 0 : '-23px' }}>
<div className={styles.boardNavMobile} style={{ transform: visible ? 'translateY(0)' : 'translateY(-23px)' }}>
<div className={styles.boardSelect}>
<strong>{t('board')}</strong>
{boardSelect}