Skip to content

Commit

Permalink
Merge pull request #32 from densbornp/dev
Browse files Browse the repository at this point in the history
Fixed footer displaying issues and edited the Dockerfile
  • Loading branch information
densbornp authored Jan 7, 2024
2 parents 26c5b1b + 1ccf14c commit 49da313
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget http://archive.apache.org/dist/maven/maven-3/"$MAVEN_VERSION"/binaries/
RUN mkdir /opt/ghostface
COPY . /opt/ghostface
WORKDIR /opt/ghostface/frontend
RUN npm install -g @angular/cli && npm install
RUN npm install -g @angular/cli && npm install && npm run build
WORKDIR /opt/ghostface
RUN mvn clean install
WORKDIR /opt/ghostface/backend
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Navigate to the Directory: cd ghostface
Run the Application:
1. Switch the directory to ghostface/frontend and execute:
```
npm install -g @angular/cli && npm install
npm install -g @angular/cli && npm install && npm run build
```
2. Switch back to ghostface and execute:
```
Expand Down
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.burningstack.ghostface</groupId>
<artifactId>backend</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1-SNAPSHOT</version>
<description>Java-Backend for the GhostFace project</description>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.burningstack.ghostface</groupId>
<artifactId>frontend</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Angular-Frontend for the GhostFace project</description>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/faq/faq.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="main-content">
<div class="main-content" [style.paddingBottom.px]="footerHeight">
<app-navigation></app-navigation>
<section id="info" class="info-bg mb-5">
<div class="container">
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/faq/faq.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.main-content {
min-height: 100vh;
padding-bottom: 241px;
}
15 changes: 11 additions & 4 deletions frontend/src/app/faq/faq.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, HostListener, OnInit } from '@angular/core';

@Component({
selector: 'app-faq',
Expand All @@ -7,9 +7,16 @@ import { Component, OnInit } from '@angular/core';
})
export class FaqComponent implements OnInit {

constructor() { }
footerHeight: number;

ngOnInit(): void {
}
constructor() { }

ngOnInit(): void {
this.footerHeight = document.getElementById('footer').offsetHeight;
}

@HostListener('window:resize', ['$event'])
onResize(event) {
this.footerHeight = document.getElementById('footer').offsetHeight;
}
}
2 changes: 1 addition & 1 deletion frontend/src/app/footer/footer.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer class="bg-light text-center text-lg-start h-auto">
<footer id="footer" class="bg-light text-center text-lg-start h-auto" [style.marginTop.px]="footerHeight">
<div class="container p-4">
<div class="row mt-4 justify-content-center text-center">
<div class="col-lg-3 col-md-6 mb-4 mb-md-0">
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/app/footer/footer.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
footer {
height: 241px;
margin-top: -241px;
}
16 changes: 12 additions & 4 deletions frontend/src/app/footer/footer.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, HostListener, OnInit } from '@angular/core';

@Component({
selector: 'app-footer',
Expand All @@ -7,9 +7,17 @@ import { Component, OnInit } from '@angular/core';
})
export class FooterComponent implements OnInit {

constructor() { }
footerHeight: number;

ngOnInit(): void {
}
constructor() { }

ngOnInit(): void {
// Calculate footer height and inverse it to set margin-top
this.footerHeight = document.getElementById('footer').offsetHeight * -1;
}

@HostListener('window:resize', ['$event'])
onResize(event) {
this.footerHeight = document.getElementById('footer').offsetHeight * -1;
}
}
4 changes: 2 additions & 2 deletions frontend/src/app/landing-page/landing-page.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="main-content">
<div class="main-content" [style.paddingBottom.px]="footerHeight">
<app-hero></app-hero>
<app-navigation></app-navigation>
<app-info></app-info>
<app-conversion></app-conversion>
</div>
<app-footer></app-footer>
<app-footer></app-footer>
1 change: 0 additions & 1 deletion frontend/src/app/landing-page/landing-page.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.main-content {
min-height: 100vh;
padding-bottom: 241px;
}
9 changes: 8 additions & 1 deletion frontend/src/app/landing-page/landing-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostListener } from '@angular/core';
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
import { CookieModalComponent } from '../cookie-modal/cookie-modal.component';
import { CookieService } from '../services/cookie.service';
Expand All @@ -15,12 +15,19 @@ export class LandingPageComponent {
ignoreBackdropClick: true,
'class': 'modal-dialog-centered'
};
footerHeight: number;

constructor(private modalService: BsModalService, private cookieService: CookieService) {
}

ngOnInit(): void {
this.checkCookieAndOpenConsent();
this.footerHeight = document.getElementById('footer').offsetHeight;
}

@HostListener('window:resize', ['$event'])
onResize(event) {
this.footerHeight = document.getElementById('footer').offsetHeight;
}

private showCookieModal() {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.burningstack.ghostface</groupId>
<artifactId>ghostface</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<description>GhostFace project build with Spring Boot and Angular</description>
<modules>
Expand Down

0 comments on commit 49da313

Please sign in to comment.