fix: restore Trunk link tag for Cargo.toml to resolve SyntaxError in browser
Some checks failed
Build MIPS Binary / build (push) Has been cancelled
Some checks failed
Build MIPS Binary / build (push) Has been cancelled
This commit is contained in:
26
frontend/src/components/ui/progress.rs
Normal file
26
frontend/src/components/ui/progress.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use leptos::prelude::*;
|
||||
use tailwind_fuse::tw_merge;
|
||||
|
||||
#[component]
|
||||
pub fn Progress(
|
||||
#[prop(into)] value: Signal<f64>,
|
||||
#[prop(optional, into)] class: String,
|
||||
) -> impl IntoView {
|
||||
let progress_style = move || format!("transform: translateX(-{}%);", 100.0 - value.get().clamp(0.0, 100.0));
|
||||
|
||||
view! {
|
||||
<div
|
||||
data-name="Progress"
|
||||
class=tw_merge!(
|
||||
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
||||
class
|
||||
)
|
||||
>
|
||||
<div
|
||||
data-name="ProgressIndicator"
|
||||
class="h-full w-full flex-1 bg-primary transition-all duration-500 ease-in-out"
|
||||
style=progress_style
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user