feat: add basic project card

finxol.io 6d62d0fe e2461898

verified
Changed files
+224 -29
src
src/assets/img/karr_demo.jpg

This is a binary file and will not be displayed.

src/assets/img/karr_demo.webp

This is a binary file and will not be displayed.

+117 -2
src/assets/styles/index.css
···
grid-template-areas:
"content-intro content-intro"
"content-languages content-blog"
+
"title-projects title-projects"
"content-projects content-projects";
gap: var(--spacing);
}
+
section.title-projects {
+
grid-area: title-projects;
+
display: flex;
+
flex-direction: row;
+
align-items: center;
+
justify-content: start;
+
gap: 1rem;
+
margin-inline: calc(var(--spacing) * 2);
+
margin-block: calc(var(--spacing) * 3) calc(var(--spacing) * 2);
+
+
@media screen and (max-width: 768px) {
+
flex-direction: column;
+
}
+
+
& > * {
+
margin: 0;
+
}
+
+
& > aside {
+
grid-area: aside;
+
margin-inline: 1.5rem;
+
font-size: 3rem;
+
font-weight: bold;
+
+
@media screen and (max-width: 768px) {
+
font-size: 2rem;
+
margin-inline: 0.5rem;
+
}
+
}
+
+
& > h3 {
+
grid-area: h3;
+
margin: 0;
+
margin-inline-end: 2rem;
+
font-family: "Spagetty";
+
font-size: 2rem;
+
font-weight: bold;
+
}
+
+
& > p {
+
grid-area: intro;
+
margin: 0;
+
font-size: 1.2rem;
+
}
+
}
+
section.container {
&.content-intro {
--container-color: var(--rose-400);
···
}
section.container.content-projects {
-
--container-color: var(--rose-100);
+
display: grid;
+
grid-template-columns: repeat(2, 1fr);
+
grid-template-rows: auto;
+
grid-gap: var(--spacing);
+
background-color: transparent;
+
+
@media screen and (max-width: 768px) {
+
grid-template-columns: 1fr;
+
grid-template-rows: repeat(2, 1fr);
+
}
-
& > div {
+
.project {
display: grid;
+
grid-template-areas:
+
"img img"
+
"title title"
+
"tags tags"
+
"description description";
+
grid-template-columns: 1fr auto;
+
grid-template-rows: repeat(5, auto);
+
grid-gap: var(--spacing);
+
+
overflow: hidden;
+
border-radius: var(--radius);
+
background-color: var(--teal-300);
+
+
a {
+
text-decoration: none;
+
}
+
+
& > :not(picture) {
+
margin: 0 var(--spacing);
+
padding: 0;
+
}
+
+
& > picture {
+
grid-area: img;
+
+
width: 100%;
+
}
+
+
& > h3 {
+
grid-area: title;
+
+
font-size: 2rem;
+
}
+
+
& > ul {
+
grid-area: tags;
+
+
list-style-type: none;
+
display: flex;
+
flex-wrap: wrap;
+
justify-content: flex-start;
+
gap: calc(var(--spacing) * 0.4);
+
margin-top: -1rem;
+
+
& > li {
+
display: inline-block;
+
padding: 0.25rem 1rem;
+
border-radius: 100vw;
+
background-color: var(--teal-500);
+
color: var(--teal-100);
+
font-weight: lighter;
+
font-size: 0.8rem;
+
letter-spacing: 0.02em;
+
}
+
}
+
+
& > p {
+
grid-area: description;
+
}
}
}
+53 -13
src/pages/en/index.astro
···
import Layout from "@/layouts/Layout.astro";
import "@/assets/styles/index.css";
import { Icon } from "astro-icon/components";
+
+
import karrJpg from "@/assets/img/karr_demo.jpg";
+
import karrWebp from "@/assets/img/karr_demo.webp";
+
+
const projects = [
+
{
+
name: "Karr",
+
slug: "karr",
+
description: "Federated carpool platform for businesses",
+
imgs: {
+
jpg: karrJpg,
+
webp: karrWebp,
+
},
+
tags: ["Next.js", "Hono", "OpenAuth", "CI"],
+
},
+
];
---
-
<Layout subtitle="Computer Science Student">
+
<Layout>
<article>
<section class="container layout content-intro">
<aside>👋</aside>
···
</a>
</section>
-
<section class="container layout content-projects">
+
<section class="title-projects">
<aside>💻</aside>
-
<h3>Projets</h3>
-
<div>
-
<p>
-
I'm currently working on Karr, a federated carpooling
-
platform for businesses. You can find my other most
-
interesting projects just next door. I regularly take part
-
in CTFs and other cybersecurity events & conferences. Feel
-
free to use my contact details if you wish to get in touch.
-
I also love playing the drums and all sorts of instruments.
-
</p>
-
</div>
+
<h3>Projects</h3>
+
<p>
+
Here are my most interesting projects. Click through to get more
+
details!
+
</p>
+
</section>
+
+
<section class="container content-projects">
+
{
+
projects.map((project) => (
+
<div class="project">
+
<picture style="view-transition-name: karr-img">
+
<source
+
srcset={project.imgs.webp.src}
+
type="image/webp"
+
/>
+
<img
+
src={project.imgs.jpg.src}
+
alt={project.name}
+
/>
+
</picture>
+
<h3>
+
<a href={`/projects/${project.slug}`}>
+
{project.name}
+
</a>
+
</h3>
+
<p>{project.description}</p>
+
<ul>
+
{project.tags.map((tag: string) => (
+
<li class="tag">{tag}</li>
+
))}
+
</ul>
+
</div>
+
))
+
}
</section>
</article>
</Layout>
+54 -14
src/pages/fr/index.astro
···
import Layout from "@/layouts/Layout.astro";
import "@/assets/styles/index.css";
import { Icon } from "astro-icon/components";
+
+
import karrJpg from "@/assets/img/karr_demo.jpg";
+
import karrWebp from "@/assets/img/karr_demo.webp";
+
+
const projects = [
+
{
+
name: "Karr",
+
slug: "karr",
+
description: "Plateforme de covoiturage fédérée",
+
imgs: {
+
jpg: karrJpg,
+
webp: karrWebp,
+
},
+
tags: ["Next.js", "Hono", "OpenAuth", "CI"],
+
},
+
];
---
-
<Layout subtitle="Étudiant M1 Informatique">
+
<Layout>
<article>
<section class="container layout content-intro">
<aside>👋</aside>
···
<section class="container content-languages">
<Icon name="pixel:globe" />
<p>
-
Je suis natif en 🇬🇧 <strong>Anglais</strong> et 🇫🇷 <strong
-
>Français</strong
+
Je suis natif en 🇬🇧 <strong>Anglais</strong> et 🇫🇷 <strong>
+
Français</strong
>.
</p>
</section>
···
</a>
</section>
-
<section class="container layout content-projects">
+
<section class="title-projects">
<aside>💻</aside>
<h3>Projets</h3>
-
<div>
-
<p>
-
I'm currently working on Karr, a federated carpooling
-
platform for businesses. You can find my other most
-
interesting projects just next door. I regularly take part
-
in CTFs and other cybersecurity events & conferences. Feel
-
free to use my contact details if you wish to get in touch.
-
I also love playing the drums and all sorts of instruments.
-
</p>
-
</div>
+
<p>
+
Voici mes projets les plus intéressants. Cliquez pour en savoir
+
plus !
+
</p>
+
</section>
+
+
<section class="container content-projects">
+
{
+
projects.map((project) => (
+
<div class="project">
+
<picture style="view-transition-name: karr-img">
+
<source
+
srcset={project.imgs.webp.src}
+
type="image/webp"
+
/>
+
<img
+
src={project.imgs.jpg.src}
+
alt={project.name}
+
/>
+
</picture>
+
<h3>
+
<a href={`/projects/${project.slug}`}>
+
{project.name}
+
</a>
+
</h3>
+
<p>{project.description}</p>
+
<ul>
+
{project.tags.map((tag: string) => (
+
<li class="tag">{tag}</li>
+
))}
+
</ul>
+
</div>
+
))
+
}
</section>
</article>
</Layout>