Skip to content

Commit f53243e

Browse files
Merge pull request #269 from Parcels-code/update_projects
Update projects cards
2 parents f6bd6a5 + 754cc7c commit f53243e

File tree

5 files changed

+63
-17
lines changed

5 files changed

+63
-17
lines changed

public/projects/LOCATE_logo.png

288 KB
Loading

public/projects/pyplume_logo.png

261 KB
Loading

src/components/project-card.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const ProjectCard = ({
1515
as={Link}
1616
href={repo || homepage}
1717
p={4}
18+
h='full'
1819
rounded='lg'
1920
transitionProperty='all'
2021
transitionDuration='slower'
@@ -27,11 +28,12 @@ export const ProjectCard = ({
2728
textDecoration: 'none',
2829
}}
2930
>
30-
<CardBody p={0}>
31+
<CardBody p={0} h='full'>
3132
<Stack
3233
spacing={2}
3334
direction={'column'}
3435
justify={'space-between'}
36+
h='full'
3537
gap={0}
3638
>
3739
<Box>

src/components/projects.js

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Container, SimpleGrid, Text } from '@chakra-ui/react'
1+
import { Box, Container, Grid, GridItem, Text } from '@chakra-ui/react'
22
import React from 'react'
33

44
import { Heading } from '@/components/mdx'
@@ -7,6 +7,23 @@ import { Projects as ProjectsData } from '@/data/projects'
77

88
export const Projects = () => {
99
const projects = React.useMemo(() => ProjectsData, [])
10+
const projectsPerRowLg = 3
11+
const remainderLg = projects.length % projectsPerRowLg
12+
const lastRowStartIndexLg = projects.length - remainderLg
13+
14+
const getLgColStart = (index) => {
15+
if (remainderLg === 1 && index === lastRowStartIndexLg) {
16+
return 3
17+
}
18+
19+
if (remainderLg === 2) {
20+
if (index === lastRowStartIndexLg) return 2
21+
if (index === lastRowStartIndexLg + 1) return 4
22+
}
23+
24+
return undefined
25+
}
26+
1027
return (
1128
<Box id={'projects'} as='section'>
1229
<Container maxW='container.lg' centerContent>
@@ -20,24 +37,35 @@ export const Projects = () => {
2037
developed with Parcels.
2138
</Text>
2239

23-
<SimpleGrid
40+
<Grid
2441
my={8}
25-
columns={{ base: 1, md: 2, lg: 3 }}
26-
spacing={8}
27-
justifyContent={'space-between'}
42+
templateColumns={{
43+
base: 'repeat(1, minmax(0, 1fr))',
44+
md: 'repeat(2, minmax(0, 1fr))',
45+
lg: 'repeat(6, minmax(0, 1fr))',
46+
}}
47+
gap={8}
48+
w='full'
49+
alignItems='stretch'
2850
>
2951
{projects.map((project, index) => (
30-
<ProjectCard
52+
<GridItem
3153
key={index}
32-
name={project.name}
33-
logo_light={project.logo_light}
34-
logo_dark={project.logo_dark}
35-
description={project.description}
36-
repo={project.repo}
37-
homepage={project.homepage}
38-
></ProjectCard>
54+
colSpan={{ base: 1, md: 1, lg: 2 }}
55+
colStart={{ lg: getLgColStart(index) }}
56+
h='full'
57+
>
58+
<ProjectCard
59+
name={project.name}
60+
logo_light={project.logo_light}
61+
logo_dark={project.logo_dark}
62+
description={project.description}
63+
repo={project.repo}
64+
homepage={project.homepage}
65+
></ProjectCard>
66+
</GridItem>
3967
))}
40-
</SimpleGrid>
68+
</Grid>
4169
</Box>
4270
</Container>
4371
</Box>

src/data/projects.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const Projects = [
22
{
33
name: 'PlasticParcels',
44
description:
5-
'PlasticParcels is a Python package to simulate the transport and dispersion of plastics in the ocean.',
5+
'PlasticParcels simulates the transport and dispersion of plastics in the ocean.',
66
repo: 'https://github.com/OceanParcels/plasticparcels',
77
homepage: 'https://plastic.parcels-code.org/en/latest/',
88
logo_light: '/projects/plasticparcelslogo.png',
@@ -28,9 +28,25 @@ export const Projects = [
2828
{
2929
name: 'VirtualFleet',
3030
description:
31-
'Virtual Fleet is a Python tool that simulates Argo floats trajectories and measurement.',
31+
'Virtual Fleet simulates Argo floats trajectories and measurement.',
3232
homepage: 'https://github.com/euroargodev/VirtualFleet',
3333
logo_light: '/projects/virtualfleet_logo.png',
3434
logo_dark: '/projects/virtualfleet_logo_dia.png',
3535
},
36+
{
37+
name: 'LOCATE',
38+
description:
39+
'LOCATE simulates plastic particle dispersion in nearshore water.',
40+
homepage: 'https://github.com/UPC-LOCATE/LOCATE',
41+
logo_light: '/projects/LOCATE_logo.png',
42+
logo_dark: '/projects/LOCATE_logo.png',
43+
},
44+
{
45+
name: 'PyPlume',
46+
description:
47+
'PyPlume unifies simulating, analyzing and visualizing particle trajectories.',
48+
homepage: 'https://github.com/jerukan/PyPlume',
49+
logo_light: '/projects/pyplume_logo.png',
50+
logo_dark: '/projects/pyplume_logo.png',
51+
},
3652
]

0 commit comments

Comments
 (0)