11use crate :: components:: { button_link:: ButtonLink , cards:: card_title:: CardTitle , icons:: GithubIcon } ;
2- use leptos:: { component, prelude:: * , view, IntoView } ;
2+ use leptos:: { component, leptos_dom :: helpers :: window , prelude:: * , view, IntoView } ;
33use std:: collections:: HashMap ;
4- use leptos:: leptos_dom:: helpers:: window;
54
65#[ component]
76pub fn ProjectCard (
@@ -25,37 +24,43 @@ pub fn ProjectCard(
2524
2625 view ! {
2726 <div class="group flex flex-col items-center sm:items-stretch gap-y-6 border border-black p-4 sm:p-6 hover:bg-orange-500 dark:hover:bg-zinc-900/40 bg-orange-100 dark:bg-black/40 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] transition justify-between" >
28- <button on: click=move |_| {
29- let win = window( ) ;
30- win. open_with_url_and_target( link, "_blank" ) . unwrap( ) ;
31- } class="all-[unset] w-full cursor-pointer text-left flex items-stretch flex-col h-full justify-between " >
27+ <button
28+ on: click=move |_| {
29+ let win = window( ) ;
30+ win. open_with_url_and_target( link, "_blank" ) . unwrap( ) ;
31+ }
32+ class="all-[unset] w-full cursor-pointer text-left flex items-stretch flex-col h-full justify-between "
33+ >
3234 <div class="flex flex-col justify-between gap-y-2" >
33- <Show
34- when=move || { brand_as_letter }
35+ <Show
36+ when=move || { brand_as_letter }
3537 fallback={
3638 let color = current_color. clone( ) ;
3739 let src = brand_src. clone( ) ;
38- move || view!{
39- <img
40- src=src. clone( )
41- loading="lazy"
42- width="60"
43- class=format!( "rounded-full h-[60px] w-[60px] {color}" )
44- alt=name. join( " " )
45- />
40+ move || {
41+ view! {
42+ <img
43+ src=src. clone( )
44+ loading="lazy"
45+ width="60"
46+ class=format!( "rounded-full h-[60px] w-[60px] {color}" )
47+ alt=name. join( " " )
48+ />
49+ }
4650 }
4751 }
4852 >
49- <span class=format!( "h-[60px] w-[60px] rounded-full text-4xl flex justify-center items-center {current_color}" ) >
50- { brand_src. clone( ) }
51- </span>
52- </Show > <CardTitle texts=name />
53+ <span class=format!(
54+ "h-[60px] w-[60px] rounded-full text-4xl flex justify-center items-center {current_color}" ,
55+ ) >{ brand_src. clone( ) } </span>
56+ </Show >
57+ <CardTitle texts=name />
5358 <p class="mt-2 font-work-sans text-black dark:text-white" >{ description} </p>
5459 </div>
5560 <div class="flex gap-4 sm:gap-0 justify-around items-center mt-4" >
5661 <ButtonLink href=button_link size="tiny" >
57- <Show
58- when=move || { !button_text. is_empty( ) }
62+ <Show
63+ when=move || { !button_text. is_empty( ) }
5964 fallback=move || name. join( " " )
6065 >
6166 <span>{ button_text} </span>
0 commit comments