Skip to content

Commit

Permalink
Merge pull request #93 from Valik3201/feature/mobileMenuCloseFunction
Browse files Browse the repository at this point in the history
mobile menu close actualization
  • Loading branch information
Valik3201 committed Jan 6, 2024
2 parents 56c1b74 + 0aded86 commit b4e3722
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions src/js/mobileMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ const openMenu = () => {
};

const closeMenu = () => {
mobileMenuSingIn.style.transform = 'translateX(-100%)';
mobileMenuSingUp.style.transform = 'translateX(-100%)';

setTimeout(() => {
mobileMenuSingIn.style.display = 'none';
mobileMenuSingUp.style.display = 'none';
}, 500);
onAuthStateChanged(auth, user => {
if (user) {
mobileMenuSingIn.style.transform = 'translateX(-100%)';
setTimeout(() => {
mobileMenuSingIn.style.display = 'none';
}, 500);
} else {
mobileMenuSingIn.style.transform = 'translateX(-100%)';
setTimeout(() => {
mobileMenuSingUp.style.transform = 'translateX(-100%)';
}, 500);
}
});
};

//closing mobile menu function if window size is bigger than 768px
Expand Down
2 changes: 1 addition & 1 deletion src/partials/home/home-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</a>
<div class="switch-button-div-mobile">
<label for="t-switch" class="switch">
<input type="checkbox" class="theme-switch" id="t-switch" checked />
<input type="checkbox" class="theme-switch" checked />
<span class="slider"></span>
</label>
<button class="close-button">
Expand Down

0 comments on commit b4e3722

Please sign in to comment.