Skip to content

Commit 555c248

Browse files
authored
Merge pull request #40 from Op-panda/b1
Photo Gallery Project
2 parents 1a8cb4b + 5b9c756 commit 555c248

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
font-family: "Gill Sans", sans-serif;
9+
}
10+
11+
.container {
12+
padding: 40px 5%;
13+
}
14+
15+
.heading-text {
16+
margin-bottom: 2rem;
17+
}
18+
19+
.photo-gallery {
20+
/* add code here*/
21+
display: flex;
22+
gap: 20px;
23+
}
24+
25+
.photo-gallery .column {
26+
gap: 10px;
27+
}
28+
29+
.photo-item img {
30+
width: 100%;
31+
border-radius: 10px;
32+
height: 100%;
33+
object-fit: cover;
34+
}
35+
36+
@media (max-width:768px) {
37+
.photo-gallery {
38+
flex-direction: column;
39+
}
40+
}
41+
42+
.photo-item {
43+
position: relative;
44+
cursor: pointer;
45+
}
46+
47+
.overlay {
48+
position: absolute;
49+
width: 100%;
50+
height: 100%;
51+
background-color: rgba(65, 65, 65, 0.313);
52+
top: 0rem;
53+
left: 0rem;
54+
transform: scale(0);
55+
transition: all 0.2s 0.1s ease-in-out;
56+
color: rgb(255, 255, 255);
57+
display: flex;
58+
align-items: center;
59+
justify-content: center;
60+
61+
}
62+
63+
/* hover */
64+
.photo-item:hover .overlay {
65+
transform: scale(1);
66+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Document</title>
8+
<link rel="stylesheet" href="index.css" />
9+
</head>
10+
<body>
11+
<div class="container">
12+
<h2 class="heading-text">My Responsive Photo Gallery</h2>
13+
<div class="photo-gallery">
14+
<div class="column">
15+
<div class="photo-item">
16+
<img src="https://source.unsplash.com/OyCl7Y4y0Bk" alt="" />
17+
<div class="overlay"><span>Apple on Books</span></div>
18+
</div>
19+
<div class="photo-item">
20+
<img src="https://source.unsplash.com/Kl1gC0ve620" alt="" />
21+
<div class="overlay"><span>I love to learn!</span></div>
22+
</div>
23+
<div class="photo-item">
24+
<img src="https://source.unsplash.com/55btQzyDiO8" alt="" />
25+
<div class="overlay">
26+
<span>I love reading so much I wish I owned a library</span>
27+
</div>
28+
</div>
29+
</div>
30+
<div class="column">
31+
<div class="photo-item">
32+
<img src="https://source.unsplash.com/g0dBbrGmMe0" alt="" />
33+
<div class="overlay">
34+
<span>One of my favourite foods - Nasi Goreng!</span>
35+
</div>
36+
</div>
37+
<div class="photo-item">
38+
<img src="https://source.unsplash.com/v1OW17UcR-Q" alt="" />
39+
<div class="overlay"><span>Making matcha calms me</span></div>
40+
</div>
41+
<div class="photo-item">
42+
<img src="https://source.unsplash.com/Wpg3Qm0zaGk" alt="" />
43+
<div class="overlay"><span>I love gelato too!</span></div>
44+
</div>
45+
</div>
46+
<div class="column">
47+
<div class="photo-item">
48+
<img src="https://source.unsplash.com/W3FC_bCPw8E" alt="" />
49+
<div class="overlay">
50+
<span>I wish to visit Lake Bled some day</span>
51+
</div>
52+
</div>
53+
<div class="photo-item">
54+
<img src="https://source.unsplash.com/rBRZLPVLQg0" alt="" />
55+
<div class="overlay">
56+
<span>To see beautiful landscapes like this</span>
57+
</div>
58+
</div>
59+
<div class="photo-item">
60+
<img src="https://source.unsplash.com/RRksEVVoU8o" alt="" />
61+
<div class="overlay">
62+
<span>To watch the aurora with my eyes</span>
63+
</div>
64+
</div>
65+
</div>
66+
</div>
67+
</div>
68+
</body>
69+
</html>

0 commit comments

Comments
 (0)