Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding provision to add profile photo with responsive layout #6

Merged
merged 2 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/profile.webp
Binary file not shown.
2 changes: 2 additions & 0 deletions src/data/presentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ type Presentation = {
title: string;
description: string;
socials: Social[];
profile?: string;
};

const presentation: Presentation = {
mail: "maxencewolff.pro@gmail.com",
title: "Hi, I’m Maxence 👋",
profile: "/profile.webp",
description:
"Bonjour, i'm a *french frontend developer* with over *3 years* of web experience. I am currently working with *NextJS and Typescript*. Outside of work I complete my pokemon card collection and learning TypeScript.",
socials: [
Expand Down
34 changes: 29 additions & 5 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,35 @@ const posts = await getCollection("posts");
<Layout>
<main class="flex flex-col gap-20">
<article class="flex flex-col gap-8">
<h1 class="text-3xl text-neutral-100">{presentation.title}</h1>
<h2
class="max-w-[60ch] leading-6"
set:html={convertAsteriskToStrongTag(presentation.description)}
/>
<h1 class="text-3xl text-neutral-100 text-center md:text-left">{presentation.title}</h1>

<!-- Paragraph on the left, Image on the right (for larger screens) -->
<div class="hidden md:flex">
<h2
class="w-auto leading-6"
set:html={convertAsteriskToStrongTag(presentation.description)}
/>
{
presentation.profile &&
<div class="md:w-1/2">
<img src={presentation.profile} class="rounded-full float-right"/>
</div>
}
</div>

<!-- For smaller screens, Image on top, Text at bottom -->
<div class="md:hidden text-center">
{
presentation.profile &&
<div class="flex place-content-center mb-4">
<img src={presentation.profile} class="rounded-full self-center w-1/3" />
</div>
}
<h2
class="mw-full leading-6"
set:html={convertAsteriskToStrongTag(presentation.description)}
/>
</div>
<SocialLinks />
</article>

Expand Down