cleaning the house

This commit is contained in:
mynah
2020-01-20 14:49:59 -06:00
parent 252ec865b3
commit 7dfd107c04
81 changed files with 426 additions and 958 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -1,62 +0,0 @@
article.heading{
width:100%;
height:55vh;
min-height:350px;
display: inline-block;
background-color: #333333;
text-align: center;
margin-top: 50px;
}
p.heading{
font-size:5em;
color:white;
color: white;
margin: 20vh auto auto auto;
}
article.shop{
justify-content:center;
-webkit-justify-content:center;
margin-top: 40px;
}
article.shop:hover{
background-color:rgba(240,240,240);
cursor:pointer;
}
a:link, a:visited {
text-decoration: none;
color:unset;
}
div.simage{
flex:3;
max-width:350px;
transition: .5s ease;
}
div.simage:hover{
transform:scale(1.2,1.2);
}
div.simage > img{
max-width:70%;
max-height:100%;
margin:auto;
display:block;
}
div.description{
flex:2;
max-width:250px;
}
p.description{ font-size:0.8em; }
p.title{font-weight:bold;}
p.promo{font-weight:bold; color:#C22A39;}
article.separator{
background-repeat: no-repeat;
background-image: url(" #path img/separa.jpg");
height: 20px;
background-size: contain;
background-position: center;
margin-top:30px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 KiB

View File

@@ -1,106 +0,0 @@
section.item{
background-size:cover;
background-attachment: fixed;
background-image:url("grulla_10.jpg");
background-position:center;
display:block;
padding:50px 0px 0px 0px;
}
section.transp{
background-color:rgba(255,255,255,0.8);
max-width: 1000px;
margin: auto;
padding: 20px 0px;
}
article.iimage{
flex:5 1;
margin:auto;
display:inline;
padding:0px 5px;
}
img.small{
border-radius:20px;
display:block;
width:auto;
height:100%;
min-height:60vh;
margin:auto;
padding:15px;
}
article.iinfo{
flex:4 1;
margin:auto;
padding: 5px 15px;
}
p.txt{
background-color:white;
font-size:1.2em;
padding: 20px;
text-align: center;
}
section.ibottom{
background: #C22A39;
padding:40px;
}
section.description{
background-color:white;
justify-content: center;
-webkit-justify-content: center;
}
p.promo{
color: #c22a39;
font-size: 1.4em;
text-align:right;
margin-right:10%;
font-weight:bold;
}
p.elow{
color: black;
font-size: 1.4em;
text-align:right;
margin-right:10%;
}
p.eldep{
color: #c22a39;
font-size: 1.4em;
text-align:right;
text-transform: uppercase;
margin-right:10%;
font-weight:bold;
}
div.ppl{
background-color: rgba(0,0,0,0.8);
border-radius: 25px;
padding:20px;
text-align: center;
}
p.nombre{
font-size: 2.2em;
color: white;
text-align: left;
margin: auto;
text-decoration: underline;
max-width:850px;
font-weight:bold;
}
p.tit{
font-size: 1.8em;
color: white;
text-align: center;
margin: 30px auto;
font-style: italic;
}

View File

@@ -1,131 +0,0 @@
var stripe = Stripe('pk_test_wxFt0GhsUK2YsprkLXa2iFrQ00nfjAeucu');
var elements = stripe.elements();
var cardElement = elements.create('card', {
style: {
base: {
//iconColor: '#c4f0ff',
iconColor: '#64a0af',
color: '#000000',
fontWeight: 500,
fontFamily: 'Roboto, Open Sans, Segoe UI, sans-serif',
fontSize: '18px',
fontSmoothing: 'antialiased',
':-webkit-autofill': {
color: '#fce883',
},
'::placeholder': {
// color: '#87BBFD',
color: '#87BBFD',
},
},
invalid: {
iconColor: '#8f577e',
color: '#8F577E',
},
},
});
cardElement.mount('#card-element');
var cardholderName = document.getElementById('cardholder-name');
var cardButton = document.getElementById('card-button');
///*y este el codigo de validación de la tarjeta*/
cardButton.addEventListener('click', function(ev) {
document.getElementById('cover').hidden = false;
document.getElementById("cover").style.opacity = "0.8";
stripe.createPaymentMethod('card', cardElement, {
billing_details: {name: cardholderName.value}
})
.then(function(result) {
// Show error in payment form
if (result.error) {
document.getElementById("cover").style.opacity = "0";
setTimeout(function(){ document.getElementById('cover').hidden = true;},500);
console.log("network error");
}
// Otherwise send paymentMethod.id to your server (see Step 2)
else {
fetch('/xpay', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ payment_method_id: result.paymentMethod.id, req:"precheck"})
})
.then(function(result) {
// Handle server response (see Step 3)
result.json().then(function(json) { handleInstallmentPlans(json); })
});
}
});
});
///*presenta los planes de pago */
const selectPlanForm = document.getElementById('installment-plan-form');
let availablePlans = [];
const handleInstallmentPlans = async (response) => {
if (response.error) { // Show error from server on payment form
console.log("preauth response error");
}
else {
// Store the payment intent ID.
document.getElementById('payment-intent-id').value = response.intent_id;
availablePlans = response.available_plans;
// Show available installment options
availablePlans.forEach((plan, idx) => {
const newInput = document.getElementById('immediate-plan').cloneNode();
newInput.setAttribute('value', idx);
newInput.setAttribute('id', '');
const label = document.createElement('label');
label.appendChild(newInput);
label.appendChild(
document.createTextNode(`${plan.count} meses`),
);
selectPlanForm.appendChild(label);
});
document.getElementById('cinfo').hidden = true;
document.getElementById('cplan').hidden = false;
}
document.getElementById("cover").style.opacity = "0";
setTimeout(function(){ document.getElementById('cover').hidden = true;},500);
};
// termina la transacción
const confirmButton = document.getElementById('confirm-button');
confirmButton.addEventListener('click', async (ev) => {
document.getElementById('cover').hidden = false;
document.getElementById("cover").style.opacity = "0.8";
const selectedPlanIdx = selectPlanForm.installment_plan.value;
const selectedPlan = availablePlans[selectedPlanIdx];
const intentId = document.getElementById('payment-intent-id').value;
const response = await fetch('/xpay', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
payment_intent_id: intentId,
selected_plan: selectedPlan,
req:"check"
}),
});
const responseJson = await response.json();
// Show success / error response.
document.getElementById("cover").style.opacity = "0";
setTimeout(function(){ document.getElementById('cover').hidden = true;},500);
document.getElementById('cmsg').hidden = false;
document.getElementById('cplan').hidden = true;
var message;
if (responseJson.status === "succeeded" && selectedPlan !== undefined) {
message = `¡Tu compra a ${
selectedPlan.count
} meses sin intereses se ha realizado con éxito! `;
} else if (responseJson.status === "succeeded") {
message = "¡Tu compra se ha realizado con éxito!";
} else {
message = `Tenemos un problema para verificar tus datos.
Por favor intenta de nuevo o comunícate con nosotros`;
}
document.getElementById("status-message").innerText = message;
});

