💄 Add Wallpaper, Spinner and LoadingPage widgets

This commit is contained in:
2024-02-29 23:47:32 +01:00
parent 5719cb8254
commit 5e05b75bde
7 changed files with 203 additions and 0 deletions

38
src/components/spinner.rs Normal file
View File

@@ -0,0 +1,38 @@
use dioxus::prelude::*;
use dioxus_free_icons::{Icon, IconShape};
turf::style_sheet!("src/components/spinner.scss");
#[derive(Copy, Clone, Debug)]
struct _Spinner;
impl IconShape for _Spinner {
fn view_box(&self) -> String {
String::from("0 0 184 94")
}
fn xmlns(&self) -> String {
String::from("http://www.w3.org/2000/svg")
}
fn child_elements(&self) -> LazyNodes {
rsx! {
path {
"stroke-linejoin": "round",
"stroke-width": "6",
d: "M121.208 2 2 57.011l70.927-.265L61.363 92 182 36.724h-69.498L121.208 2Z"
}
}
}
}
#[component]
pub fn Spinner(cx: Scope) -> Element {
cx.render(rsx! {
style { STYLE_SHEET },
div {
class: ClassName::ROOT,
Icon {
icon: _Spinner,
}
}
})
}