diff --git a/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.html b/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.html index 4953a1a..3b45dff 100644 --- a/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.html +++ b/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.html @@ -1,9 +1,9 @@
- -
diff --git a/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.scss b/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.scss index eaccded..40243a7 100644 --- a/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.scss +++ b/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.scss @@ -23,15 +23,14 @@ opacity: 0.5; padding: 1em 0.5em; transition-duration: 0.2s; -} -.zoom-slider:hover { - opacity: 1; - background-color: rgba(0, 0, 0, 0.3); - border-radius: 1em; + &:hover { + opacity: 1; + background-color: rgba(0, 0, 0, 0.3); + border-radius: 1em; + } } - .image-full-view-inner { height: 100%; width: 100%; @@ -42,3 +41,8 @@ .hidden { display: none; } + +.reset-image-zoom-button { + height: 3em; + margin: auto +} diff --git a/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.ts b/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.ts index 92144e6..338d539 100644 --- a/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.ts +++ b/mediarepo-ui/src/app/components/shared/file/content-viewer/image-viewer/image-viewer.component.ts @@ -9,6 +9,9 @@ import {SafeResourceUrl} from "@angular/platform-browser"; }) export class ImageViewerComponent implements OnChanges { @Input() imageUrl!: SafeResourceUrl | string; + @Input() maxZoom = 10; + @Input() minZoom = 0.5; + public imageZoom = 1; public imagePosition = { x: 0, y: 0 }; public mouseInImageView = false; @@ -52,13 +55,13 @@ export class ImageViewerComponent implements OnChanges { if (delta > 0) { this.imageZoom += 0.2; - if (this.imageZoom > 4) { - this.imageZoom = 4; + if (this.imageZoom > this.maxZoom) { + this.imageZoom = this.maxZoom; } } else if (delta < 0) { this.imageZoom -= 0.2; - if (this.imageZoom < 0.5) { - this.imageZoom = 0.5; + if (this.imageZoom < this.minZoom) { + this.imageZoom = this.minZoom; } } }