forked from anuragverma108/WildGuard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDonation.html
227 lines (192 loc) · 5.78 KB
/
Donation.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WildGuard Donations</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
::-webkit-scrollbar {
width: 24px; /* Width of the scrollbar */
}
::-webkit-scrollbar-track {
background: #6eff92; /* Background of the scrollbar track */
}
::-webkit-scrollbar-thumb {
background-color: rgb(0, 113, 19); /* Color of the scrollbar thumb */
border-radius: 10px; /* Rounding edges */
/* Adds padding around the thumb */
}
/* Firefox Scrollbar */
html {
scrollbar-color: rgb(0, 113, 19) #f0f8ff; /* Thumb color | Track color */
scrollbar-width: thin; /* Makes the scrollbar thinner */
}
.backimg {
background-image: url("assets/images/community-hero-bg.jpeg");
background-repeat: no-repeat;
background-size: cover;
background-position: left;
min-height: 780px;
}
body {
font-family: 'Arial', sans-serif;
background: #f0f8ff;
color:black;
line-height: 1.6;
overflow: hidden;
}
header {
text-align: center;
padding: 10px;
background-color:rgba(255, 253, 253, 0.721);
color: rgb(0, 113, 19);
}
header h1 {
font-size: 3em;
}
header p {
font-size: 1.2em;
}
.donation-form {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
max-width: 400px;
margin: 40px auto;
padding: 40px;
border-radius: 8px;
border: 1px solid rgba(255, 255, 255, 0.3);
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.3);
text-align: center;
color: white;
transition: background 0.3s ease;
}
.donation-form h2 {
font-size: 2em;
margin-bottom: 20px;
color: #228B22;
}
.donation-form p {
margin-bottom: 20px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 5px;
font-weight: bold;
}
input, select {
padding: 10px;
margin-bottom: 15px;
border-radius: 4px;
border: 1px solid #ccc;
}
button {
padding: 12px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
font-weight: bold;
transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
button:hover {
background-color: #45a049;
transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}
#thankYouMessage {
text-align: center;
margin-top: 20px;
}
footer {
background-color:rgb(0, 113, 19);
padding: 10px;
text-align: center;
color: white;
position: fixed;
width: 100%;
bottom: 0;
}
</style>
</head>
<body>
<div class="backimg">
<header>
<h1>WildGuard</h1>
<p>Help protect wildlife. Donate today to save the animals!</p>
</header>
<main>
<section class="donation-form">
<h2>Make a Donation</h2>
<p>Your donation will help protect endangered species and wildlife habitats.</p>
<form id="donationForm">
<label for="donorName">Full Name</label>
<input type="text" id="donorName" placeholder="Your Name" required>
<label for="email">Email</label>
<input type="email" id="email" placeholder="Your Email" required>
<label for="amount">Donation Amount</label>
<select id="amount" required>
<option value="10">$10</option>
<option value="25">$25</option>
<option value="50">$50</option>
<option value="100">$100</option>
<option value="custom">Custom</option>
</select>
<input type="number" id="customAmount" placeholder="Enter custom amount" style="display: none;">
<button type="submit">Donate Now</button>
</form>
<div id="thankYouMessage" style="display:none;">
<h3>Thank you for your generosity!</h3>
<p>Your donation will make a huge difference in protecting animals.</p>
</div>
</section>
</main>
<footer>
<p>© 2024 WildGuard Organization. All rights reserved.</p>
</footer>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const donationForm = document.getElementById('donationForm');
const amountSelect = document.getElementById('amount');
const customAmountInput = document.getElementById('customAmount');
const thankYouMessage = document.getElementById('thankYouMessage');
// Show custom amount input if 'Custom' is selected
amountSelect.addEventListener('change', function () {
if (amountSelect.value === 'custom') {
customAmountInput.style.display = 'block';
} else {
customAmountInput.style.display = 'none';
}
});
// Handle form submission
donationForm.addEventListener('submit', function (event) {
event.preventDefault();
const name = document.getElementById('donorName').value;
const email = document.getElementById('email').value;
let amount = amountSelect.value === 'custom' ? customAmountInput.value : amountSelect.value;
// Validating the name field
if(!name.match('^[a-zA-Z\s]+$')){
alert("Invalid Name Format");
return
}
if (amount && name && email) {
// Display thank you message
donationForm.style.display = 'none';
thankYouMessage.style.display = 'block';
}
});
});
</script>
</body>
</html>