finish mobile menu and scroll event
This commit is contained in:
+4
-4
@@ -3,10 +3,10 @@
|
|||||||
<main class="main">
|
<main class="main">
|
||||||
<app-cover></app-cover>
|
<app-cover></app-cover>
|
||||||
<app-welcome></app-welcome>
|
<app-welcome></app-welcome>
|
||||||
<app-two-events></app-two-events>
|
<app-two-events id="events"></app-two-events>
|
||||||
<app-venue></app-venue>
|
<app-venue id="venue"></app-venue>
|
||||||
<app-media></app-media>
|
<app-media id="media"></app-media>
|
||||||
<app-information></app-information>
|
<app-information id="information"></app-information>
|
||||||
<app-cities></app-cities>
|
<app-cities></app-cities>
|
||||||
<app-footer></app-footer>
|
<app-footer></app-footer>
|
||||||
<router-outlet />
|
<router-outlet />
|
||||||
|
|||||||
+18
-25
@@ -4,12 +4,12 @@
|
|||||||
<div
|
<div
|
||||||
#menuContainer
|
#menuContainer
|
||||||
class="w-screen flex md:hidden items-center h-19 bg-ejc-dark-blue justify-between px-5 relative">
|
class="w-screen flex md:hidden items-center h-19 bg-ejc-dark-blue justify-between px-5 relative">
|
||||||
<div>logo</div>
|
<div></div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
(click)="isMenuOpen = !isMenuOpen"
|
(click)="isMenuOpen = !isMenuOpen"
|
||||||
class="flex items-center justify-center">
|
class="flex items-center justify-center cursor-pointer">
|
||||||
<!-- Hamburger icon -->
|
<!-- Hamburger icon -->
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@@ -25,27 +25,20 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@if (isMenuOpen) {
|
@if (isMenuOpen) {
|
||||||
<div
|
<div #menu class="absolute top-full right-0 mt-2 w-56 rounded-lg shadow-lg bg-white z-50">
|
||||||
#menu
|
<a class="block px-4 py-3 hover:bg-white text-ejc-dark transition-colors cursor-pointer" (click)="scrollTo('events'); closeMenu()">
|
||||||
class="absolute top-full right-0 mt-2 w-56 rounded-lg shadow-lg bg-white z-50">
|
Events
|
||||||
<a
|
</a>
|
||||||
class="block px-4 py-3 hover:bg-gray-100 transition-colors cursor-pointer"
|
<a class="block px-4 py-3 hover:bg-white text-ejc-dark transition-colors cursor-pointer" (click)="scrollTo('venue'); closeMenu()">
|
||||||
(click)="closeMenu()">
|
Venue
|
||||||
Menu Item 1
|
</a>
|
||||||
</a>
|
<a class="block px-4 py-3 hover:bg-white text-ejc-dark transition-colors cursor-pointer" (click)="scrollTo('media'); closeMenu()">
|
||||||
|
Media
|
||||||
<a
|
</a>
|
||||||
class="block px-4 py-3 hover:bg-gray-100 transition-colors cursor-pointer"
|
<a class="block px-4 py-3 hover:bg-white text-ejc-dark transition-colors cursor-pointer" (click)="scrollTo('information'); closeMenu()">
|
||||||
(click)="closeMenu()">
|
Information
|
||||||
Menu Item 2
|
</a>
|
||||||
</a>
|
</div>
|
||||||
|
}
|
||||||
<a
|
|
||||||
class="block px-4 py-3 hover:bg-gray-100 transition-colors cursor-pointer"
|
|
||||||
(click)="closeMenu()">
|
|
||||||
Menu Item 3
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ export class Header {
|
|||||||
this.isMenuOpen = false;
|
this.isMenuOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollTo(id: string): void {
|
||||||
|
document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' });
|
||||||
|
}
|
||||||
|
|
||||||
@HostListener('document:click', ['$event'])
|
@HostListener('document:click', ['$event'])
|
||||||
onDocumentClick(event: MouseEvent): void {
|
onDocumentClick(event: MouseEvent): void {
|
||||||
if (!this.isMenuOpen) {
|
if (!this.isMenuOpen) {
|
||||||
|
|||||||
Reference in New Issue
Block a user