-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7379983
commit 3214a3b
Showing
2 changed files
with
18 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
--- | ||
import MainLayout from "../layouts/MainLayout.astro"; | ||
import ProjectCard from "../components/ProjectCard.astro"; | ||
const pageTitle = "Projects"; | ||
const allProjects = await Astro.glob("../pages/projects/*.mdx"); | ||
const cardStyles = [ | ||
'col-span-2 row-span-1', | ||
'col-span-2 row-span-1', | ||
'col-span-1 row-span-4', | ||
'col-span-2 row-span-2', | ||
'col-span-1 row-span-2', | ||
'col-span-3 row-span-2' | ||
]; | ||
--- | ||
|
||
<div class="flex items-center justify-center w-full h-full"> | ||
<div | ||
class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6 min-h-screen" id="projects" | ||
class="grid grid-cols-4 grid-rows-4 gap-4 p-2 rounded-lg shadow-lg max-h-full" id="projects" | ||
> | ||
{ | ||
allProjects | ||
.filter((project) => project.frontmatter.isPrivate === false) | ||
.map((project) => { | ||
.map((project, index) => { | ||
const projectSlug = project.url.split("/").pop().replace(".md", ""); | ||
const styleIndex = index % cardStyles.length; // Ensure we loop through styles if there are more projects than styles | ||
return ( | ||
<ProjectCard | ||
projectTitle={project.frontmatter.projectTitle} | ||
projectLogo={project.frontmatter.projectLogo} | ||
repositoryLinks={project.frontmatter.repositoryLinks} | ||
projectSlug={projectSlug} | ||
technologiesList={project.frontmatter.technologiesList} | ||
className={cardStyles[styleIndex]} // Apply a different style to each card | ||
/> | ||
); | ||
}) | ||
} | ||
</div> | ||
</div> |