Skip to content

Commit

Permalink
Made avatar responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiKhoshnevisz committed Jul 16, 2022
1 parent 1219e31 commit 2a1c8f4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
27 changes: 3 additions & 24 deletions src/templates/default/components/Biography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 20,10 @@ const Biography: FC<Props> = ({

return (
<header>
<div
style={{
display: "flex",
alignItems: "flex-end",
}}
>
<div className="mk-biography__header-top">
{avatar && (
<div
style={{
marginRight: "1em",
marginBottom: "0.5rem",
}}
>
<img
src={avatar}
style={{
width: "135px",
height: "135px",
objectFit: "cover",
verticalAlign: "middle",
objectPosition: "center",
filter: "grayscale(100%)",
}}
alt={fullName}
/>
<div className="mk-biography__avatar">
<img src={avatar} alt={fullName} />
</div>
)}

Expand Down
35 changes: 35 additions & 0 deletions src/templates/default/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 50,25 @@
filter: grayscale(1);
}

.mk-biography__header-top {
display: flex;
align-items: flex-end;
}

.mk-biography__avatar {
margin-right: 1em;
margin-bottom: 0.5rem;
}

.mk-biography__avatar img {
width: 135px;
height: 135px;
object-fit: cover;
vertical-align: middle;
object-position: center;
filter: grayscale(100%);
}

@media (max-width: 920px) {
#app {
padding: 2em 1.5em;
Expand All @@ -68,3 87,19 @@
height: 1em;
}
}

@media (max-width: 520px) {
.mk-biography__header-top {
display: block;
}

.mk-biography__avatar {
margin-right: 0;
}

.mk-biography__avatar img {
width: 100%;
height: 250px;
margin-bottom: 0.5rem;
}
}

0 comments on commit 2a1c8f4

Please sign in to comment.