Skip to content

Commit

Permalink
Merge pull request #15 from marcode24/image
Browse files Browse the repository at this point in the history
✏️ Fix image source path in Hero component
  • Loading branch information
marcode24 authored Feb 6, 2024
2 parents 18e2b04 + b6bb185 commit 04d935a
Show file tree
Hide file tree
Showing 16 changed files with 182 additions and 79 deletions.
8 changes: 6 additions & 2 deletions src/components/About.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import UserIcon from '@components/icons/user-icon.astro';
import { getI18n } from '@i18n/index';
const { currentLocale } = Astro;
Expand All @@ -7,15 +8,18 @@ const i18n = getI18n({ currentLocale });
---

<section id="about">
<span class="title">{i18n.ABOUT_SECTION.TITLE} 👨</span>
<span class="title">
<UserIcon />
{i18n.ABOUT_SECTION.TITLE}
</span>
<div class="wrap">
<div class="description">
<p set:html={i18n.ABOUT_SECTION.DESCRIPTION_1}></p>
<p set:html={i18n.ABOUT_SECTION.DESCRIPTION_2}></p>
<p set:html={i18n.ABOUT_SECTION.DESCRIPTION_3}></p>
</div>
<div class="image">
<img src="programming.webp" alt={i18n.ABOUT_SECTION.IMAGE.ALT}>
<img src="/programming.webp" alt={i18n.ABOUT_SECTION.IMAGE.ALT}>
</div>
</div>
</section>
Expand Down
4 changes: 2 additions & 2 deletions src/components/App.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const i18n = getI18n({ currentLocale });
<div class="blur bottom"></div>
<div class="blur top"></div>
<Hero />
<About />
<Skills />
<Portfolio />
<Skills />
<About />
<Contact />
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/components/Contact.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import CopyIcon from '@components/icons/copy-icon.astro';
import EnvelopeIcon from '@components/icons/envelope-icon.astro';
import GithubIcon from '@components/icons/github-icon.astro';
import InstagramIcon from '@components/icons/instagram-icon.astro';
import LinkedinIcon from '@components/icons/linkedin-icon.astro';
Expand All @@ -20,7 +21,10 @@ const i18n = getI18n({ currentLocale });
---

<section id="contact">
<span class="title">{i18n.CONTACT_SECTION.TITLE} ✉️</span>
<span class="title">
<EnvelopeIcon />
{i18n.CONTACT_SECTION.TITLE}
</span>
<div class="container">
<p class="description">
{i18n.CONTACT_SECTION.DESCRIPTION}
Expand Down Expand Up @@ -87,7 +91,7 @@ const i18n = getI18n({ currentLocale });
justify-content: center;
flex-direction: column;
gap: 2rem;
max-width: 50%;
max-width: 60%;
margin: 6rem auto;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const i18n = getI18n({ currentLocale });
</div>
</div>

<img src="me.webp" alt={i18n.HERO_SECTION.IMAGE.ALT} class="profile">
<img src="/me.webp" alt={i18n.HERO_SECTION.IMAGE.ALT} class="profile">
</section>

<style>
Expand Down
16 changes: 8 additions & 8 deletions src/components/Navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
<span class="title"> {home} </span>
</a>
</li>
<li class="about">
<a href="#about" aria-label="About section">
<UserIcon />
<span class="title">{about}</span>
<li class="portfolio">
<a href="#portfolio" aria-label="Portfolio section">
<BriefcaseIcon />
<span class="title">{portfolio}</span>
</a>
</li>
<li class="skills">
Expand All @@ -87,10 +87,10 @@
<span class="title">{skills}</span>
</a>
</li>
<li class="portfolio">
<a href="#portfolio" aria-label="Portfolio section">
<BriefcaseIcon />
<span class="title">{portfolio}</span>
<li class="about">
<a href="#about" aria-label="About section">
<UserIcon />
<span class="title">{about}</span>
</a>
</li>
<li class="contact">
Expand Down
53 changes: 30 additions & 23 deletions src/components/Portfolio.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import CodeIcon from '@components/icons/code-icon.astro';
import ExternalIcon from '@components/icons/external-icon.astro';
import GithubIcon from '@components/icons/github-icon.astro';
import { getI18n } from '@i18n/index';
Expand All @@ -10,15 +11,18 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
---

<section id="portfolio">
<span class="title">{i18n.PORTFOLIO_SECTION.TITLE} 💼</span>
<span class="title">
<CodeIcon />
{i18n.PORTFOLIO_SECTION.TITLE}
</span>

