EventZ
{{ route.name }}
diff --git a/eventz-ui/src/components/navbar/navbar.component.ts b/eventz-ui/src/components/navbar/navbar.component.ts
index 756f2cf..cb0ca7d 100644
--- a/eventz-ui/src/components/navbar/navbar.component.ts
+++ b/eventz-ui/src/components/navbar/navbar.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { IRoutes } from '../../interfaces/interface';
import { CommonModule } from '@angular/common';
@@ -12,6 +12,7 @@ import { CommonModule } from '@angular/common';
export class NavbarComponent implements OnInit {
showNav: Boolean = false;
@Input () isLandinPage: boolean = true;
+ @Output () clickedNavItem = new EventEmitter
();
routes: IRoutes[] = [
{name:'Home', path: 'home'},
{name:'About', path: 'about'},
@@ -42,8 +43,9 @@ export class NavbarComponent implements OnInit {
}
}
- toggleNav() {
+ toggleNav(route: IRoutes) {
this.showNav = !this.showNav;
+ this.clickedNavItem.emit(route);
}
ngOnDestroy() {
diff --git a/eventz-ui/src/pages/landing/landing.component.html b/eventz-ui/src/pages/landing/landing.component.html
index f0d0b27..a2dd500 100644
--- a/eventz-ui/src/pages/landing/landing.component.html
+++ b/eventz-ui/src/pages/landing/landing.component.html
@@ -1,6 +1,6 @@
-
+
Your Ultimate Destination For Unforgettable
@@ -9,13 +9,13 @@
-
+
-
+
@@ -38,7 +38,7 @@
Make Your Own Event
-
+
diff --git a/eventz-ui/src/pages/landing/landing.component.ts b/eventz-ui/src/pages/landing/landing.component.ts
index ac99f23..5aaca07 100644
--- a/eventz-ui/src/pages/landing/landing.component.ts
+++ b/eventz-ui/src/pages/landing/landing.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
+import { CommonModule } from '@angular/common';
import { NavbarComponent } from "../../components/navbar/navbar.component";
import { CategoriesComponent } from "../../components/categories/categories.component";
import { AboutComponent } from "../../components/about/about.component";
@@ -9,16 +10,18 @@ import { ContactformComponent } from "../../components/contactform/contactform.c
import { FooterComponent } from "../../components/footer/footer.component";
import { SearchFormComponent } from "../../components/search-form/search-form.component";
import { Router } from '@angular/router';
+import { IRoutes } from '../../interfaces/interface';
@Component({
selector: 'app-landing',
standalone: true,
- imports: [NavbarComponent, CategoriesComponent, AboutComponent, EventsComponent, EventComponent, ButtonComponent, ContactformComponent, FooterComponent, SearchFormComponent],
+ imports: [CommonModule,NavbarComponent, CategoriesComponent, AboutComponent, EventsComponent, EventComponent, ButtonComponent, ContactformComponent, FooterComponent, SearchFormComponent],
templateUrl: './landing.component.html',
styleUrl: './landing.component.scss'
})
export class LandingComponent implements OnInit {
-
+ whiteColor: string = '#fff'
+ deepBlue: string ='#fff'
constructor (private router: Router) {}
ngOnInit(): void {
if (typeof window !== "undefined") {
@@ -28,6 +31,18 @@ export class LandingComponent implements OnInit {
}
}
}
- whiteColor: string = '#fff'
- deepBlue: string ='#fff'
+
+ handleClickedNavItem(event: IRoutes) {
+ console.log('Navigating to:', event);
+ const element = document.getElementById(event.name.toLocaleLowerCase());
+ if (!element) {
+ console.warn('Section not found:', event.name);
+ return;
+ }
+
+ element.scrollIntoView({
+ behavior: 'smooth',
+ block: 'start'
+ });
+ }
}