From 9d6486f5506399001f7d18d359899911fb5a6f37 Mon Sep 17 00:00:00 2001 From: Nia Williams Date: Tue, 14 Aug 2018 19:06:04 +0000 Subject: [PATCH 1/2] made changes --- donate.html | 1 + js/shopify.js | 1230 +++++++++++++++++++++++++++------------------ shop.html | 2 +- shopify.html | 33 ++ stripe.html | 102 ++++ stripe.js | 264 ++++++++++ styles/styles.css | 461 +++++++++++++++-- 7 files changed, 1573 insertions(+), 520 deletions(-) create mode 100644 shopify.html create mode 100644 stripe.html create mode 100644 stripe.js diff --git a/donate.html b/donate.html index 7d1274b..52a3ba0 100644 --- a/donate.html +++ b/donate.html @@ -7,6 +7,7 @@ + diff --git a/js/shopify.js b/js/shopify.js index d8ff0b8..1ea4b45 100644 --- a/js/shopify.js +++ b/js/shopify.js @@ -1,547 +1,823 @@ - //t shirt - /**/ + }); + } +})(); +/*]]>*/ - - - - - - // tote bag - /**/ + +// tote bag +/**/ - \ No newline at end of file + }); + } +})(); +/*]]>*/ + +var myVar; + +function myFunction() { + myVar = setTimeout(showPage, 1300); +} + +function showPage() { + document.getElementById("Loader").style.display = "none"; + document.getElementById("myDiv").style.display = "block"; +} \ No newline at end of file diff --git a/shop.html b/shop.html index 9860754..e1a7f13 100644 --- a/shop.html +++ b/shop.html @@ -6,7 +6,7 @@ - + diff --git a/shopify.html b/shopify.html new file mode 100644 index 0000000..d3b9ee8 --- /dev/null +++ b/shopify.html @@ -0,0 +1,33 @@ + + + + + + + + + + +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ + + + + + \ No newline at end of file diff --git a/stripe.html b/stripe.html new file mode 100644 index 0000000..eb7c71b --- /dev/null +++ b/stripe.html @@ -0,0 +1,102 @@ + + + + + + + + + +
+
+
+ +
+
+ Pay with card + Or enter card details +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+
+ +
+ + +
+ + + +
+ + + +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + + \ No newline at end of file diff --git a/stripe.js b/stripe.js new file mode 100644 index 0000000..83c0c52 --- /dev/null +++ b/stripe.js @@ -0,0 +1,264 @@ +'use strict'; +var stripe = Stripe('pk_test_1mUYabOqDa27wuLOlWVWKt5x'); +/*global Stripe */ +function registerElements(elements, exampleName) { + var formClass = '.' + exampleName; + var example = document.querySelector(formClass); + + var form = example.querySelector('form'); + var resetButton = example.querySelector('a.reset'); + var error = form.querySelector('.error'); + var errorMessage = error.querySelector('.message'); + + function enableInputs() { + Array.prototype.forEach.call( + form.querySelectorAll( + "input[type='text'], input[type='email'], input[type='tel']" + ), + function(input) { + input.removeAttribute('disabled'); + } + ); + } + + function disableInputs() { + Array.prototype.forEach.call( + form.querySelectorAll( + "input[type='text'], input[type='email'], input[type='tel']" + ), + function(input) { + input.setAttribute('disabled', 'true'); + } + ); + } + + function triggerBrowserValidation() { + // The only way to trigger HTML5 form validation UI is to fake a user submit + // event. + var submit = document.createElement('input'); + submit.type = 'submit'; + submit.style.display = 'none'; + form.appendChild(submit); + submit.click(); + submit.remove(); + } + + // Listen for errors from each Element, and show error messages in the UI. + var savedErrors = {}; + elements.forEach(function(element, idx) { + element.on('change', function(event) { + if (event.error) { + error.classList.add('visible'); + savedErrors[idx] = event.error.message; + errorMessage.innerText = event.error.message; + } + else { + savedErrors[idx] = null; + + // Loop over the saved errors and find the first one, if any. + var nextError = Object.keys(savedErrors) + .sort() + .reduce(function(maybeFoundError, key) { + return maybeFoundError || savedErrors[key]; + }, null); + + if (nextError) { + // Now that they've fixed the current error, show another one. + errorMessage.innerText = nextError; + } + else { + // The user fixed the last error; no more errors. + error.classList.remove('visible'); + } + } + }); + }); + + // Listen on the form's 'submit' handler... + form.addEventListener('submit', function(e) { + e.preventDefault(); + + // Trigger HTML5 validation UI on the form if any of the inputs fail + // validation. + var plainInputsValid = true; + Array.prototype.forEach.call(form.querySelectorAll('input'), function( + input + ) { + if (input.checkValidity && !input.checkValidity()) { + plainInputsValid = false; + return; + } + }); + if (!plainInputsValid) { + triggerBrowserValidation(); + return; + } + + // Show a loading screen... + example.classList.add('submitting'); + + // Disable all inputs. + disableInputs(); + + // Gather additional customer data we may have collected in our form. + var name = form.querySelector('#' + exampleName + '-name'); + var address1 = form.querySelector('#' + exampleName + '-address'); + var city = form.querySelector('#' + exampleName + '-city'); + var state = form.querySelector('#' + exampleName + '-state'); + var zip = form.querySelector('#' + exampleName + '-zip'); + var additionalData = { + name: name ? name.value : undefined, + address_line1: address1 ? address1.value : undefined, + address_city: city ? city.value : undefined, + address_state: state ? state.value : undefined, + address_zip: zip ? zip.value : undefined, + }; + + // Use Stripe.js to create a token. We only need to pass in one Element + // from the Element group in order to create a token. We can also pass + // in the additional customer data we collected in our form. + stripe.createToken(elements[0], additionalData).then(function(result) { + // Stop loading! + example.classList.remove('submitting'); + + if (result.token) { + // If we received a token, show the token ID. + example.querySelector('.token').innerText = result.token.id; + example.classList.add('submitted'); + } + else { + // Otherwise, un-disable inputs. + enableInputs(); + } + }); + }); + + resetButton.addEventListener('click', function(e) { + e.preventDefault(); + // Resetting the form (instead of setting the value to `''` for each input) + // helps us clear webkit autofill styles. + form.reset(); + + // Clear each Element. + elements.forEach(function(element) { + element.clear(); + }); + + // Reset error state as well. + error.classList.remove('visible'); + + // Resetting the form does not un-disable inputs, so we need to do it separately: + enableInputs(); + example.classList.remove('submitted'); + }); +} +(function() { + "use strict"; + + var elements = stripe.elements({ + // Stripe's examples are localized to specific languages, but if + // you wish to have Elements automatically detect your user's locale, + // use `locale: 'auto'` instead. + locale: window.__exampleLocale + }); + + /** + * Card Element + */ + var card = elements.create("card", { + iconStyle: "solid", + style: { + base: { + iconColor: "#fff", + color: "#fff", + fontWeight: 400, + fontFamily: "Helvetica Neue, Helvetica, Arial, sans-serif", + fontSize: "16px", + fontSmoothing: "antialiased", + + "::placeholder": { + color: "#676868" + }, + ":-webkit-autofill": { + color: "#fce883" + } + }, + invalid: { + iconColor: "#FFC7EE", + color: "#FFC7EE" + } + } + }); + card.mount("#example5-card"); + + /** + * Payment Request Element---how much they pay + */ + var paymentRequest = stripe.paymentRequest({ + country: "US", + currency: "usd", + total: { + amount: 2500, + label: "Total" + }, + requestShipping: true, + shippingOptions: [{ + id: "free-shipping", + label: "Free shipping", + detail: "Arrives in 5 to 7 days", + amount: 0 + }] + }); + paymentRequest.on("token", function(result) { + var example = document.querySelector(".example5"); + example.querySelector(".token").innerText = result.token.id; + example.classList.add("submitted"); + result.complete("success"); + }); + + var paymentRequestElement = elements.create("paymentRequestButton", { + paymentRequest: paymentRequest, + style: { + paymentRequestButton: { + theme: "light" + } + } + }); + + paymentRequest.canMakePayment().then(function(result) { + if (result) { + document.querySelector(".example5 .card-only").style.display = "none"; + document.querySelector( + ".example5 .payment-request-available" + ).style.display = + "block"; + paymentRequestElement.mount("#example5-paymentRequest"); + } + }); + + registerElements([card], "example5"); +})(); + +var myVar; + +function myFunction() { + myVar = setTimeout(showPage, 3000); +} + +function showPage() { + document.getElementById("loader").style.display = "none"; + document.getElementById("myDiv").style.display = "block"; +} + +$('.donate-button').click(function(event) { + var self = $(this); + var amount = 0; + amount = $('#custom-donation-amount').val(); + if (amount === "") { + amount = 50; + } + + amount = self.attr('data-amount'); + amount = Math.abs(amount * 100); +}); +/*global $*/ \ No newline at end of file diff --git a/styles/styles.css b/styles/styles.css index a4c8af0..add9cb1 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -88,7 +88,7 @@ a { #myTopNav2 { transition: opacity 1s ease-out; opacity: 0; - height: 0; + height: auto; } .nav-logo { @@ -145,7 +145,6 @@ a { position: relative; } } - /*for program.html*/ @media screen and (max-width:835px) { @@ -184,11 +183,9 @@ a { position: relative!important; } } - /*for index.html*/ @media screen and (max-width:835px) {} - /*for about.html*/ @media screen and (max-width:835px) { @@ -615,13 +612,11 @@ height:200em; /*General*/ - body { background-color: #1B1C1E; } /* Shopify*/ - .lined { display: flex; justify-content: space-around; @@ -649,7 +644,6 @@ button:active { } /*from the stripe file*/ - .donation-box { background-color: #1B1C1E; padding: 5px; @@ -662,7 +656,6 @@ button:active { max-width: 100%; } } - /*size of the donation box*/ .donation-box { @@ -670,7 +663,6 @@ button:active { font-size: 16px; font-weight: 400; } - /*font style*/ .PaymentRequest { @@ -678,7 +670,6 @@ button:active { width: 100%; margin-bottom: 10px; } - /*size fixing*/ .donation-box fieldset { @@ -686,7 +677,6 @@ button:active { padding: 15px; border-radius: 6px; } - /*border*/ .donation-box fieldset legend { @@ -697,25 +687,21 @@ button:active { font-weight: 500; color: #fff; } - /*top words*/ .donation-box fieldset legend { clear: both; } - /*clears fields*/ .donation-box .card-only { display: block; } - /*displays fields accordingly*/ .donation-box .payment-request-available { display: none; } - /*clearing unwanted text*/ .donation-box .row { @@ -723,20 +709,17 @@ button:active { display: flex; margin: 0 0 10px; } - /*field display fixing*/ .donation-box .field { position: relative; width: 100%; } - /*fixes the bottom field row*/ .donation-box .field+.field { margin-left: 10px; } - /*moves things from the left*/ .donation-box label { @@ -748,7 +731,6 @@ button:active { text-overflow: ellipsis; white-space: nowrap; } - /*field titles*/ .donation-box .input { @@ -759,38 +741,32 @@ button:active { border-bottom: 1px solid #424746; transition: border-color 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); } - /*fixes the field rows*/ .donation-box .input::-webkit-input-placeholder { color: #676868; } - /*placeholder text color*/ .donation-box .input::-moz-placeholder { color: #676868; } - /*more placeholder coloring*/ .donation-box .input:-ms-input-placeholder { color: #676868; } - /*even more placeholder coloring*/ .donation-box .input.StripeElement--focus, .donation-box .input:focus { border-color: #fff; } - /*field title text color*/ .donation-box .input.StripeElement--invalid { border-color: #ffc7ee; } - /*invalid text color*/ .donation-box input:-webkit-autofill, @@ -799,13 +775,11 @@ button:active { transition: background-color 100000000s; -webkit-animation: 1ms void-animation-out; } - /*error message color*/ .donation-box .StripeElement--webkit-autofill { background: transparent !important; } - /*transperancy for something???*/ .donation-box input, @@ -819,7 +793,6 @@ button:active { border-style: none; border-radius: 0; } - /*border control*/ .donation-box select.input, @@ -832,7 +805,6 @@ button:active { text-overflow: ellipsis; padding-right: 20px; } - /*this does nothing???*/ .donation-box button { @@ -846,31 +818,26 @@ button:active { font-weight: 500; cursor: pointer; } - /*pay button display*/ .donation-box button:active { background-color: #68B4AD; } - /*button click color*/ .donation-box button:hover { background-color: #68B4AD; } - /*button hover color*/ .donation-box .error svg .base { fill: #fff; } - /*requirement error color*/ .donation-box .error svg .glyph { fill: #9169d8; } - /*credit card error color*/ .donation-box .error .message { @@ -890,28 +857,24 @@ button:active { .donation-box .success .icon .border { stroke: #bfaef6; } - /*successful payment border color*/ .donation-box .success .icon .checkmark { stroke: #fff; } - /*checkmark color*/ .donation-box .success .title { color: #fff; } - /*successful title color*/ .donation-box .success .message { color: #cdd0f8; } - /*success message color*/ .donation-box .success .reset path { fill: #fff; } - /*reset path color*/ + /* Center the loader */ #loader { position: absolute; @@ -1000,8 +963,8 @@ button:active { position: relative; } } - /*for program.html*/ + @media screen and (max-width:835px) { .programs { display: flex; @@ -1038,11 +1001,11 @@ button:active { position: relative !important; } } - /*for index.html*/ + @media screen and (max-width:835px) {} - /*for about.html*/ + @media screen and (max-width:835px) { .organizers { display: flex; @@ -1078,5 +1041,419 @@ button:active { } } + + @media screen and (max-width:635px) { + + ul.nav li:not(:first-child) { + display: none; + } + ul.nav li:first-child { + position: absolute; + left: -1.5em; + } + ul.nav li:nth-child(2) { + margin-top: 3em; + } + .nav-logo { + height: 3em; + margin-top: 0; + + } + ul.nav { + flex-direction: column; + } + + ul.nav li.icon { + display: block; + position: absolute; + top: 0; + right: .9em; + } + ul.nav.responsive li { + display: block; + } +} @media screen and (max-width:600px) {} + + /*General*/ +body { + background-color: #333; +} + +/* Shopify*/ +.lined { + display: flex; + justify-content: space-around; + flex-wrap: wrap; +} + +.product2 { + margin-top: 35px; +} + +/*.product2 {*/ +/* margin-top: 35px;*/ +/*}*/ + +.dots { + display: flex; + justify-content: center; + align-items: center; + /*margin-left:100em;*/ + height:100vh; +} + +.fa-spinner { + color:#74c8c0; +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +.animate-bottom { + position: relative; + -webkit-animation-name: animatebottom; + -webkit-animation-duration: 1s; + animation-name: animatebottom; + animation-duration: 1s; +} + +@-webkit-keyframes animatebottom { + from { + bottom: -100px; + opacity: 0 + } + to { + bottom: 0px; + opacity: 1 + } +} + +@keyframes animatebottom { + from { + bottom: -100px; + opacity: 0 + } + to { + bottom: 0; + opacity: 1 + } +} + +#myDiv { + display: none; + text-align: center; +} + +/*Stripe*/ +.donation-box { + background-color: #333; + padding: 5px; + max-width: 100%; + margin: auto; +} + +@media (max-width:400px) { + .donation-box { + max-width: 100%; + } +} +/*size of the donation box*/ + +.donation-box { + font-family: Helvetica Neue, Helvetica, Arial, sans-serif; + font-size: 16px; + font-weight: 400; +} +/*font style*/ + +.PaymentRequest { + max-width: 500px; + width: 100%; + margin-bottom: 10px; +} +/*size fixing*/ + +.donation-box fieldset { + border: 1px solid #424746; + padding: 15px; + border-radius: 6px; +} +/*border*/ + +.donation-box fieldset legend { + margin: 0 auto; + padding: 0 10px; + text-align: center; + font-size: 14px; + font-weight: 500; + color: #fff; +} +/*top words*/ + +.donation-box fieldset legend { + clear: both; +} +/*clears fields*/ + +.donation-box .card-only { + display: block; +} +/*displays fields accordingly*/ + +.donation-box .payment-request-available { + display: none; +} +/*clearing unwanted text*/ + +.donation-box .row { + display: -ms-flexbox; + display: flex; + margin: 0 0 10px; +} +/*field display fixing*/ + +.donation-box .field { + position: relative; + width: 100%; +} +/*fixes the bottom field row*/ + +.donation-box .field+.field { + margin-left: 10px; +} +/*moves things from the left*/ + +.donation-box label { + width: 100%; + color: #fff; + font-size: 13px; + font-weight: 500; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +/*field titles*/ + +.donation-box .input { + width: 100%; + color: #fff; + background: transparent; + padding: 5px 0 6px 0; + border-bottom: 1px solid #424746; + transition: border-color 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); +} +/*fixes the field rows*/ + +.donation-box .input::-webkit-input-placeholder { + color: #676868; +} +/*placeholder text color*/ + +.donation-box .input::-moz-placeholder { + color: #676868; +} +/*more placeholder coloring*/ + +.donation-box .input:-ms-input-placeholder { + color: #676868; +} +/*even more placeholder coloring*/ + +.donation-box .input.StripeElement--focus, +.donation-box .input:focus { + border-color: #fff; +} +/*field title text color*/ + +.donation-box .input.StripeElement--invalid { + border-color: #ffc7ee; +} +/*invalid text color*/ + +.donation-box input:-webkit-autofill, +.donation-box select:-webkit-autofill { + -webkit-text-fill-color: #fce883; + transition: background-color 100000000s; + -webkit-animation: 1ms void-animation-out; +} +/*error message color*/ + +.donation-box .StripeElement--webkit-autofill { + background: transparent !important; +} +/*transperancy for something???*/ + +.donation-box input, +.donation-box button, +.donation-box select { + -webkit-animation: 1ms void-animation-out; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + outline: none; + border-style: none; + border-radius: 0; +} +/*border control*/ + +.donation-box select.input, +.donation-box select:-webkit-autofill { + background-image: url('data:image/svg+xml;utf8,'); + background-position: 100%; + background-size: 10px 5px; + background-repeat: no-repeat; + overflow: hidden; + text-overflow: ellipsis; + padding-right: 20px; +} +/*this does nothing???*/ + +.donation-box button { + display: block; + width: 100%; + height: 40px; + margin: 20px 0 0; + background-color: #74C8C0; + border-radius: 6px; + color: #fff; + font-weight: 500; + cursor: pointer; +} +/*pay button display*/ + +.donation-box button:active { + background-color: #68B4AD; +} +/*button click color*/ + +.donation-box button:hover { + background-color: #68B4AD; +} +/*button hover color*/ + +.donation-box .error svg .base { + fill: #fff; +} +/*requirement error color*/ + +.donation-box .error svg .glyph { + fill: #9169d8; +} +/*credit card error color*/ + +.donation-box .error .message { + color: #fff; +} +/*requirement error color*/ + +.donation-box .success .icon .border { + stroke: #bfaef6; +} +/*successful payment border color*/ + +.donation-box .success .icon .checkmark { + stroke: #fff; +} +/*checkmark color*/ + +.donation-box .success .title { + color: #fff; +} +/*successful title color*/ + +.donation-box .success .message { + color: #cdd0f8; +} +/*success message color*/ + +.donation-box .success .reset path { + fill: #fff; +} +/*reset path color*/ + +/* Center the loader */ +#loader { + position: absolute; + left: 50%; + top: 50%; + z-index: 1; + width: 150px; + height: 150px; + margin: -75px 0 0 -75px; + border: 16px solid #f3f3f3; + border-radius: 50%; + border-top: 16px solid #3498db; + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear once; +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +/* Add animation to "page content" */ +.animate-bottom { + position: relative; + -webkit-animation-name: animatebottom; + -webkit-animation-duration: 1s; + animation-name: animatebottom; + animation-duration: 1s +} + +@-webkit-keyframes animatebottom { + from { + bottom: -100px; + opacity: 0 + } + to { + bottom: 0px; + opacity: 1 + } +} + +@keyframes animatebottom { + from { + bottom: -100px; + opacity: 0 + } + to { + bottom: 0; + opacity: 1 + } +} + +#myDiv { + display: none; + text-align: center; +} \ No newline at end of file From 3b2b8ca0f6c49700dce96ab3a77ac3a3a95dfc09 Mon Sep 17 00:00:00 2001 From: Nia Williams Date: Wed, 15 Aug 2018 19:19:31 +0000 Subject: [PATCH 2/2] more changes --- styles/styles.css | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/styles/styles.css b/styles/styles.css index add9cb1..44caee4 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -234,7 +234,6 @@ a { height: 6em; } - .drummerteamimg { width: 12.5em; height: 18em; @@ -287,7 +286,6 @@ b { font-size: 1.8em; } - footer { /*background-color: black;*/ width: 100%; @@ -545,8 +543,6 @@ ul.fa-ul { align-self: center; } - - .tagline { font-size: 3em; font-family: sans-serif; @@ -570,7 +566,6 @@ ul.fa-ul { align-self: center; } - .cpa { width: 15em; } @@ -597,7 +592,6 @@ button:active { border-radius: 10px; } - @media screen and (min-width:320px){ .fixed { height:200em; @@ -643,7 +637,7 @@ button:active { border-radius: 10px; } -/*from the stripe file*/ +/*From the stripe file*/ .donation-box { background-color: #1B1C1E; padding: 5px;