View File

@@ -1,44 +0,0 @@
html{font-family:"serif";}
section.title{
/*background-color:#2f2c2c;*/
/*color:white;*/
}
article.title{
}
h2{
}
h1{
}
div#cover{
background: black;
z-index: 85;
position: fixed;
width: 100%;
height: 100%;
transition:opacity .4s linear;
top:0px;
opacity:0;
}
section.cardinfo{
}
div#details{
min-width:504px;
}
form{
text-align:center;
}
label{
text-align:center;
margin:auto;
}
input{
display:block;
margin:auto;
}
button{
}
div#card-element{
}

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 171 KiB

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

Before

Width:  |  Height:  |  Size: 493 KiB

After

Width:  |  Height:  |  Size: 493 KiB

View File

Before

Width:  |  Height:  |  Size: 493 KiB

After

Width:  |  Height:  |  Size: 493 KiB

View File

@@ -2,6 +2,7 @@
var it=1;
var students = new Array(10);
/* price format (comas) */
window.addEventListener('load', function() {
document.getElementById('cu').innerHTML=cu.toLocaleString();
document.getElementById('gt').innerHTML=cu.toLocaleString();
@@ -12,19 +13,25 @@ mq.addEventListener('change',function() {
var mult = cu*mq.value;
document.getElementById('gt').innerHTML=mult.toLocaleString();
});
/* ====================== */
/* hide contact form, show card info fields */
/* vars to hide contact form, show card info fields */
var cinfob = document.getElementById('cinfob');
var cinfo = document.getElementById('cinfo');
var cform = document.getElementById('cform');
var ccard = document.getElementById('ccard');
/* ====================== */
/* back button ========== */
cinfob.addEventListener('click', function(ev){
it --;
atof();
if (it==1){cinfob.hidden=true;}
});
/* ====================== */
/* fwd button============ */
cinfo.addEventListener('click', function(ev){
if (
(document.forms["cform"]["mname"].value =="") ||
@@ -33,18 +40,39 @@ cinfo.addEventListener('click', function(ev){
else if ( mq.value > it) {
students[it - 1]=ftoa();
it ++;
if(typeof students[it - 1]!== "undefined"){
atof();
}
if(typeof students[it - 1]!== "undefined"){ atof(); }
cinfob.hidden=false;
}
else {
students[it - 1]=ftoa();
cform.hidden = true;
ccard.hidden = false;
document.getElementById('cover').hidden = false;
document.getElementById("cover").style.opacity = "0.8";
fetch('/spay/userCheck', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ students:students, req:"precheck", mq:mq.value})
})
.then((response) => response.json())
.then((data) => {
if(data.userst == "0"){
cform.hidden = true;
ccard.hidden = false;
}
else{ alert("hay un error en los datos de alumnos"); }
})
.catch((error) => {
console.error('Error:', error);
});
document.getElementById("cover").style.opacity = "0";
setTimeout(function(){ document.getElementById('cover').hidden = true;},500);
}
});
/* ====================== */
/* save form to array=== */
function ftoa(){
var rad;
if (document.getElementById('r2').checked) { rad = document.getElementById('r2').value; }
@@ -63,17 +91,21 @@ function ftoa(){
return x;
}
/* ====================== */
/* load form from array=== */
function atof(){
document.forms["cform"]["mname"].value = students[it-1][0];
document.forms["cform"]["mmail"].value = students[it-1][1];
document.getElementById('obs').value = students[it-1][2];
if(document.getElementById('r2').value == students[it-1][3]){ document.getElementById('r2').checked=true;}
if(document.getElementById('r1').value == students[it-1][3]){ document.getElementById('r1').checked=true;}
if(document.getElementById('r3').value == students[it-1][3]){ document.getElementById('r3').checked=true;}
document.forms["cform"]["mname"].value = students[it-1][0];
document.forms["cform"]["mmail"].value = students[it-1][1];
document.getElementById('obs').value = students[it-1][2];
if(document.getElementById('r2').value == students[it-1][3]){ document.getElementById('r2').checked=true;}
if(document.getElementById('r1').value == students[it-1][3]){ document.getElementById('r1').checked=true;}
if(document.getElementById('r3').value == students[it-1][3]){ document.getElementById('r3').checked=true;}
}
/* ====================== */
/* stripe magic begins here */
/* ====================================================== */
var stripe = Stripe('pk_test_wxFt0GhsUK2YsprkLXa2iFrQ00nfjAeucu');
var elements = stripe.elements();
var cardElement = elements.create('card', {
@@ -125,7 +157,7 @@ cardButton.addEventListener('click', function(ev) {
fetch('/spay/intentCreate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ payment_method_id: result.paymentMethod.id, req:"precheck", qantity:mq.value, tid:tid})
body: JSON.stringify({ payment_method_id: result.paymentMethod.id, req:"precheck", mq:mq.value, tid:tid})
})
.then(function(result) {
// Handle server response (see Step 3)
@@ -144,6 +176,7 @@ const handleInstallmentPlans = async (response) => {
console.log("preauth response error");
}
else {
// si avaliable plans es indefinido, se queda alli con el cover
// Store the payment intent ID.
document.getElementById('payment-intent-id').value = response.intent_id;
availablePlans = response.available_plans;