mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-25 16:29:49 -04:00
36 lines
816 B
TypeScript
36 lines
816 B
TypeScript
import { EventEmitter, Component, Input, Output, ElementRef } from "@angular/core";
|
|
import { CardItem } from "../../pages/search/search";
|
|
|
|
@Component({
|
|
selector: "error",
|
|
templateUrl: "error.html"
|
|
})
|
|
export class Error
|
|
{
|
|
@Output()
|
|
onClose = new EventEmitter<CardItem>();
|
|
|
|
@Input()
|
|
cardItem: CardItem;
|
|
|
|
constructor(private elementRef: ElementRef)
|
|
{
|
|
}
|
|
|
|
close()
|
|
{
|
|
let d = 275;
|
|
this.elementRef.nativeElement.parentElement.animate({
|
|
transform: ['none', 'translate3d(110%, 0, 0)']
|
|
}, {
|
|
fill: 'forwards',
|
|
duration: d,
|
|
iterations: 1,
|
|
easing: 'ease-in-out',
|
|
});
|
|
setTimeout(() =>
|
|
{
|
|
this.onClose.emit(this.cardItem);
|
|
}, d);
|
|
}
|
|
} |