Fix weird animation flash on mobile #304
Merged
a3thakra
merged 1 commits from adi-navbar-animation-fix
into main
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'adi-navbar-animation-fix'
Deleting a branch is permanent. It CANNOT be undone. Continue?
When we visit the website on mobile, there's a weird animation flash. This is caused because the navbar by default is placed at left: 0, and we see the transform animation once the page loads. This places the navbar at left: 100% (outside the screen) and transforms it to move into the screen - translateX(-100%)
.show.navMobileBackground + .navMenuWrapper {
transform: translateX(0);
transform: translateX(-100%);
Previously, it looks like we were using
translateX(100vw)
. Is there a reason why we should prefer either%
orvw
here?hmm good question 🤔 I did this a while back, and I have no idea why i didn't use vw. I'll rebase and see what the difference is.
Okay I figured it out!
The navbar is just outside the screen on the right. If we move it towards the left by it's width, it will be touching the right side of the screen. If we move it by the width of the screen, it will be touching the left side of the screen.
I rebased the branch, so you can try it on https://csclub.uwaterloo.ca/~a3thakra/csc/adi-navbar-animation-fix/
924f13783d
to5b8658dc43
2 years agoc7f0d83bba
into main 2 years agoReviewers
c7f0d83bba
.