From 759e4457bb8a63906c179ba88db5a9e1416edd18 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 7 Aug 2023 09:17:40 -0700 Subject: [PATCH] fix: fixed some css and urls --- web/src/components/post/cardGrid.module.css | 5 ++-- web/src/components/post/cardGrid.tsx | 6 +++-- web/src/data/projectPosts.json | 26 ++------------------- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/web/src/components/post/cardGrid.module.css b/web/src/components/post/cardGrid.module.css index 430e7f9..de3bd27 100644 --- a/web/src/components/post/cardGrid.module.css +++ b/web/src/components/post/cardGrid.module.css @@ -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 { diff --git a/web/src/components/post/cardGrid.tsx b/web/src/components/post/cardGrid.tsx index f8c7b07..95b5dd7 100644 --- a/web/src/components/post/cardGrid.tsx +++ b/web/src/components/post/cardGrid.tsx @@ -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( diff --git a/web/src/data/projectPosts.json b/web/src/data/projectPosts.json index 750ae5f..0ed4c39 100644 --- a/web/src/data/projectPosts.json +++ b/web/src/data/projectPosts.json @@ -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, @@ -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" } ]