Styled uploadUI

- Updated privacy disclaimer
- Updated libs used
This commit is contained in:
2024-02-15 20:42:27 +01:00
parent a0a096b9e7
commit fea0db7b9f
5 changed files with 28 additions and 25 deletions

View File

@ -1,7 +1,7 @@
<div class="container mx-auto p-4 mt-4">
<h1 class="text-4xl font-bold text-center text-gray-800 mb-10">Upload Your File</h1>
<div class="bg-white shadow-lg rounded-lg p-6">
<div *ngIf="!uploadStarted" class="flex flex-col items-center justify-center">
<div *ngIf="!uploadStarted" class="flex flex-col items-center justify-center lg:p-5">
<!-- File Drop Area -->
<div
*ngIf="!fileToUpload && !uploadStarted"
@ -44,6 +44,7 @@
</div>
<!-- Upload Button -->
<button class="btn btn-primary w-full max-w-xs" (click)="startUpload()">Upload File</button>
<p class="text-gray-600 text-center mt-6">Drag and drop files, or click to select the files you want to share.</p>
</div>
<!-- Upload Progress -->
<div *ngIf="uploadStarted && fileToUpload && !uploadFinished" class="flex flex-col items-center justify-center animate-in fade-in duration-500">
@ -57,10 +58,9 @@
<button class="btn btn-primary w-full max-w-xs">Upload Another File</button>
</div>
</div>
<p class="text-gray-600 text-center mt-6">Drag and drop files, or click to select the files you want to share.</p>
</div>
<!-- Invisible SVGs to prevent lazy loading -->
<div class="invisible">
<div class="invisible h-0 w-0">
<img src="./assets/file-solid.svg">
<img src="./assets/circle-check-solid.svg">
</div>

View File

@ -31,9 +31,7 @@ export class UploadComponent {
uploadStarted: boolean = false;
uploadProgress = 0; // Real progress
targetUploadProgress = 0; // New target progress to reach
uploadFinished = false;
uploadSpeedBps: number = 0;
@ -103,18 +101,6 @@ export class UploadComponent {
.catch(error => {
console.error('Upload failed:', error.response ? error.response.data : error.message);
});
/*// Old simulation of upload progress
const interval = setInterval(() => {
if (this.uploadProgress < 100) {
this.uploadProgress++;
} else {
clearInterval(interval); // Stop the interval when progress reaches 100%
this.uploadFinished = true;
}
}, 10);*/
}
}