Skip to content

Commit

Permalink
fix: fixed some css and urls
Browse files Browse the repository at this point in the history
  • Loading branch information
lukexor committed Aug 7, 2023
1 parent f5b303d commit 759e445
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 28 deletions.
5 changes: 3 additions & 2 deletions web/src/components/post/cardGrid.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

.cardGrid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 20%));
grid-template-columns: repeat(auto-fit, 300px);
justify-content: center;
margin: 50px 50px;
width: 100%;
padding: 15px;
}

.cardGrid a {
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/post/cardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ type CardGridProps = {

export const getCardsPerRow = (): number => {
const sectionWidth =
document.querySelector("[data-type=grid]")?.clientWidth ?? 1;
document.querySelector("[data-type=grid]")?.clientWidth ?? 300;
const cardWidth =
document.querySelector("[data-type=card]")?.clientWidth ?? 300;
return Math.max(1, Math.floor(sectionWidth / cardWidth));
console.log(sectionWidth, cardWidth);
console.log(Math.max(1, Math.floor((sectionWidth - 30) / cardWidth)));
return Math.max(1, Math.floor((sectionWidth - 30) / cardWidth));
};

const Card = forwardRef(function Card(
Expand Down
26 changes: 2 additions & 24 deletions web/src/data/projectPosts.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@
"src": "/images/projects/umflint_env_club.webp",
"alt": "UM-Flint Environmental Science Club Website"
},
"website": "https://umflint-env.lukeworks.tech/",
"_website": "https://umflint-env.lukeworks.tech/",
"website": "",
"category": "",
"tags": [],
"minutesToRead": 0,
Expand Down Expand Up @@ -318,28 +319,5 @@
"publishedOn": "2019-08-21 16:09:16.000000",
"createdOn": "2017-03-27 01:06:07.000000",
"updatedOn": "2017-07-13 17:44:30.000000"
},
{
"id": 11,
"name": "mindyou",
"title": "MindYou",
"thumbnail": {
"src": "/images/projects/mindyou_main.webp",
"alt": "MindYou Screenshot"
},
"image": {
"src": "/images/projects/mindyou_main.webp",
"alt": "MindYou Screenshot"
},
"website": "https://mindyou.me/",
"category": "",
"tags": [],
"minutesToRead": 0,
"likes": 0,
"startedOn": "2014-11-18 21:24:18.000000",
"completedOn": null,
"publishedOn": null,
"createdOn": "2014-11-18 21:24:20.000000",
"updatedOn": "2017-05-06 03:00:27.000000"
}
]

1 comment on commit 759e445

@vercel
Copy link

@vercel vercel bot commented on 759e445 Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.