Skip to content

Commit

Permalink
Comet loader (#1722)
Browse files Browse the repository at this point in the history
  • Loading branch information
InfamousVague authored Jan 16, 2024
1 parent 2b678b9 commit 6b68d8e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kit/src/elements/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ use dioxus::prelude::*;
pub struct Props {
#[props(optional)]
spinning: Option<bool>,
#[props(optional)]
large: Option<bool>,
}

pub fn is_large(cx: &Scope<Props>) -> bool {
if let Some(f) = cx.props.large.as_ref() {
return *f;
}
false
}

#[allow(non_snake_case)]
pub fn Loader(cx: Scope<Props>) -> Element {
cx.render(rsx!(
div {
class: "loader",
class: if is_large(&cx) { "loader large" } else { "loader" },
div {
class: "spin",
IconElement { icon: Icon::Loader }
Expand Down
18 changes: 18 additions & 0 deletions kit/src/elements/loader/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
fill: transparent;
stroke: var(--text-color);
}

&.large {
width: 60px;
height: 60px;

.spin {
width: 60px;
height: 60px;
top: 30px;
left: 30px;
}

svg {
height: 60px;
width: 60px;
stroke-width: 0.02rem;
}
}
}

@keyframes spin {
Expand Down

0 comments on commit 6b68d8e

Please sign in to comment.