<div class="projects">
{
projects.map((project) => (
<div class="project">
<a href={project.urlProduction} target="_blank" aria-label="project-preview">
<picture>
<img src={project.image} alt="project-preview" loading="lazy">
<picture class="project-preview">
<img src={`/${project.image}`} alt="project-preview" loading="lazy">
</picture>
</a>
<div class="description">
Expand All @@ -27,10 +31,12 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
<div class="technologies">
{
project.technologies.map((technology) => (
<img
src={`images/${technology.image}`}
alt={`${technology.name} tool used in the project`}
loading="lazy">
<picture class="technology">
<img
src={`/images/${technology.image}`}
alt={`${technology.name} tool used in the project`}
loading="lazy">
</picture>
))
}
</div>
Expand Down Expand Up @@ -72,11 +78,6 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
</section>

<style>
section#portfolio {
position: relative;
width: 100%;
}

.more {
display: flex;
align-items: center;
Expand All @@ -99,12 +100,18 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
gap: 2rem;
}

.project picture {
.description .technologies img {
width: 100%;
height: 100%;
object-fit: cover;
}

.project picture.project-preview {
border-radius: 1rem;
overflow: hidden;
}

.project picture img {
.project picture.project-preview img {
min-height: inherit;
width: 100%;
height: 100%;
Expand All @@ -113,10 +120,10 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
transition: 0.3s ease;
}

.description .technologies img {
width: 100%;
.description .technologies .technology {
height: 2.1rem;
object-fit: cover;
border-radius: 0.5rem;
overflow: hidden;
}

.project picture img:hover {
Expand Down Expand Up @@ -187,14 +194,18 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
gap: 1.8rem;
}

.project picture {
.description .technologies img {
height: 1.5rem;
}

.project picture.project-preview {
width: 100%;
height: 100%;
margin-bottom: 1rem;
border-radius: 0.8rem;
}

.project picture img {
.project picture.project-preview img {
transform: translate(0, 0);
}

Expand All @@ -217,10 +228,6 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
gap: 0.5rem;
}

.description .technologies img {
height: 1.5rem;
}

.description .links {
flex-direction: row;
flex-wrap: wrap;
Expand Down
10 changes: 7 additions & 3 deletions src/components/Skills.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import CardSkill from '@components/cards/CardSkill.astro';
import WrenchIcon from '@components/icons/wrench-icon.astro';
import {
cardsDataBackend,
cardsDataFrontend,
Expand All @@ -15,7 +16,10 @@ const i18n = getI18n({ currentLocale });
---

<section id="skills">
<span class="title">{i18n.SKILLS_SECTION.TITLE} 🛠️</span>
<span class="title">
<WrenchIcon />
{i18n.SKILLS_SECTION.TITLE}
</span>
<div class="skills">
<div class="skill">
<span class="subtitle">{i18n.SKILLS_SECTION.TITLES.FRONTEND}</span>
Expand Down Expand Up @@ -84,8 +88,8 @@ const i18n = getI18n({ currentLocale });

.subtitle {
font-size: 28px;
font-weight: bold;
color: var(--font-color);
font-weight: 600;
color: var(--primary-color);
}

.cards {
Expand Down
19 changes: 19 additions & 0 deletions src/components/icons/code-icon.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
interface Props {
height?: number;
width?: number;
}
const { height = 40, width = 40 }: Props = Astro.props;
---

<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-code"
width={width} height={height}
viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M7 8l-4 4l4 4" />
<path d="M17 8l4 4l-4 4" />
<path d="M14 4l-4 16" />
</svg>
21 changes: 21 additions & 0 deletions src/components/icons/envelope-icon.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
interface Props {
height?: number;
width?: number;
}
const { height = 40, width = 40 }: Props = Astro.props;
---

<svg xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-mail-forward"
width={width} height={height}
viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M12 18h-7a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5" />
<path d="M3 6l9 6l9 -6" />
<path d="M15 18h6" />
<path d="M18 15l3 3l-3 3" />
</svg>
20 changes: 20 additions & 0 deletions src/components/icons/user-icon.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
interface Props {
height?: number;
width?: number;
}
const { height = 40, width = 40 }: Props = Astro.props;
---

<svg xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-user-check"
width={width} height={height}
viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z"fill="none"/>
<path d="M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0" />
<path d="M6 21v-2a4 4 0 0 1 4 -4h4" />
<path d="M15 19l2 2l4 -4" />
</svg>
19 changes: 19 additions & 0 deletions src/components/icons/wrench-icon.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
interface Props {
height?: number;
width?: number;
}
const { height = 40, width = 40 }: Props = Astro.props;
---

<svg xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-tool"
width={width} height={height}
viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor"
fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5" />
</svg>
Loading

0 comments on commit 04d935a

Please sign in to comment.