better cards

This commit is contained in:
whidix
2023-03-07 00:45:50 +01:00
parent 8e55c0a63d
commit 7b49ed534a
11 changed files with 365 additions and 304 deletions

View File

@@ -5,11 +5,15 @@
path: string;
date?: string;
tags?: string[];
image?: string;
};
</script>
<a href={data.path}>
<div class="card">
{#if data.image}
<img src=/img/net7.png class="image" alt={""} />
{/if}
<h2>{data.title}</h2>
{#if data.description}
<p>{data.description}</p>
@@ -44,7 +48,6 @@
flex-direction: column;
justify-content: center;
align-items: center;
padding: 1rem;
margin-top: 1rem;
}
@@ -54,6 +57,7 @@
justify-content: center;
align-items: center;
gap: 0.5rem;
margin-bottom: 1rem;
}
.tag {
@@ -62,4 +66,10 @@
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
}
.image {
width: 100%;
height: 100%;
object-fit: cover;
}
</style>

Binary file not shown.

Binary file not shown.

View File

@@ -6,6 +6,7 @@ export type Mdsvex = {
description?: string;
date?: string;
tags?: string[];
image?: string;
};
default: ReturnType<typeof create_ssr_component>;
};

View File

@@ -11,7 +11,7 @@
<section>
<Hero />
<h1 class="cv">
<a href={cv} download="CV_Vallier_Theodor.pdf">Dowload my CV</a>
<a href={cv} download="CV_Theodor_Vallier.pdf">Dowload my CV</a>
</h1>
</section>

View File

@@ -18,19 +18,16 @@
<hr />
<section class="project_list">
{#each data.data as { title, description, path, date, tags }}
<Card data={{ title, description, path, date, tags }} />
{#each data.data as { title, description, path, date, tags, image }}
<Card data={{ title, description, path, date, tags, image }} />
{/each}
</section>
</div>
<style lang="css">
.project_list {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
flex-wrap: wrap;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1rem;
}
</style>

View File

@@ -6,4 +6,5 @@ tags:
- web
- php
- laravel
image: /img/can7.png
---

View File

@@ -6,4 +6,5 @@ tags:
- web
- js
- tailwind
image: /img/net7.png
---

View File

@@ -27,6 +27,7 @@
<style>
.card_list {
display: grid;
grid-template-columns: repeat(auto-fit);
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1rem;
}
</style>