diff --git a/frontend/src/app/credits/credits.component.html b/frontend/src/app/credits/credits.component.html index 11be4c4..d8e8077 100644 --- a/frontend/src/app/credits/credits.component.html +++ b/frontend/src/app/credits/credits.component.html @@ -1,21 +1,40 @@ -

credits works!

+
+
+ + SharePulse Logo + SharePulse + +
+

+ Upload a file. Share the URL/link. Download the file. Simple as that. +

+
+
+

Developer:

+

Walzen665

+
+
+

Version:

+

1.0.0

+
+
+

API-Status:

+

online

+
+ +
-

- Used media -

- +

+ Privacy Policy | + Terms of Use +

+ +
diff --git a/frontend/src/app/credits/credits.component.ts b/frontend/src/app/credits/credits.component.ts index 38205bc..f23db40 100644 --- a/frontend/src/app/credits/credits.component.ts +++ b/frontend/src/app/credits/credits.component.ts @@ -1,12 +1,26 @@ import { Component } from '@angular/core'; +import {RouterLink} from "@angular/router"; +import {LegalService} from "../../service/legalService"; @Component({ selector: 'app-credits', standalone: true, - imports: [], + imports: [ + RouterLink + ], templateUrl: './credits.component.html', styleUrl: './credits.component.scss' }) export class CreditsComponent { + constructor(private legalService: LegalService) { + } + + openPrivacyPolicyModal() { + this.legalService.openPrivacyPolicy(); + } + + openTermsOfUseModal() { + this.legalService.openTermsOfUse(); + } } diff --git a/frontend/src/app/download/download.component.ts b/frontend/src/app/download/download.component.ts index 8d889a5..bc9e3b5 100644 --- a/frontend/src/app/download/download.component.ts +++ b/frontend/src/app/download/download.component.ts @@ -4,7 +4,7 @@ import {DevelopmentStore} from "../../store/DevelopmentStore"; import {FormsModule} from "@angular/forms"; import {DecimalPipe, NgClass, NgIf} from "@angular/common"; import funfacts from "../../assets/funfacts"; -import {RouterLink} from "@angular/router"; +import {ActivatedRoute, RouterLink} from "@angular/router"; @Component({ selector: 'app-download', @@ -24,7 +24,7 @@ export class DownloadComponent { @ViewChild('download_not_possible') download_not_possible: ElementRef | undefined; @ViewChild('file_not_found_modal') file_not_found_modal: ElementRef | undefined; - inputFileId: string = "2402183"; + inputFileId: string = ""; fileId: string = ""; filePassword: string = ""; fileName: string = ""; @@ -34,14 +34,28 @@ export class DownloadComponent { fileDownloadFinished: boolean = false; waitingForPassword: boolean = false; downloadProgress: number = 0; + targetUploadProgress: number = 0; downloadDuration: string = ""; passwordWrong: boolean = false; funfact: string = ""; - constructor(private developmentStore: DevelopmentStore) { + constructor(private developmentStore: DevelopmentStore, private activatedRoute: ActivatedRoute) { this.funfact = funfacts[Math.floor(Math.random() * funfacts.length)]; + + this.activatedRoute.queryParams.subscribe(params => { + const fileId = params['fileId']; + const password = params['password']; + if(password) { + this.filePassword = password; + } + if(fileId) { + this.inputFileId = fileId; + this.requestDownload(); + } + }); + this.speedTest(); } @@ -70,6 +84,11 @@ export class DownloadComponent { return; } else if(this.downloadInfo?.passwordProtected) { + if(this.filePassword) { + console.log("Requesting download with password"); + this.downloadFile(); + return; + } this.waitingForPassword = true; console.log("Password protected"); } @@ -137,8 +156,8 @@ export class DownloadComponent { // Calculate the percentage of download completed if(progressEvent.total) { const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total); - this.downloadProgress = percentCompleted; - console.log(percentCompleted + '%'); // Log the percentage or update any progress UI component + this.targetUploadProgress = percentCompleted; + this.smoothProgressUpdate(); } } }) @@ -183,6 +202,16 @@ export class DownloadComponent { private wrongPassword() { this.passwordWrong = true; } + + smoothProgressUpdate() { + if (this.downloadProgress < this.targetUploadProgress) { + this.downloadProgress += 0.01 * (this.targetUploadProgress - this.downloadProgress); + requestAnimationFrame(this.smoothProgressUpdate.bind(this)); + } else if (this.downloadProgress > this.targetUploadProgress) { + // Handle overshoot + this.downloadProgress = this.targetUploadProgress; + } + } } interface DownloadInfo { downloadable: boolean; diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html index ef9e744..748d814 100644 --- a/frontend/src/app/home/home.component.html +++ b/frontend/src/app/home/home.component.html @@ -25,72 +25,11 @@

We prioritize data security and privacy consequently. Files uploaded by our clients are securely stored on our servers for a maximum duration of one day, after which they are permanently deleted to guarantee the highest level of confidentiality and data protection. Read more in our - Privacy Policy note. - By using SharePulse, you agree to the Terms of Use.

+ Privacy Policy note. + By using SharePulse, you agree to the Terms of Use.

- - - - - - - - - -