forked from anuragverma108/WildGuard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
moreevents.html
310 lines (264 loc) · 9.58 KB
/
moreevents.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
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wildlife Conservation Events</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<style>
:root {
--primary-color: #91BE55; /* Forest Green */
--background-color: #f0f8ff; /* Light blue (nature-like) */
--card-background: #ffffff;
--text-color: #91BE55; /* Sea Green */
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: var(--background-color);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
h1, h2 {
font-size: 2em;
margin-bottom: 10px;
}
.main-event {
background: url(./assets/images/hero.jpg);
object-fit: cover;
background-color: var(--card-background);
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
color: #f0f8ff;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.events-container {
padding: 20px 0;
}
.event-card {
display: flex;
align-items: center;
gap: 2px;
justify-content: space-between;
padding: 20px;
margin-bottom: 20px;
background-color: var(--card-background);
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
transition: transform 0.3s;
}
.event-card:hover {
border: 3px solid var(--primary-color);
}
/* Date Section */
.event-date {
display: flex;
flex-direction: column;
align-items: center;
background-color: var(--primary-color);
box-shadow: 0 2px 10px #5b7737;
color: white;
padding: 10px;
border-radius: 8px;
width: 80px;
}
.event-date .month {
font-size: 1.2em;
}
.event-date .day {
font-size: 2.5em;
font-weight: bold;
}
.event-details {
flex: 1;
margin-left: 20px;
}
.event-details h3 {
margin: 0;
font-size: 1.5em;
padding-bottom: 10px;
color: var(--primary-color);
}
.event-details p {
margin: 5px 0;
}
.event-action {
text-align: right;
}
button {
background-color: gray; /* Change button background color to black */
color: white; /* Keep text color white for contrast */
border: none;
padding: 8px 15px;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s;
}
button:hover {
background-color: #444; /* Darker shade for hover effect */
}
/* Back Button Styling */
.back-btn {
background-color: var(--primary-color); /* Change back button background color to black */
color: white;
border: none;
padding: 10px 20px;
margin-bottom: 20px;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
}
.back-btn:hover {
background-color: #444; /* Darker shade for hover effect */
}
@media (max-width: 768px) {
.event-card {
flex-direction: column;
align-items: flex-start;
}
.event-action {
margin-top: 15px;
text-align: left;
}
header {
flex-direction: column;
align-items: flex-start;
}
nav {
margin-top: 10px;
}
nav a {
margin: 5px 10px 5px 0;
}
}
</style>
</head>
<body>
<div class="container">
<!-- Back Button -->
<button class="back-btn" onclick="goBack()">← Back</button>
<main>
<div class="main-event">
<h1 id="mainEventName">Save the Forests</h1>
<p id="mainEventDate"></p>
<button onclick="remindMe()">Set Reminder</button>
</div>
<h2>Upcoming Conservation Events</h2>
<div id="futureEvents" class="events-container"></div>
<h2>Previous Wildlife Events</h2>
<div id="pastEvents" class="events-container"></div>
</main>
</div>
<script>
const events = [
{
name: "Forest Restoration Drive",
date: '2024-10-22',
time: '9:00 AM',
type: 'main',
location: 'Central Park, New York',
description: 'Join us for a day of planting trees and restoring the natural habitat.'
},
{
name: "Clean Our Oceans",
date: '2024-10-23',
time: '10:00 AM',
type: 'future',
location: 'Santa Monica Beach, California',
description: 'Help us clean up our oceans and beaches to protect marine life.'
},
{
name: "Plant a Tree Campaign",
date: '2024-10-24',
time: '11:00 AM',
type: 'future',
location: 'Golden Gate Park, San Francisco',
description: 'Participate in our campaign to plant trees and enhance urban greenery.'
},
{
name: "Save the Wetlands",
date: '2024-10-25',
time: '8:00 AM',
type: 'future',
location: 'Everglades, Florida',
description: 'Join us in preserving wetlands and protecting wildlife habitats.'
},
{
name: "Wildlife Rescue Operations",
date: '2024-10-21',
time: '7:00 AM',
type: 'past',
location: 'City Zoo, Chicago',
description: 'Volunteer with us to rescue and rehabilitate wildlife.'
}
];
async function displayEvents() {
const mainEvent = events.find(event => event.type === 'main');
if (mainEvent) {
document.getElementById('mainEventName').textContent = mainEvent.name;
document.getElementById('mainEventDate').textContent = `${formatDate(mainEvent.date)} at ${mainEvent.time}`;
}
const futureEvents = document.getElementById('futureEvents');
const pastEvents = document.getElementById('pastEvents');
for (const event of events) {
if (event.type === 'main') continue;
const eventElement = document.createElement('div');
eventElement.className = 'event-card';
eventElement.innerHTML = `
<div class="event-date">
<span class="month">${new Date(event.date).toLocaleString('default', { month: 'short' })}</span>
<span class="day">${new Date(event.date).getDate()}</span>
</div>
<div class="event-details">
<h3>${event.name}</h3>
<p>${event.description}</p>
<p><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-geo-alt-fill" viewBox="0 0 16 16">
<path d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10m0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6"/>
</svg>${event.location}</p>
<p>${formatDate(event.date)} at ${event.time}</p>
</div>
<div class="event-action">
<button onclick="getTickets('${event.name}')">
Get Involved
</button>
</div>
`;
if (event.type === 'future') {
futureEvents.appendChild(eventElement);
} else if (event.type === 'past') {
pastEvents.appendChild(eventElement);
}
}
}
function formatDate(dateString) {
const date = new Date(dateString);
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
return date.toLocaleDateString('en-US', options);
}
function remindMe() {
alert('Reminder set for the upcoming conservation event!');
}
function getTickets(eventName) {
if (eventName === "Clean Our Oceans") {
window.location.href = "cleanocean.html";
} else {
alert('Redirecting to event registration...');
}
}
function viewDetails() {
alert('Viewing event details...');
}
// Function to go back to the previous page
function goBack() {
window.history.back();
}
displayEvents();
</script>
</body>
<!-- rebooted -->
</html>