teenybeanspreschoolcurricul.../src/components/HeroButton.vue

143 lines
6.2 KiB
Vue

<template>
<div>
<div class="grid grid-cols-7 place-items-center pt-6 w-fit p-4">
<div @click="showAbModal('abModal')" class="rounded-tl-full text-sm xl:text-lg rounded-br-full col-span-3 shadow-2xl text-blue-700 px-4 md:px-8 p-3 border-2 border-blue-700 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300"> <button>Speak with Us</button></div>
<div class="grid text-base xl:text-base col-span-1 font-bold text-color-2">OR</div>
<div class="rounded-tl-full text-sm xl:text-base rounded-br-full col-span-3 text-white shadow-2xl px-4 md:px-8 p-3 bg-blue-700 te border-2 border-blue-700 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300"><a href="/themes"><button>Check Out Event</button></a></div>
</div>
<!-- <div @click="showAbModal('abModal')"> Show Modal</div> -->
<!-- Modal -->
<div v-if="abModal" id="ytModal" class="flex justify-center abModal">
<div class="modal-content" @click="doNothing()">
<span @click="hideAbModal" class="close">&times;</span>
<div>
<div class="block p-6 shadow-lg bg-white border-2 2xl:w-96 text-xl" style="background-color: #f5f6d7;">
<p class="text-blue-700 text-3xl font-semibold p-1">Get in Touch</p>
<div v-if="BlogQry">
<div class="form-group mb-1">
<label for="exampleInputName" class="form-label inline-block mb-2 text-gray-700">Your Name</label>
<input v-model="indexname" type="text" class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none">
</div>
<div class="form-group mb-1">
<label for="exampleInputEmail" class="form-label inline-block mb-2 text-gray-700">Your Email</label>
<input v-model="indexemail" type="email" class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none">
</div>
<div class="form-group mb-1">
<label for="exampleInputPhoneNumber" class="form-label inline-block mb-2 text-gray-700">Your Phone Number</label>
<input v-model="indexnumber" type="text" class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none">
</div>
<div class="form-group mb-1">
<label for="exampleInputPhoneNumber" class="form-label inline-block mb-2 text-gray-700">Write your Description....</label>
<textarea v-model="indexdescription" type="text" class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none"></textarea>
</div>
<div class="flex justify-end pt-2">
<button @click="saveBlogQry" class="px-2 py-2.5 bg-blue-600 text-white font-medium text-lg leading-tight uppercase rounded-tl-xl rounded-br-xl shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out">Send</button>
</div>
</div>
<div v-else>
<h1 class="text-center p-16 py-32 text-3xl text-color-1">Thank You</h1>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
abModal:false,
abID:'',
indexname: null,
indexemail: null,
indexnumber: null,
BlogQry: true,
indexdescription:null,
}
},
methods: {
showAbModal(abID){
this.abModal=true
this.abID=abID
},
hideAbModal(){
this.abModal=false
// // this.abID=abID
},
doNothing(){
// alert();
},
saveBlogQry(){
let formData = new FormData();
formData.append('Name', this.indexname);
formData.append('Email', this.indexemail);
formData.append('Phone', this.indexnumber);
formData.append('Message', this.indexdescription);
formData.append('formName', 'index-get-in-touch');
fetch('https://api.teenybeans.in/API/contactFormProcessor/v1/',
{
method: 'POST',
body: formData,
}
)
.then(response => response.json())
.then(data => {
// console.log(data)
});
// formData=""
this.BlogQry=false
}
},
mounted: function () {
// this.getVideos()
}
}
</script>
<style scoped>
.abModal {
/* display: none; */
position: fixed;
width: 80%;
z-index: 999991;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
.modal-content{
/* background-color: aliceblue; */
padding: 20px;
/* border: 1px solid #888; */
width: fit-content;
margin: 0 auto;
}
.close {
color: rgb(40, 99, 226);
float: right;
font-size: 28px;
padding: 10px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: rgb(40, 99, 226);
text-decoration: none;
padding: 10px;
cursor: pointer;
font-size: 28px;
background-color: rgb(237, 240, 239);
border-radius: 100%;
}
</style>