Skip to content

Commit

Permalink
Merge pull request #450 from SrijaVuppala295/titlebar
Browse files Browse the repository at this point in the history
Changed Title in the Titlebar according to the pages !!!
  • Loading branch information
sakeel-103 authored Oct 29, 2024
2 parents 11e809a + e2c68b9 commit 597319f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 13 deletions.
7 changes: 5 additions & 2 deletions src/app/components/bfs-page/bfs-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, AfterViewInit, OnInit } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { AuthService } from '../../services/auth.service';
import { Title } from '@angular/platform-browser';
import { NavbarComponent } from '../navbar/navbar.component';

@Component({
Expand All @@ -24,9 +25,11 @@ export class BfsPageComponent implements AfterViewInit, OnInit {
isDropdownOpen: boolean = false;
private finalPath: number[] = []; // To store the final path taken

constructor(private authService: AuthService) {}
constructor(private authService: AuthService,private titleService: Title) {}

ngOnInit(): void {}
ngOnInit(): void {
this.titleService.setTitle('GraphExplorer Pro | BFS');
}

ngAfterViewInit(): void {
this.bfsCanvas = document.getElementById('bfs-canvas') as HTMLCanvasElement;
Expand Down
14 changes: 12 additions & 2 deletions src/app/components/dfs-page/dfs-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { AuthService } from '../../services/auth.service';
import { NavbarComponent } from '../navbar/navbar.component';
import { Title } from '@angular/platform-browser';

@Component({
selector: 'app-dfs-page',
Expand All @@ -12,6 +13,15 @@ import { NavbarComponent } from '../navbar/navbar.component';
styleUrls: ['./dfs-page.component.css'],
})
export class DfsPageComponent implements AfterViewInit, OnInit {

// constructor(private titleService: Title) { }

// ngOnInit(): void {

// this.titleService.setTitle('GraphExplorer | DFS');
// }


private nodes: { label: string; x: number; y: number }[] = [];
private edges: [number, number][] = [];

Expand All @@ -24,10 +34,10 @@ export class DfsPageComponent implements AfterViewInit, OnInit {
customEdgeInput: string = '';
isDropdownOpen: boolean = false;

constructor(private authService: AuthService) {}
constructor(private authService: AuthService,private titleService: Title) {}

ngOnInit(): void {
// No need to access the canvas here
this.titleService.setTitle('GraphExplorer Pro | DFS');
}

ngAfterViewInit(): void {
Expand Down
16 changes: 15 additions & 1 deletion src/app/components/faq/faq.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Component, AfterViewInit } from '@angular/core';
import { Component, AfterViewInit, OnInit } from '@angular/core';
import { NavbarComponent } from '../navbar/navbar.component';
import { Title } from '@angular/platform-browser';
import { AuthService } from '../../services/auth.service';

@Component({
selector: 'app-faq',
Expand All @@ -9,6 +11,14 @@ import { NavbarComponent } from '../navbar/navbar.component';
styleUrls: ['./faq.component.css']
})
export class FaqComponent implements AfterViewInit {

constructor(private authService: AuthService,private titleService: Title) {}

ngOnInit(): void {
this.titleService.setTitle('GraphExplorer Pro | FAQ');
}


ngAfterViewInit() {
// const faqItems = document.querySelectorAll<HTMLElement>('.faq-item');
// faqItems.forEach((item) => {
Expand All @@ -27,6 +37,10 @@ export class FaqComponent implements AfterViewInit {
// });
// }
// });




document.addEventListener('DOMContentLoaded', () => {
const togglers = document.querySelectorAll('[data-toggle]');

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/login-page/login-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login Form</title>
<title>GraphExplorer|LoginForm</title>
<link href="https://unpkg.com/[email protected]/css/boxicons.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet" />
</head>
Expand Down
14 changes: 11 additions & 3 deletions src/app/components/quiz/quiz.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { trigger, state, style, animate, transition } from '@angular/animations';
import { NavbarComponent } from '../navbar/navbar.component';
import { AuthService } from '../../services/auth.service';
import { Title } from '@angular/platform-browser';

interface Question {
text: string;
Expand Down Expand Up @@ -31,6 +33,14 @@ interface Question {
],
})
export class QuizComponent implements OnInit {


constructor(private authService: AuthService,private titleService: Title) {}

ngOnInit(): void {
this.titleService.setTitle('GraphExplorer Pro | Quiz');
this.shuffleQuestions();
}
questions: Question[] = [
{ text: "In a complete graph with n vertices, how many edges are there?", options: ["n", "n-1", "n(n-1)/2", "2^n"], correctAnswer: 2, difficulty: "easy" },
{ text: "What is the chromatic number of a planar graph?", options: ["2", "3", "4", "5"], correctAnswer: 2, difficulty: "easy" },
Expand All @@ -52,9 +62,7 @@ export class QuizComponent implements OnInit {
quizStarted: boolean = false; // Track whether the quiz has started
animationState: string = 'normal';

ngOnInit() {
this.shuffleQuestions();
}


get currentQuestion(): Question {
return this.questions[this.currentQuestionIndex];
Expand Down
9 changes: 7 additions & 2 deletions src/app/components/reviews/reviews.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { CommonModule } from '@angular/common';
import { NavbarComponent } from '../navbar/navbar.component';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { Title } from '@angular/platform-browser';
import { AuthService } from '../../services/auth.service';

interface Review {
id: number;
Expand Down Expand Up @@ -40,10 +42,13 @@ export class ReviewComponent implements OnInit {
newQuestion: Partial<Question> = {};
newReply: Partial<Reply> = {};

constructor(private http: HttpClient) {}

constructor(private http: HttpClient,private authService: AuthService,private titleService: Title) {}

ngOnInit() {
ngOnInit():void {
this.fetchReviews();
this.titleService.setTitle('GraphExplorer Pro | Reviews');

}

fetchReviews() {
Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8" />
<title>EccomPRJ - Real-Time Collaboration</title>
<title>GraphExplorer Pro</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" sizes="32x32"
Expand Down Expand Up @@ -820,4 +820,4 @@ <h2>What Our Users Say</h2>

</body>

</html>
</html>

0 comments on commit 597319f

Please sign in to comment.