Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

feat(frontend:files): add fulscreen button in image viewer

7185b8346182fd3d
diff --git a/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.html b/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.html
index 14dac871..1894f29c 100644
--- a/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.html
+++ b/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.html
@@ -4,66 +4,81 @@
~ See the LICENSE file for licensing details
-->
-<div>
- <div class="app-top-menu d-flex justify-content-between">
- <div class="d-flex">
- <button
- (click)="previousImage()"
- [tooltip]="'Previous' | translate:locale.language"
- [adaptivePosition]="true"
- container="body"
- class="d-none d-sm-block btn btn-sm btn-custom me-1"
- type="button">
- <fa-icon [icon]="icons.faAngleLeft"></fa-icon>
- </button>
- <button
- (click)="nextImage()"
- [tooltip]="'Next' | translate:locale.language"
- container="body"
- class="d-none d-sm-block btn btn-sm btn-custom me-1"
- type="button">
- <fa-icon [icon]="icons.faAngleRight"></fa-icon>
- </button>
- @if (!isSlideshowActive()) {
- <button
- (click)="startSlideshow()"
- [tooltip]="'Start slideshow' | translate:locale.language"
- container="body"
- class="d-none d-sm-block btn btn-sm btn-custom me-1"
- type="button">
- <fa-icon [icon]="icons.faPlay"></fa-icon>
- </button>
- } @else {
- <button
- (click)="stopSlideshow()"
- [tooltip]="'Stop slideshow' | translate:locale.language"
- container="body"
- class="d-none d-sm-block btn btn-sm btn-custom me-1"
- type="button">
- <fa-icon [icon]="icons.faStop"></fa-icon>
- </button>
- }
- </div>
- <div>{{ imageIndex() + 1 }} of {{ imageCount() }}</div>
+<div class="app-top-menu d-flex justify-content-between">
+ <div class="d-flex">
+ <button
+ (click)="previousImage()"
+ [tooltip]="'Previous' | translate:locale.language"
+ [adaptivePosition]="true"
+ container="body"
+ class="d-none d-sm-block btn btn-sm btn-custom me-1"
+ type="button">
+ <fa-icon [icon]="icons.faAngleLeft"></fa-icon>
+ </button>
<button
- btnCheckbox
- [(ngModel)]="isInfoboxOpen"
- [tooltip]="'Info' | translate:locale.language"
+ (click)="nextImage()"
+ [tooltip]="'Next' | translate:locale.language"
container="body"
class="d-none d-sm-block btn btn-sm btn-custom me-1"
type="button">
- <fa-icon [icon]="icons.faInfo"></fa-icon>
+ <fa-icon [icon]="icons.faAngleRight"></fa-icon>
+ </button>
+ @if (!isSlideshowActive()) {
+ <button
+ (click)="startSlideshow()"
+ [tooltip]="'Start slideshow' | translate:locale.language"
+ container="body"
+ class="d-none d-sm-block btn btn-sm btn-custom me-1"
+ type="button">
+ <fa-icon [icon]="icons.faPlay"></fa-icon>
+ </button>
+ } @else {
+ <button
+ (click)="stopSlideshow()"
+ [tooltip]="'Stop slideshow' | translate:locale.language"
+ container="body"
+ class="d-none d-sm-block btn btn-sm btn-custom me-1"
+ type="button">
+ <fa-icon [icon]="icons.faStop"></fa-icon>
+ </button>
+ }
+ <button
+ (click)="fullscreen()"
+ [tooltip]="'Fullscreen' | translate:locale.language"
+ container="body"
+ class="d-none d-sm-block btn btn-sm btn-custom me-1"
+ type="button">
+ <fa-icon [icon]="icons.faExpand"></fa-icon>
</button>
</div>
- <div class="app-viewer-image" [style.height.px]="currentHeightWithOffset()">
+ <div>{{ imageIndex() + 1 }} of {{ imageCount() }}</div>
+ <button
+ btnCheckbox
+ [(ngModel)]="isInfoboxOpen"
+ [tooltip]="'Infos' | translate:locale.language"
+ container="body"
+ class="d-none d-sm-block btn btn-sm btn-custom me-1"
+ type="button">
+ <fa-icon [icon]="icons.faInfo"></fa-icon>
+ </button>
+</div>
+<div class="app-viewer-image" [style.height.px]="currentHeightWithOffset()">
<img #image
(load)="onImageLoad()"
[src]="file().dataUrl" [style.max-height.px]="currentHeightWithOffset()"
alt="" />
- <div class="info-box" [class.d-none]="!isInfoboxOpen()">
- {{ file().mime }}
- {{ imageResolution() }}
- {{ file().hSize }}
+ <div class="info-box p-2 m-2 d-flex flex-column app-small-card rounded opacity-75" [class.d-none]="!isInfoboxOpen()">
+ <div class="d-flex mb-1">
+ <div class="d-flex col-sm fw-bold">{{ 'Type' | translate:locale.language }}</div>
+ <div>{{ file().mime }}</div>
+ </div>
+ <div class="d-flex mb-1">
+ <div class="d-flex col-sm fw-bold">{{ 'Dimensions' | translate:locale.language }}</div>
+ <div>{{ imageResolution() }}</div>
+ </div>
+ <div class="d-flex mb-1">
+ <div class="d-flex col-sm fw-bold">{{ 'Size' | translate:locale.language }}</div>
+ <div>{{ file().hSize }}</div>
</div>
</div>
</div>
diff --git a/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.ts b/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.ts
index 0995a8a1..98f2da70 100755
--- a/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.ts
+++ b/frontend/src/app/applications/files/components/viewers/files-viewer-image.component.ts
@@ -8,7 +8,7 @@ import { ChangeDetectionStrategy, Component, computed, DestroyRef, ElementRef, i
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
import { FormsModule } from '@angular/forms'
import { FaIconComponent } from '@fortawesome/angular-fontawesome'
-import { faAngleLeft, faAngleRight, faInfo, faPlay, faStop } from '@fortawesome/free-solid-svg-icons'
+import { faAngleLeft, faAngleRight, faExpand, faInfo, faPlay, faStop } from '@fortawesome/free-solid-svg-icons'
import { L10N_LOCALE, L10nLocale, L10nTranslatePipe } from 'angular-l10n'
import { ButtonCheckboxDirective } from 'ngx-bootstrap/buttons'
import { TooltipModule } from 'ngx-bootstrap/tooltip'
@@ -31,7 +31,7 @@ export class FilesViewerImageComponent {
protected imageCount = computed(() => this.directoryImages().length)
protected imageIndex = computed(() => this.directoryImages().indexOf(this.file()))
protected imageResolution = signal<string>('')
- protected readonly icons = { faAngleLeft, faAngleRight, faInfo, faPlay, faStop }
+ protected readonly icons = { faAngleLeft, faAngleRight, faExpand, faInfo, faPlay, faStop }
protected readonly locale = inject<L10nLocale>(L10N_LOCALE)
private readonly slideDelay = 5000
private destroyRef = inject(DestroyRef)
@@ -51,6 +51,10 @@ export class FilesViewerImageComponent {
this.file.set(this.directoryImages()[(this.imageCount() + this.imageIndex() - 1) % this.imageCount()])
}
+ protected fullscreen() {
+ this.imageRef().nativeElement.requestFullscreen()
+ }
+
protected startSlideshow() {
this.isSlideshowActive.set(true)
this.slideshowSub = timer(this.slideDelay, this.slideDelay)
diff --git a/frontend/src/styles/components/_app.scss b/frontend/src/styles/components/_app.scss
index 70f59387..32c078dc 100755
--- a/frontend/src/styles/components/_app.scss
+++ b/frontend/src/styles/components/_app.scss
@@ -377,9 +377,7 @@
position: absolute;
bottom: 0;
right: 0;
- text-shadow: 1px 1px 2px #000,
- 0 0 1em #fff,
- 0 0 0.2em #fff;
+ width: $control-sidebar-width;
}
}