Skip to content

Commit

Permalink
Mobile optimizations for projects
Browse files Browse the repository at this point in the history
  • Loading branch information
drik98 committed Aug 1, 2024
1 parent 42d59eb commit be2c40b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
30 changes: 20 additions & 10 deletions components/Projects.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@
}

.project {
position: relative;
max-width: 900px;
margin: 0 auto 30px auto;
overflow: hidden;
background: #fff;
border-radius: 4px;
display: flex;
}

.projectImage {
float: left;
max-width: 300px;
height: 300px;
width: 30%;
min-width: 300px;
aspect-ratio: 1;
overflow: hidden;

img {
Expand All @@ -32,11 +31,11 @@
}

.projectInfo {
position: absolute;
top: 50%;
transform: translateY(-50%);
margin-left: 300px;
padding: 15px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

h3 {
font-size: 1.5em;
Expand All @@ -62,6 +61,7 @@

.projectLogos {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 10px;
}
Expand All @@ -83,7 +83,17 @@

@media only screen and (max-width: 768px) {
.projectImage {
display: none;
width: 100%;
height: 20vh;
aspect-ratio: unset;

img {
height: unset;
width: 100%;
}
}
.project {
flex-direction: column;
}
.projectInfo {
position: relative;
Expand Down
26 changes: 14 additions & 12 deletions components/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,20 @@ function ProjectItem({
<h3>{translatedTitle}</h3>
<p>{getMultilingualContent(description, locale)}</p>
<Technologies technologies={technologies} messages={messages} />
{projectUrl ? (
<a href={projectUrl} target="_blank" rel="noopener noreferrer">
<i className="fa fa-external-link"></i>
{messages.projects.viewProject}
</a>
) : null}
{sourceCodeUrl ? (
<a href={sourceCodeUrl} target="_blank" rel="noopener noreferrer">
<i className="fa fa-code"></i>
{messages.projects.viewCode}
</a>
) : null}
<span>
{projectUrl ? (
<a href={projectUrl} target="_blank" rel="noopener noreferrer">
<i className="fa fa-external-link"></i>
{messages.projects.viewProject}
</a>
) : null}
{sourceCodeUrl ? (
<a href={sourceCodeUrl} target="_blank" rel="noopener noreferrer">
<i className="fa fa-code"></i>
{messages.projects.viewCode}
</a>
) : null}
</span>
</div>
</div>
);
Expand Down

1 comment on commit be2c40b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.