@@ -2,30 +2,41 @@ import Image from 'next/image'
2
2
3
3
import LinkButton from '../components/linkbutton'
4
4
5
- const ProjectSummary = ( { title= "title" , text= [ "text" ] , liveLink, repoLink, imageSource} ) => {
6
- for ( let line = 0 ; line < text . length ; line ++ ) {
7
- text [ line ] = < p key = { line } > { text [ line ] } </ p > ;
8
- }
9
- if ( liveLink ) {
10
- liveLink = < LinkButton href = { liveLink } text = "See live" target = "_blank" />
11
- }
12
- if ( repoLink ) {
13
- repoLink = < LinkButton href = { repoLink } text = "Git Repo" target = "_blank" inverted = { true } />
5
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
6
+ import { faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons'
7
+
8
+ const ProjectSummary = ( props ) => {
9
+ const text = [ ]
10
+ for ( let line = 0 ; line < props . text . length ; line ++ ) {
11
+ text . push ( < p key = { line } > { props . text [ line ] } </ p > ) ;
14
12
}
15
- if ( imageSource ) {
16
- imageSource = < img className = "object-cover object-top aspect-[4/3] absolute top-[4%] left-[11.5%] w-[77%] h-[86%]" src = { imageSource } > </ img >
13
+ let liveLinkButton ;
14
+ if ( props . liveLink ) liveLinkButton = < LinkButton href = { props . liveLink } text = "See live" target = "_blank" /> ;
15
+ let repoLinkButton ;
16
+ if ( props . repoLink ) repoLinkButton = < LinkButton href = { props . repoLink } text = "Git Repo" target = "_blank" inverted = { true } /> ;
17
+ let image ;
18
+ if ( props . imageSource ) {
19
+ image = < img className = "absolute" src = { props . imageSource } > </ img >
17
20
}
18
21
return (
19
22
< div className = "grid gap-8 md:grid-cols-[1.5fr,1fr] items-center" >
20
23
< div className = "relative" >
21
24
< img className = "w-full" src = "laptop.svg" > </ img >
22
- { imageSource }
25
+ < div className = "absolute top-[4%] left-[11.5%] w-[77%] h-[86%] overflow-hidden" >
26
+ { image }
27
+ < a className = "w-full h-full absolute uppercase text-center transition-opacity duration-300 opacity-0 hover:opacity-100 backdrop-blur-sm backdrop-brightness-50 flex justify-center items-center"
28
+ href = { props . liveLink ? props . liveLink : props . repoLink } target = "_blank" >
29
+ < div className = "bg-white border-2 border-neutral-600 rounded-full w-12 h-12 text-base flex justify-center items-center" >
30
+ < FontAwesomeIcon icon = { faArrowUpRightFromSquare } />
31
+ </ div >
32
+ </ a >
33
+ </ div >
23
34
</ div >
24
35
< div className = "flex flex-col items-center md:items-start gap-4" >
25
- < h2 className = "font-bold text-3xl" > { title } </ h2 >
36
+ < h2 className = "font-bold text-3xl" > { props . title } </ h2 >
26
37
{ text }
27
- { liveLink }
28
- { repoLink }
38
+ { liveLinkButton }
39
+ { repoLinkButton }
29
40
</ div >
30
41
</ div >
31
42
)
0 commit comments