Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Footer/navigationbar implemented (#171)
Browse files Browse the repository at this point in the history
* chore: added icons for footer

* feat: Add footer component

* fix: footer wird nurnoch bei den gewünschten seiten angezeigt

* feat: routing bei footer-html implementiert

* style: highlighten der aktuellen Maske innerhalb des Footers

---------

Co-authored-by: Justin Hubert <135236159+Jstn2004@users.noreply.github.com>
  • Loading branch information
wwwLuis and Jstn2004 authored May 10, 2024
1 parent a5780ee commit bdcd64f
Show file tree
Hide file tree
Showing 11 changed files with 176 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<router-outlet></router-outlet>
<app-footer *ngIf="hasFooter()"></app-footer>
<!--TODO: set visible for the laoding progress-->
<app-loader *ngIf="isLoading" ></app-loader>
<app-toast></app-toast>
9 changes: 8 additions & 1 deletion frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ import { LoaderService } from './services/loader.service';
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
})

export class AppComponent implements OnInit{
title = 'duogradus. | Sammle Schritte, Tritt gegen Freunde an und steig in der Liga auf';
isLoading: boolean = false;
constructor(private loaderService: LoaderService) {

}

hasFooter() {
const footerPages: string[] = ['/main', '/ranking'];
return footerPages.includes(window.location.pathname);
}

ngOnInit(): void {
this.loaderService.isLoading.subscribe((value) => {
this.isLoading = value;
});

}
}

4 changes: 4 additions & 0 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import { InputfieldComponent } from './components/atoms/inputfield/inputfield.co
import { SignupformComponent } from './components/organisms/signupform/signupform.component';
import { LoaderComponent } from './components/atoms/loader/loader.component';
import { LandingpageComponent } from './components/pages/landingpage/landingpage.component';
import { FooterComponent } from './components/organisms/footer/footer.component';
import { UserCardComponent } from './components/atoms/user-card/user-card.component';
import { RankingTableComponent } from './components/organisms/ranking-table/ranking-table.component';
import { RankingPageComponent } from './components/pages/ranking-page/ranking-page.component';



@NgModule({
declarations: [
AppComponent,
Expand All @@ -43,10 +45,12 @@ import { RankingPageComponent } from './components/pages/ranking-page/ranking-pa
SignupformComponent,
LoaderComponent,
LandingpageComponent,
FooterComponent,
UserCardComponent,
RankingTableComponent,
RankingPageComponent,


],
imports: [BrowserModule, AppRoutingModule, BrowserAnimationsModule],
providers: [provideAnimations()],
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/app/components/organisms/footer/footer.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div id="container">
<div id="nav-main"
(click)="navigate('/main')"
[ngClass]="isOnPage('/main')? 'nav-element highlight': 'nav-element'">
<img class="icons" src="../../../../assets/icons/home.svg" alt="home-svg">
</div>
<div id="nav-ranked"
(click)="navigate('/ranking')"
[ngClass]="isOnPage('/ranking')? 'nav-element highlight': 'nav-element'">
<img class="icons" src="../../../../assets/icons/podium.svg" alt="podium-svg">
</div>
<div id="nav-friendlist"
(click)="navigate('/friendlist')"
[ngClass]="isOnPage('/friendlist')? 'nav-element highlight': 'nav-element'">
<img class="icons" src="../../../../assets/icons/friends.svg" alt="friends-svg">
</div>
<div id="nav-profile"
(click)="navigate('/profile')"
[ngClass]="isOnPage('/profile')? 'nav-element highlight': 'nav-element'">
<img class="icons" src="../../../../assets/icons/profile.svg" alt="profile-svg">
</div>
</div>
39 changes: 39 additions & 0 deletions frontend/src/app/components/organisms/footer/footer.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#container{
//fix position at the bottom of the page
position: fixed;
bottom: 0;

//format + borders
display: flex;
justify-content: space-evenly;
width: 100%;
height: 10vh;
background-color: var(--background-black);
color: var(--white);
border-top: 1px solid;

//format navigation elements
.nav-element{
text-align: center;
width: 25%;
height: 100%;

.icons{
width: 60%;
max-width: 4.5rem;
filter: brightness(0) invert(1);
padding-top: 5%;
}
}
.highlight{
background-color: var(--white)!important;
.icons{
filter:invert(0);
}
}

//seperate navigation elements with borders
#nav-main, #nav-ranked, #nav-friendlist{
border-right: 1px solid var(--white);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { FooterComponent } from './footer.component';

describe('FooterComponent', () => {
let component: FooterComponent;
let fixture: ComponentFixture<FooterComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [FooterComponent]
})
.compileComponents();

fixture = TestBed.createComponent(FooterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
22 changes: 22 additions & 0 deletions frontend/src/app/components/organisms/footer/footer.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrl: './footer.component.scss'
})
export class FooterComponent {
router: Router;

constructor(router:Router){
this.router=router
}

navigate(path:string){
this.router.navigateByUrl(path);
}
isOnPage(path:string):boolean{
return this.router.url==path;
}
}
11 changes: 11 additions & 0 deletions frontend/src/assets/icons/friends.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions frontend/src/assets/icons/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions frontend/src/assets/icons/podium.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions frontend/src/assets/icons/profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bdcd64f

Please sign in to comment.