-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path31-lightbox-gallery.html
67 lines (61 loc) Β· 1.42 KB
/
31-lightbox-gallery.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
.images-gallery {
display: grid;
grid-template-columns: repeat(5, 1fr);
align-content: center;
justify-content: center;
gap: 0.8rem;
height: 100vh;
}
.images-gallery__item {
max-width: 500px;
border-radius: 4px;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.images-gallery__item > img:hover {
cursor: pointer;
}
#lightbox {
position: fixed;
top: 0;
left: 0;
z-index: 100;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
display: none;
}
#lightbox.active {
display: flex;
align-items: center;
justify-content: center;
}
#lightbox img {
max-width: 50%;
max-height: 40%;
padding: 4px;
background: #f1f1f1;
border: 2px groove #1c6ea4;
border-radius: 0.5rem;
}
</style>
</head>
<body>
<main>
<ul class="images-gallery"></ul>
</main>
<script src="./app/31-lightbox-gallery.js"></script>
</body>
</html>