-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·316 lines (279 loc) · 11.7 KB
/
index.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
311
312
313
314
315
316
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="favicon.ico">
<title>The Sh*tty Barn</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<!-- Plugin CSS -->
<link href="vendor/magnific-popup/magnific-popup.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/creative.min.css" rel="stylesheet">
<script src="vendor/jquery/jquery.min.js"></script>
<!-- stripe -->
<script src="https://checkout.stripe.com/checkout.js"></script>
</head>
<body id="page-top">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">The Sh*tty Barn</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#tiers">Tiers</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contribute">Contribute</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="masthead text-center text-white d-flex">
<div class="container my-auto">
<div class="row">
<div class="col-lg-10 mx-auto">
<h1 class="text-uppercase">
<strong>Sh*tty Roof</strong>
</h1>
<hr>
</div>
<div class="col-lg-8 mx-auto">
<p class="text-faded mb-5">Mission!</p>
<a class="btn btn-primary btn-xl js-scroll-trigger" href="#contribute">Contribute now</a>
</div>
</div>
</div>
</header>
<!-- Raised so far -->
<section class="bg-black no-gutter" id="currently-raised">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading text-white">Currently raised:</h2>
<h3 class="text-white">$<span id="total-raised">0</span> of our $<span id="total-goal">0</span> goal.</h3>
<!--<div id="progress-bar" class="progress">
</div>-->
<hr class="my-4">
<a class="btn btn-primary btn-xl js-scroll-trigger" href="#contribute">Contribute now</a>
</div>
</div>
</div>
</section>
<section id="tiers">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">Contribution tiers</h2>
<p>text text...</p>
<hr class="my-4">
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-diamond text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Tier 1 - $500</h3>
<p class="text-muted mb-0">Ticket to secret show with details</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-paper-plane text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Tier 2 - $100</h3>
<p class="text-muted mb-0">Shirt and book and stuff</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-newspaper-o text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Tier 3 - $50</h3>
<p class="text-muted mb-0">Shirt and no other stuff</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-heart text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Tier 4 -
< $50</h3>
<p class="text-muted mb-0">Thanks</p>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<hr class="my-4">
<a class="btn btn-primary btn-xl js-scroll-trigger" href="#contribute">Contribute now</a>
</div>
</div>
</div>
</section>
<section class="bg-primary" id="contribute">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading text-white">Help us raise the roof</h2>
<h3 class="text-white">How much will you contribute?</h3>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">$</span>
</div>
<input id="contribution-amount" type="number" class="form-control" aria-label="Amount (to the nearest dollar)">
<div class="input-group-append">
<span class="input-group-text">.00</span>
</div>
</div>
<div id="shirt-container" style="display: none;">
<h3 class="text-white">What is your shirt size?</h3>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="shirt-size">Shirt Size (all adult sizes)</label>
</div>
<select class="custom-select" id="shirt-size">
<option selected>Choose...</option>
<option value="x-small">X-Small</option>
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
<option value="xl">XL</option>
<option value="2xl">XXL</option>
<option value="3xl">3XL</option>
<option value="4xl">4XL</option>
<option value="5xl">5XL</option>
</select>
</div>
</div>
<button class="btn btn-secondary btn-xl" id="contributeButton" disabled>Contribute!</button>
<script>
(function() {
$('#contribution-amount').keyup(function() {
if (parseInt($('#contribution-amount').val()) > 49) {
$('#shirt-container').css('display', 'block');
$('#contributeButton').attr('disabled', false);
} else if (parseInt($('#contribution-amount').val()) > 1) {
$('#shirt-container').css('display', 'none');
$('#shirt-size').val('');
$('#contributeButton').attr('disabled', false);
} else {
$('#shirt-container').css('display', 'none');
$('#shirt-size').val('');
$('#contributeButton').attr('disabled', true);
}
});
})(jQuery)
var handler = StripeCheckout.configure({
key: 'pk_test_xTcZWB4XaeqKBXNs5CWV2Jd7',
image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
locale: 'auto',
token: function(token) {
console.log('TOKEN', token);
// You can access the token ID with `token.id`.
// Get the token ID to your server-side code for use.
$.post("stripe/stripe.php", {
stripeToken: token.id,
stripeEmail: token.email,
shirtSize: $('#shirt-size').val(),
amount: parseInt($('#contribution-amount').val()) * 100
})
.done(function(data) {
var results = JSON.parse(data);
console.log('data', results);
if (results.status && results.status === 'success') {
alert('Payment Success!');
$('#contribution-amount').val(null);
$('#shirt-size').val('');
} else {
alert('Sorry! Your credit card was declined. Please try again with a different card. Thank you!');
}
});
}
});
document.getElementById('contributeButton').addEventListener('click', function(e) {
// Open Checkout with further options:
var amount = parseInt($('#contribution-amount').val()) * 100;
handler.open({
name: 'Sh*tty Barn',
description: 'Contribution',
amount: amount,
shippingAddress: true
});
e.preventDefault();
});
// Close Checkout on page navigation:
window.addEventListener('popstate', function() {
handler.close();
});
</script>
</div>
</div>
</div>
</section>
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading">Contact us with questions</h2>
<hr class="my-4">
<p class="mb-5">Call us if you'd prefer to contribute via check, or if you are having trouble with your order.</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 ml-auto text-center">
<i class="fa fa-phone fa-3x mb-3 sr-contact"></i>
<p>608) 520-0605</p>
</div>
<div class="col-lg-4 mr-auto text-center">
<i class="fa fa-envelope-o fa-3x mb-3 sr-contact"></i>
<p>
<a href="mailto:[email protected]">[email protected]</a>
</p>
</div>
</div>
</div>
</section>
<!-- Bootstrap core JavaScript -->
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="vendor/scrollreveal/scrollreveal.min.js"></script>
<script src="vendor/magnific-popup/jquery.magnific-popup.min.js"></script>
<!-- Custom scripts for this template -->
<script src="js/creative.min.js"></script>
<script>
(function() {
$.get('stripe/total.php', function(total) {
if (total) {
var decimal = total / 100;
var percent = (decimal / 30000) * 100;
$('#total-raised').html(decimal.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
$('#total-goal').html('30,000');
// $('#progress-bar').html(
// `
// <div class="progress-bar bg-success" role="progressbar" style="width: ${percent.toString()}%" aria-valuenow="${percent.toString()}" aria-valuemin="0" aria-valuemax="100">${percent.toString()}</div>
// `
// );
}
});
})(jQuery)
</script>
</body>
</html>