-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sbb-sticky-bar): fade in vertically during initial load [WIP] #3073
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few considerations, but overall a solid job 👍
// To decide whether the fade in should happen from bottom up, | ||
// we check how far away the sticky bar from the intersector is. When scrolling fast, the | ||
// difference can slightly vary. From this perspective we add a height tolerance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// To decide whether the fade in should happen from bottom up, | |
// we check how far away the sticky bar from the intersector is. When scrolling fast, the | |
// difference can slightly vary. From this perspective we add a height tolerance. | |
// To decide whether to fade in from the bottom up, | |
// we check how far away the sticky bar is from the intersector. When scrolling fast, the | |
// difference can vary slightly. To account for this, we add a height tolerance. |
this.toggleAttribute( | ||
'data-sticking', | ||
!entry.isIntersecting && entry.boundingClientRect.top > 0, | ||
'data-fade-vertically', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sold on the name 'data-fade-vertically' since the animation looks a bit more like a slide-up, but I don't really know a better name and it's a trivial aspect after all 😅
4d4d0a7
to
22ec235
Compare
Closes #3072