-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathReadingIndicator.razor
More file actions
25 lines (20 loc) · 804 Bytes
/
Copy pathReadingIndicator.razor
File metadata and controls
25 lines (20 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@inject IJSRuntime JSRuntime
<div class="progress-container" @ref="progressContainer">
<svg class="progress-circle" viewBox="0 0 36 36">
<circle class="progress-bg" cx="18" cy="18" r="15.91549431" />
<circle class="progress-bar" id="progressBar" cx="18" cy="18" r="15.91549431" />
</svg>
</div>
@code {
[Parameter, EditorRequired]
public required string ContainerCssSelector { get; set; }
private ElementReference progressContainer;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await using var _ = await JSRuntime.InvokeAsync<IJSObjectReference>("import", "./Features/ShowBlogPost/Components/ReadingIndicator.razor.js");
await JSRuntime.InvokeVoidAsync("initCircularReadingProgress", ContainerCssSelector, progressContainer);
}
}
}