Skip to content

Commit

Permalink
add photo overlay at portgolip photos
Browse files Browse the repository at this point in the history
  • Loading branch information
HalynaRiabokonenko committed Mar 2, 2024
1 parent 77e5205 commit fa39d52
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 13 deletions.
3 changes: 1 addition & 2 deletions my-app/src/Components/Footer/Footer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
display: flex;
justify-content: center;
align-items: center;
border-top: 0.5px solid rgba(63, 63, 54, 30%);
}

.footer__text {
Expand All @@ -23,4 +22,4 @@
.dark {
background-color: var(--box-dark-color-dark);
color: var(--main-text-color-dark);
}
}
1 change: 0 additions & 1 deletion my-app/src/Components/Header/Header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
z-index: 1;
display: flex;
flex-direction: row;
border-bottom: 0.5px solid rgba(63, 63, 54, 30%);
}

.header__image-border-container {
Expand Down
60 changes: 58 additions & 2 deletions my-app/src/Components/Portfolio/Portfolio.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@
width: 250px;
height: 150px;
border-radius: 25px;
transition: 0.5s all ease-in-out;
opacity: 1;
}

.portfolio__photo:hover {
transform: scale(1.1);
/* transform: scale(1.1); */
opacity: 0.3;
}

.portfolio {
Expand All @@ -80,3 +81,58 @@
background: var(--box-light-color-dark);
color: var(--main-text-color-dark);
}

.portfolio__photo-container {
position: relative;
width: 250px;
height: 150px;
}

.portfolio__overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(83, 77, 77, 0.434);
display: flex;
justify-content: center;
align-items: center;
color: var(--box-light-color-light);
font-size: 24px;
opacity: 0;
transition: opacity 0.3s ease;
border-radius: 25px;
text-transform: uppercase;
font-weight: bold;
font-style: normal;
}

.portfolio__photo-container:hover .portfolio__overlay {
opacity: 1;
}

.portfolio__photo {
width: 100%;
height: 100%;
border-radius: 25px;
object-fit: cover;
}

.portfolio__photos {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
padding: 40px;
border-radius: 20px;
font-style: oblique;
margin: 10px 40px;
}

.portfolio__items {
margin: 20px 20px 5px 20px;
width: 20%;
display: flex;
flex-direction: column;
}
21 changes: 13 additions & 8 deletions my-app/src/Components/Portfolio/Portfolio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ export const Portfolio = () => {
{portfolioData.map((photo) => (
<div key={photo.id} className={styles["portfolio__items"]}>
<Link to={`/portfolio/${photo.id}`}>
<img
src={photo.url}
className={styles["portfolio__photo"]}
data-id={photo.id}
onClick={() => {
setImageId(photo.id);
}}
/>
<div className={styles["portfolio__items"]}>
<div className={styles["portfolio__photo-container"]}>
<img
src={photo.url}
className={styles["portfolio__photo"]}
data-id={photo.id}
onClick={() => {
setImageId(photo.id);
}}
/>
<div className={styles["portfolio__overlay"]}>open</div>
</div>
</div>
</Link>
</div>
))}
Expand Down

0 comments on commit fa39d52

Please sign in to comment.