-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_event2.html
186 lines (165 loc) · 5.69 KB
/
event_event2.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event 2 Images</title>
<style>
/* CSS Styles */
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
section {
padding: 50px 0;
text-align: center;
background-image: url('Logos/background11.jpeg'); /* Replace with your background image */
background-size: cover;
background-position: center;
background-repeat: no-repeat;
color: #fff;
}
.section-title {
font-size: 36px;
font-weight: bold;
margin-bottom: 30px;
}
.section-text {
font-size: 36px;
font-weight: bold;
margin-bottom: 30px;
}
.event-card {
border: 2px solid #fff;
border-radius: 8px;
padding: 20px;
color: #fff;
width: 90%;
margin: 20px auto;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.event-images {
display: flex;
justify-content: center;
gap: 20px;
flex-wrap: wrap;
margin-bottom: 20px;
}
.event-images img {
width: 300px;
height: auto;
border-radius: 10px;
border: 2px solid #fff;
transition: transform 0.3s ease;
cursor: pointer;
}
.event-images img:hover {
transform: scale(1.05);
border-color: #6b1aff;
}
/* Modal Styles */
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.9);
}
.modal-content {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
max-height: 80%;
position: relative;
top: 50%;
transform: translateY(-50%);
}
.modal-content img {
width: 100%;
height: auto;
}
.close {
color: #fff;
font-size: 28px;
font-weight: bold;
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
z-index: 999;
}
.arrow {
color: #fff;
font-size: 48px;
position: absolute;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
z-index: 999;
}
.arrow.left {
left: 20px;
}
.arrow.right {
right: 20px;
}
</style>
</head>
<body>
<section>
<div class="container">
<div class = "event-card">
<h2 class="section-title">Event 2 </h2>
<h3 class="section-text">Competitive Programming Session - Dated(20th April)</h3>
<h3><p>A session focused on practicing competitive programming problems.
</p></h3>
<div class="event-images">
<img src="Event_Images/img1.jpeg" alt="Event 1 Image 1" onclick="openModal('Event_Images/img1.jpeg')">
<img src="Event_Images/img2.jpeg" alt="Event 1 Image 2" onclick="openModal('Event_Images/img2.jpeg')">
<img src="Event_Images/img3.jpeg" alt="Event 1 Image 3" onclick="openModal('Event_Images/img3.jpeg')">
<img src="Event_Images/img4.jpeg" alt="Event 1 Image 4" onclick="openModal('Event_Images/img4.jpeg')">
<img src="Event_Images/img5.jpeg" alt="Event 1 Image 5" onclick="openModal('Event_Images/img5.jpeg')">
<!-- Add more images as needed with onclick attribute -->
</div>
</div>
</div>
</section>
<!-- Modal -->
<div id="myModal" class="modal">
<span class="close" onclick="closeModal()">×</span>
<span class="arrow left" onclick="prevImage()">❮</span>
<span class="arrow right" onclick="nextImage()">❯</span>
<img class="modal-content" id="modalImg">
</div>
<script>
var images = ['Event_Images/img1.jpeg','Event_Images/img2.jpeg','Event_Images/img3.jpeg','Event_Images/img4.jpeg','Event_Images/img5.jpeg'];
var currentImageIndex = 0;
// JavaScript for opening and closing modal
function openModal(imgSrc) {
var modal = document.getElementById('myModal');
var modalImg = document.getElementById('modalImg');
modal.style.display = "block";
modalImg.src = imgSrc;
currentImageIndex = images.indexOf(imgSrc);
}
function closeModal() {
var modal = document.getElementById('myModal');
modal.style.display = "none";
}
function nextImage() {
currentImageIndex = (currentImageIndex + 1) % images.length;
document.getElementById('modalImg').src = images[currentImageIndex];
}
function prevImage() {
currentImageIndex = (currentImageIndex - 1 + images.length) % images.length;
document.getElementById('modalImg').src = images[currentImageIndex];
}
</script>
</body>
</html>