1
- import { Box , Image , Text } from 'theme-ui'
1
+ import { Box , Grid , Image , Text } from 'theme-ui'
2
2
import { VisibilityContext } from 'react-horizontal-scrolling-menu'
3
3
import { useContext } from 'react'
4
4
5
5
export default function Project ( { title, description, color, img, itemId } ) {
6
6
const visible = useContext ( VisibilityContext )
7
7
const isVisible = visible . isItemVisible ( itemId )
8
8
9
- console . log ( itemId )
10
-
11
9
return (
12
- < Box
10
+ < Grid
13
11
sx = { {
14
- display : 'grid' ,
15
12
borderRadius : 12 ,
13
+ gridTemplateColumns : 'auto ' ,
16
14
my : '2rem' ,
17
15
backgroundImage : t =>
18
16
`linear-gradient(to bottom, ${ color [ 0 ] } , ${ color [ 1 ] } )` ,
@@ -23,17 +21,19 @@ export default function Project({ title, description, color, img, itemId }) {
23
21
transition : '700ms cubic-bezier(0.075, 0.02, 0.165, 1)' ,
24
22
transformOrigin : 'center' ,
25
23
mx : 16 ,
26
- ml : `${ itemId === 0 && 'calc(50vw - 35rem )' } `
24
+ ml : `${ itemId === 0 && 'calc(50vw - 36rem )' } `
27
25
} }
28
26
itemId = { itemId }
29
27
>
30
28
< Box
31
29
sx = { {
32
30
paddingX : '16px' ,
33
- marginTop : [ '6.25rem' , '12.5rem' ] ,
34
31
display : 'flex' ,
35
32
flexDirection : 'column' ,
36
- alignItems : 'center'
33
+ placeItems : 'center' ,
34
+ height : [ '12.5rem' , '20rem' ] ,
35
+ placeSelf : 'center' ,
36
+ placeContent : 'end' ,
37
37
} }
38
38
>
39
39
< Text
@@ -60,9 +60,9 @@ export default function Project({ title, description, color, img, itemId }) {
60
60
sx = { {
61
61
visibility : [ 'hidden' , 'visible' ] ,
62
62
height : '100%' ,
63
- objectFit : 'cover'
63
+ objectFit : 'cover' ,
64
64
} }
65
65
/>
66
- </ Box >
66
+ </ Grid >
67
67
)
68
68
}
0 commit comments