Skip to content
Snippets Groups Projects
Commit 2816d5ab authored by jojohoch's avatar jojohoch
Browse files

[player] Improve scaling of images and button images

parent b2961b58
No related branches found
No related tags found
No related merge requests found
......@@ -7,5 +7,6 @@
"inputTooShort": "Eingabe zu kurz",
"inputTooLong": "Eingabe zu lang",
"wrongPattern": "Eingabe enthält falsche Zeichen"
}
},
"imageNotFound": "Bild nicht gefunden"
}
......@@ -22,12 +22,16 @@ import { ButtonElement } from '../models/button-element';
[style.border-radius.px]="elementModel.borderRadius">
{{elementModel.label}}
</button>
<input *ngIf="elementModel.imageSrc" type="image" [src]="elementModel.imageSrc"
[style.width.%]="100"
[style.height.%]="100"
[style.object-fit]="'contain'" alt="Bild nicht gefunden">
<input *ngIf="elementModel.imageSrc" type="image"
[src]="elementModel.imageSrc | safeResourceUrl"
[class]="elementModel.dynamicPositioning? 'dynamic-image' : 'static-image'"
[alt]="'imageNotFound' | translate">
</div>
`
`,
styles: [
'.dynamic-image{width: 100%; height: fit-content}',
'.static-image{ width: 100%; height: 100%; object-fit: contain}'
]
})
export class ButtonComponent extends ElementComponent {
@Output() onFocusin = new EventEmitter();
......
......@@ -9,12 +9,14 @@ import { ImageElement } from '../models/image-element';
[style.height.%]="100"
[style.width.%]="100">
<img [src]="elementModel.src | safeResourceUrl"
alt="Image Placeholder"
[style.object-fit]="'contain'"
[style.height.%]="100"
[style.width.%]="100">
[alt]="'imageNotFound' | translate"
[class]="elementModel.dynamicPositioning? 'dynamic-image' : 'static-image'">
</div>
`
`,
styles: [
'.dynamic-image{width: 100%; height: fit-content}',
'.static-image{ width: 100%; height: 100%; object-fit: contain}'
]
})
export class ImageComponent extends ElementComponent {
elementModel!: ImageElement;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment