-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrosted-glass-image-gallery· html.html
More file actions
181 lines (155 loc) · 5.08 KB
/
Frosted-glass-image-gallery· html.html
File metadata and controls
181 lines (155 loc) · 5.08 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Frosted Glass Image Gallery</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #1c1e26, #3a3f47);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
box-sizing: border-box;
}
h1 {
color: #fff;
text-align: center;
margin-bottom: 20px;
}
.gallery-container {
width: 90%;
max-width: 1000px;
}
.filters {
display: flex;
justify-content: center;
margin-bottom: 20px;
gap: 10px;
}
.filters button {
background: rgba(255, 255, 255, 0.2);
border: none;
padding: 10px 20px;
border-radius: 10px;
backdrop-filter: blur(10px);
color: #fff;
cursor: pointer;
transition: 0.3s;
}
.filters button:hover {
background: rgba(255, 255, 255, 0.4);
}
.gallery {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 15px;
}
.gallery img {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 15px;
cursor: pointer;
transition: transform 0.3s ease;
}
.gallery img:hover {
transform: scale(1.05);
}
/* Lightbox */
.lightbox {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
display: none;
justify-content: center;
align-items: center;
}
.lightbox img {
width: 70%;
max-width: 800px;
border-radius: 20px;
}
.close, .next, .prev {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(255, 255, 255, 0.2);
padding: 15px;
cursor: pointer;
border-radius: 50%;
color: white;
font-size: 22px;
}
.close {
top: 20px;
right: 20px;
}
.next { right: 30px; }
.prev { left: 30px; }
@media(max-width: 600px){
.lightbox img { width: 90%; }
}
</style>
</head>
<body>
<div class="gallery-container">
<h1> Frosted Glass Image Gallery </h1>
<div class="filters">
<button onclick="filterImages('all')">All</button>
<button onclick="filterImages('nature')">Nature</button>
<button onclick="filterImages('animals')">Animals</button>
<button onclick="filterImages('city')">City</button>
</div>
<div class="gallery" id="gallery">
<img src="c:\Users\DELL\Downloads\download.jpg"class="nature">
<img src="c:\Users\DELL\Downloads\download.jpg" class="nature">
<img src="c:\Users\DELL\Downloads\Golden retriever ❤️❤️.jpg" class="animals">
<img src="c:\Users\DELL\Downloads\Namma Chennai.jpg" class="city">
<img src="c:\Users\DELL\Downloads\Namma Chennai.jpg" class="city">
<img src="c:\Users\DELL\Downloads\Namma Chennai.jpg" class="city">
<img src="c:\Users\DELL\Downloads\Golden retriever ❤️❤️.jpg" class="animals">
<img src="c:\Users\DELL\Downloads\Namma Chennai.jpg" class="city">
</div>
</div>
<!-- Lightbox -->
<div class="lightbox" id="lightbox">
<span class="close" onclick="closeLightbox()">✖</span>
<span class="prev" onclick="changeImage(-1)">❮</span>
<img id="lightbox-img">
<span class="next" onclick="changeImage(1)">❯</span>
</div>
<script>
const images = document.querySelectorAll('.gallery img');
const lightbox = document.getElementById('lightbox');
const lightboxImg = document.getElementById('lightbox-img');
let currentIndex = 0;
images.forEach((img, index) => {
img.addEventListener('click', () => {
currentIndex = index;
lightbox.style.display = 'flex';
lightboxImg.src = img.src;
});
});
function closeLightbox(){
lightbox.style.display = 'none';
}
function changeImage(step){
currentIndex = (currentIndex + step + images.length) % images.length;
lightboxImg.src = images[currentIndex].src;
}
function filterImages(category){
images.forEach(img => {
img.style.display = (category === 'all' || img.classList.contains(category)) ? 'block' : 'none';
});
}
</script>
</body>
</html>