Skip to content

Commit b6bb185

Browse files
committed
♻️ Refactor project preview and technology images
1 parent b35eb60 commit b6bb185

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

src/components/Portfolio.astro

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
2121
projects.map((project) => (
2222
<div class="project">
2323
<a href={project.urlProduction} target="_blank" aria-label="project-preview">
24-
<picture>
24+
<picture class="project-preview">
2525
<img src={`/${project.image}`} alt="project-preview" loading="lazy">
2626
</picture>
2727
</a>
@@ -31,10 +31,12 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
3131
<div class="technologies">
3232
{
3333
project.technologies.map((technology) => (
34-
<img
35-
src={`/images/${technology.image}`}
36-
alt={`${technology.name} tool used in the project`}
37-
loading="lazy">
34+
<picture class="technology">
35+
<img
36+
src={`/images/${technology.image}`}
37+
alt={`${technology.name} tool used in the project`}
38+
loading="lazy">
39+
</picture>
3840
))
3941
}
4042
</div>
@@ -98,12 +100,18 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
98100
gap: 2rem;
99101
}
100102

101-
.project picture {
103+
.description .technologies img {
104+
width: 100%;
105+
height: 100%;
106+
object-fit: cover;
107+
}
108+
109+
.project picture.project-preview {
102110
border-radius: 1rem;
103111
overflow: hidden;
104112
}
105113

106-
.project picture img {
114+
.project picture.project-preview img {
107115
min-height: inherit;
108116
width: 100%;
109117
height: 100%;
@@ -112,10 +120,10 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
112120
transition: 0.3s ease;
113121
}
114122

115-
.description .technologies img {
116-
width: 100%;
123+
.description .technologies .technology {
117124
height: 2.1rem;
118-
object-fit: cover;
125+
border-radius: 0.5rem;
126+
overflow: hidden;
119127
}
120128

121129
.project picture img:hover {
@@ -186,14 +194,18 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
186194
gap: 1.8rem;
187195
}
188196

189-
.project picture {
197+
.description .technologies img {
198+
height: 1.5rem;
199+
}
200+
201+
.project picture.project-preview {
190202
width: 100%;
191203
height: 100%;
192204
margin-bottom: 1rem;
193205
border-radius: 0.8rem;
194206
}
195207

196-
.project picture img {
208+
.project picture.project-preview img {
197209
transform: translate(0, 0);
198210
}
199211

@@ -216,10 +228,6 @@ const projects = i18n.PORTFOLIO_SECTION.PROJECTS;
216228
gap: 0.5rem;
217229
}
218230

219-
.description .technologies img {
220-
height: 1.5rem;
221-
}
222-
223231
.description .links {
224232
flex-direction: row;
225233
flex-wrap: wrap;

0 commit comments

Comments
 (0)