working(ish) upload
This commit is contained in:
23
src/components/progress/component.rs
Normal file
23
src/components/progress/component.rs
Normal file
@ -0,0 +1,23 @@
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_primitives::progress::{self, ProgressIndicatorProps, ProgressProps};
|
||||
|
||||
#[component]
|
||||
pub fn Progress(props: ProgressProps) -> Element {
|
||||
rsx! {
|
||||
document::Link { rel: "stylesheet", href: asset!("./style.css") }
|
||||
progress::Progress {
|
||||
class: "progress",
|
||||
value: props.value,
|
||||
max: props.max,
|
||||
attributes: props.attributes,
|
||||
{props.children}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn ProgressIndicator(props: ProgressIndicatorProps) -> Element {
|
||||
rsx! {
|
||||
progress::ProgressIndicator { class: "progress-indicator", attributes: props.attributes, {props.children} }
|
||||
}
|
||||
}
|
||||
2
src/components/progress/mod.rs
Normal file
2
src/components/progress/mod.rs
Normal file
@ -0,0 +1,2 @@
|
||||
mod component;
|
||||
pub use component::*;
|
||||
31
src/components/progress/style.css
Normal file
31
src/components/progress/style.css
Normal file
@ -0,0 +1,31 @@
|
||||
.progress {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 200px;
|
||||
height: .5rem;
|
||||
box-sizing: border-box;
|
||||
border-radius: 9999px;
|
||||
background: var(--primary-color-5);
|
||||
}
|
||||
|
||||
.progress[data-state='indeterminate'] .progress-indicator {
|
||||
width: 50%;
|
||||
animation: indeterminate 1s infinite linear;
|
||||
}
|
||||
|
||||
.progress-indicator {
|
||||
width: var(--progress-value, 0%);
|
||||
height: 100%;
|
||||
background-color: var(--secondary-color-1);
|
||||
transition: width 250ms ease;
|
||||
}
|
||||
|
||||
@keyframes indeterminate {
|
||||
0% {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateX(200%);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user