21 lines
604 B
Plaintext
21 lines
604 B
Plaintext
@inject IJSRuntime JS
|
|
|
|
<div @ref="ElementRef" class="@CssClass">
|
|
@ChildContent
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] public string CssClass { get; set; } = "animate__animated animate__fadeIn";
|
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
|
|
|
private ElementReference ElementRef;
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
{
|
|
if (ElementRef.Context is not null)
|
|
{
|
|
await Task.Delay(50); // wait for DOM to settle
|
|
await JS.InvokeVoidAsync("seemgenAnimationHelper.restartAnimation", ElementRef);
|
|
}
|
|
}
|
|
} |