-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgallery.html
More file actions
225 lines (205 loc) · 7.68 KB
/
gallery.html
File metadata and controls
225 lines (205 loc) · 7.68 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Photo Gallery - SRM IST Delhi NCR Campus</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<style>
/* Basic styles */
body {
font-family: 'Poppins', sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
overflow-x: hidden;
}
/* Header Styling */
header {
background: linear-gradient(45deg, #1abc9c, #3498db, #9b59b6);
padding: 60px 20px;
color: white;
text-align: center;
position: relative;
}
header h1 {
font-size: 3em;
text-transform: uppercase;
letter-spacing: 2px;
margin: 0;
animation: slideIn 1.5s ease-out forwards;
}
/* Navigation Styling */
nav {
display: flex;
justify-content: center;
background-color: #2c3e50;
box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
position: sticky;
top: 0;
z-index: 100;
}
nav a {
color: white;
padding: 14px 20px;
text-decoration: none;
text-transform: uppercase;
font-weight: bold;
transition: background-color 0.3s ease, color 0.3s ease;
}
nav a:hover {
background: linear-gradient(45deg, #e74c3c, #f39c12);
color: #fff;
border-radius: 5px;
}
/* Section Styling */
section {
padding: 50px 20px;
text-align: center;
}
section h2 {
font-size: 2.5em;
color: #2c3e50;
margin-bottom: 30px;
position: relative;
}
section h2::after {
content: '';
width: 60px;
height: 4px;
background-color: #e74c3c;
display: block;
margin: 10px auto 0;
}
/* Gallery Grid */
.gallery {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Dynamic columns */
gap: 15px; /* Space between images */
}
/* Image Hover Effects */
.gallery img {
width: 100%;
height: auto;
object-fit: cover;
transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
max-height: 300px;
border-radius: 10px;
box-shadow: 0px 8px 15px rgba(0,0,0,0.1);
cursor: pointer;
}
/* Darken non-hovered images */
.gallery img:not(:hover) {
filter: brightness(80%);
}
/* Zoomed Image Styles */
#imageModal {
display: none; /* Hidden by default */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent overlay */
z-index: 1000;
justify-content: center;
align-items: center;
}
#imageModal img {
max-width: 80%;
max-height: 80%;
border-radius: 10px;
box-shadow: 0px 12px 30px rgba(0, 0, 0, 0.5);
transition: transform 0.3s ease-in-out;
}
#imageModal img:hover {
transform: scale(1.05); /* Slight zoom on hover */
}
/* Close Button */
#imageModal .close {
position: absolute;
top: 20px;
right: 40px;
color: white;
font-size: 40px;
font-weight: bold;
cursor: pointer;
}
/* Media Queries */
@media (max-width: 768px) {
header h1 {
font-size: 2.2em;
}
section h2 {
font-size: 2em;
}
}
</style>
</head>
<body>
<header>
<h1>SRM IST Delhi NCR Campus - Photo Gallery</h1>
</header>
<nav>
<a href="index.html">Home</a>
<a href="#gallery">Gallery</a>
</nav>
<section id="gallery">
<h2>Photo Gallery</h2>
<div class="gallery">
<img src="galleryimages/image1.jpg" alt="Event 1" onclick="showModal(this)">
<img src="galleryimages/image2.jpg" alt="Event 2" onclick="showModal(this)">
<img src="galleryimages/image3.jpg" alt="Event 3" onclick="showModal(this)">
<img src="galleryimages/image4.jpg" alt="Event 4" onclick="showModal(this)">
<img src="galleryimages/image5.jpg" alt="Event 5" onclick="showModal(this)">
<img src="galleryimages/image6.jpg" alt="Event 6" onclick="showModal(this)">
<img src="galleryimages/image7.jpg" alt="Event 7" onclick="showModal(this)">
<img src="galleryimages/image8.jpg" alt="Event 8" onclick="showModal(this)">
<img src="galleryimages/image9.jpg" alt="Event 9" onclick="showModal(this)">
<img src="galleryimages/image10.jpg" alt="Event 10" onclick="showModal(this)">
<img src="galleryimages/image11.jpg" alt="Event 11" onclick="showModal(this)">
<img src="galleryimages/image12.jpg" alt="Event 12" onclick="showModal(this)">
<img src="galleryimages/image13.jpg" alt="Event 13" onclick="showModal(this)">
<img src="galleryimages/image14.jpg" alt="Event 14" onclick="showModal(this)">
<img src="galleryimages/image15.jpg" alt="Event 15" onclick="showModal(this)">
<img src="galleryimages/image16.jpg" alt="Event 16" onclick="showModal(this)">
<img src="galleryimages/image17.jpg" alt="Event 17" onclick="showModal(this)">
<img src="galleryimages/image18.jpg" alt="Event 18" onclick="showModal(this)">
<img src="galleryimages/image19.jpg" alt="Event 19" onclick="showModal(this)">
<img src="galleryimages/image20.jpg" alt="Event 20" onclick="showModal(this)">
<img src="galleryimages/image21.jpg" alt="Event 21" onclick="showModal(this)">
<img src="galleryimages/image22.jpg" alt="Event 22" onclick="showModal(this)">
<img src="galleryimages/image23.jpg" alt="Event 23" onclick="showModal(this)">
<img src="galleryimages/image24.jpg" alt="Event 24" onclick="showModal(this)">
<img src="galleryimages/image25.jpg" alt="Event 25" onclick="showModal(this)">
<img src="galleryimages/image26.jpg" alt="Event 26" onclick="showModal(this)">
<img src="galleryimages/image27.jpg" alt="Event 27" onclick="showModal(this)">
<img src="galleryimages/image28.jpg" alt="Event 28" onclick="showModal(this)">
<img src="galleryimages/image29.jpg" alt="Event 29" onclick="showModal(this)">
</div>
</section>
<!-- Modal for Zoomed Image -->
<div id="imageModal">
<span class="close" onclick="closeModal()">×</span>
<img id="modalImage" src="">
</div>
<footer>
<p>© 2024 SRM IST Delhi NCR Campus. All rights reserved.</p>
</footer>
<script>
// Function to display the image in the modal
function showModal(imgElement) {
var modal = document.getElementById("imageModal");
var modalImg = document.getElementById("modalImage");
modalImg.src = imgElement.src;
modal.style.display = "flex"; // Show modal with flex to center the image
}
// Function to close the modal
function closeModal() {
var modal = document.getElementById("imageModal");
modal.style.display = "none"; // Hide modal
}
</script>
</body>
</html>