diff --git a/src/app/features/spaces/contents/shared/asset-select/asset-select.component.html b/src/app/features/spaces/contents/shared/asset-select/asset-select.component.html index d49b9f6b..abc633ff 100644 --- a/src/app/features/spaces/contents/shared/asset-select/asset-select.component.html +++ b/src/app/features/spaces/contents/shared/asset-select/asset-select.component.html @@ -24,7 +24,7 @@ @if (asset.type.startsWith('image/')) { ) { - console.log('ImagePreviewDirective', hostElement.nativeElement); + scale = input(2, { alias: 'llImagePreview' }); + + constructor(private hostElement: ElementRef) {} + + @HostListener('mouseover') + public onMouseOver() { + if (this.hostElement.nativeElement.parentElement) { + this.hostElement.nativeElement.parentElement.style.overflow = 'visible'; + } + this.hostElement.nativeElement.style.zIndex = '50'; + this.hostElement.nativeElement.style.transform = `scale(${this.scale() || 2})`; + this.hostElement.nativeElement.style.transition = 'transform 0.3s ease-in-out'; } - @HostListener('mouseover', ['$event']) - public onMouseOver(event: MouseEvent) { - const img = event.target as HTMLImageElement; - console.log('mouseover', event); - console.log('mouseover', img.srcset); + @HostListener('mouseout') + public onMouseOut() { + this.hostElement.nativeElement.style.transform = 'scale(1)'; + this.hostElement.nativeElement.style.zIndex = ''; + setTimeout(() => { + if (this.hostElement.nativeElement.parentElement) { + this.hostElement.nativeElement.style.transform = ''; + this.hostElement.nativeElement.style.transition = ''; + this.hostElement.nativeElement.parentElement.style.overflow = ''; + } + }, 400); } }