zuicon_mdl2/
coffee_script.rs1use yew::prelude::{html, Component, Context, Html, Properties};
8
9pub struct CoffeeScript {}
10
11#[derive(Properties, Debug, Clone, PartialEq, Eq)]
12pub struct Props {
13 #[prop_or_default]
14 pub class: Option<&'static str>,
15
16 #[prop_or_default]
17 pub width: Option<&'static str>,
18
19 #[prop_or_default]
20 pub height: Option<&'static str>,
21
22 #[prop_or_default]
23 pub color: Option<&'static str>,
24
25 #[prop_or_default]
26 pub fill: Option<&'static str>,
27
28 #[prop_or_default]
29 pub spin: bool,
30
31 #[prop_or_default]
32 pub rotate: i16,
33}
34
35impl Component for CoffeeScript {
36 type Properties = Props;
37 type Message = ();
38
39 fn create(_ctx: &Context<Self>) -> Self {
40 Self {}
41 }
42
43 fn view(&self, ctx: &Context<Self>) -> Html {
44 let props = ctx.props();
45 let mut style = String::new();
47 if props.rotate != 0 {
48 style += &format!("transform: rotate({}deg);", props.rotate);
49 }
50 html! {
51 <svg
52 xmlns={ "http://www.w3.org/2000/svg" }
53 class={ props.class.unwrap_or("") }
54 width={ props.width.unwrap_or("16") }
55 height={ props.height.unwrap_or("16") }
56 focusable={ "false" }
57 data-icon={ "CoffeeScript" }
58 viewBox={ "0 0 16 16" }
59 fill={ props.fill.unwrap_or("currentColor") }
60 style={ style }
61 >
62 <path d="M576 544q-26 0-45-19t-19-45q0-23-14-41t-33-30q-35-24-71-48t-68-52-50-65-20-84q0-26 19-45t45-19q26 0 45 19t19 45q0 23 14 41t33 30q34 24 71 48t68 52 50 65 20 84q0 26-19 45t-45 19zm448 0q-26 0-45-19t-19-45q0-23-14-41t-33-30q-35-24-71-48t-68-52-50-65-20-84q0-26 19-45t45-19q26 0 45 19t19 45q0 23 14 41t33 30q34 24 71 48t68 52 50 65 20 84q0 26-19 45t-45 19zm448 0q-26 0-45-19t-19-45q0-23-14-41t-33-30q-35-24-71-48t-68-52-50-65-20-84q0-26 19-45t45-19q26 0 45 19t19 45q0 23 14 41t33 30q34 24 71 48t68 52 50 65 20 84q0 26-19 45t-45 19zm133 736q-33 75-82 138t-110 118h443v128q0 45-14 90t-40 82-65 60-89 24H208q-50 0-88-23t-65-60-41-82-14-91v-128h379q-118-103-184-239t-67-294V640h1605q66 0 123 25t100 69 67 102 25 124q0 65-24 123t-67 102-100 69-124 26h-128zm59-512q0 42 1 84t1 85q0 55-3 109t-16 106h86q39 0 73-15t60-42 39-61 15-74q0-39-14-74t-40-61-59-41-74-16h-69zM256 1003q0 88 26 169t75 150 114 123 145 91h560q79-36 145-90t114-124 74-150 27-169V768H256v235zm1392 789q21 0 36-14t25-33 14-42 5-39H128q0 17 4 39t15 41 25 34 36 14h1440z" />
63 </svg>
64 }
65 }
66}