generated from dwd/boilarplate-astro-tailwind
146 lines
7.4 KiB
Plaintext
146 lines
7.4 KiB
Plaintext
---
|
||
import Layout from "../layouts/Layout.astro";
|
||
---
|
||
<Layout title="">
|
||
<main>
|
||
<div>
|
||
<section class="container-fluid gradintBack">
|
||
<div class="container mx-auto px-4 flex flex-col-reverse lg:flex-row place-items-center">
|
||
<div class="w-full">
|
||
<img class="lg:max-w-2xl" src="/img/rec_girl.png" alt="">
|
||
</div>
|
||
<div class="flex flex-col w-full">
|
||
<h1 class="text-3xl md:text-4xl lg:text-5xl text-[#47ae6a]">Get in Touch with Holywisdom Preschool!</h1>
|
||
<h2 class="text-2xl md:text-3xl text-[#3084b5] py-4">Contact us for a brighter start at Holywisdom Preschool!</h2>
|
||
<h3 class="text-xl text-justify pb-4">Drop us a line at Holywisdom Preschool – your gateway to educational excellence!</h3>
|
||
<!-- <div class="flex flex-row place-content-between">
|
||
<a href="#" class="text-sm xl:text-lg rounded-lg shadow-2xl text-[#3084b5] px-4 md:px-8 p-3 border-2 border-[#3084b5] transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300">Get in Touch</a>
|
||
</div> -->
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section class="container mx-auto px-4 my-10">
|
||
<div class="">
|
||
<h1 class="text-2xl">Reach Out to Holywisdom Preschool</h1>
|
||
<p class="">Contacting Holywisdom Preschool is your first step toward a seamless connection with our dedicated team. Whether you have inquiries about our programs, enrollment details, or simply want to learn more about our unique approach to early childhood education, we're here to help. Your child's journey with us begins with a conversation. Reach out through the provided contact information, and let's embark on the path of educational discovery together. We look forward to hearing from you and welcoming your family into the Holywisdom community.</p>
|
||
</div>
|
||
</section>
|
||
<section class="container mx-auto px-4 my-16">
|
||
<div class="grid grid-cols-1 md:grid-cols-2 bg-[#47ae6a50] justify-center p-6 rounded-2xl gap-x-10">
|
||
<div class="flex flex-col justify-center">
|
||
<p class="text-2xl md:text-3xl lg:text-3xl text-[#3084b5]">Have You Any Doubt or Any Quries</p>
|
||
<p class="text-justify text-lg pt-4 ">Feel the freedom to write any questions or uncertainties—our door is always open for your curiosity. Your queries are more than welcome in our space of knowledge and assistance. Let your questions find their answers, and let the conversation unfold. We're here for you!</p>
|
||
</div>
|
||
<div id="contactForm" class="flex flex-col justify-center w-full">
|
||
<form id="formSection" action="">
|
||
<p class="text-2xl py-4">Write your Qurie</p>
|
||
<div class="pb-3">
|
||
<label for="name">Name:<span class=text-red-500>*</span></label>
|
||
<input id="name" name="name" type="text" placeholder="Enter your Name" class="focus:border-2 border-[#3084b5] focus:outline-none rounded-lg w-full p-2"/>
|
||
</div>
|
||
<div>
|
||
<label for="phone">Mobile:<span class=text-red-500>*</span></label>
|
||
<input id="phone" name="phone" type="text" placeholder="Enter your Mobile Number" class="focus:border-2 border-[#3084b5] focus:outline-none rounded-lg w-full p-2"/>
|
||
</div>
|
||
<div class="py-3">
|
||
<label for="email">E-mail ID:<span class=text-red-500>*</span></label>
|
||
<input id="email" name="email" type="text" placeholder="Enter your E-mail ID" class="focus:border-2 border-[#3084b5] focus:outline-none rounded-lg w-full p-2"/>
|
||
</div>
|
||
<div>
|
||
<label for="message">Write your Qurie:<span class=text-red-500>*</span></label>
|
||
<textarea id="message" name="message" rows="7" placeholder="Write your Qurie" class="focus:border-2 border-[#3084b5] focus:outline-none rounded-lg w-full p-2"></textarea>
|
||
</div>
|
||
<div class="">
|
||
<input type="submit" value="Submit" class="bg-[#3084b5] text-white rounded-lg py-2.5 px-6 float-right"/>
|
||
</div>
|
||
</form>
|
||
<div class="flex" id="thankYouSection" style="display: none;">
|
||
<h1 class="text-center text-black text-4xl">Thank You</h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</main>
|
||
</Layout>
|
||
<script is:inline>
|
||
document.addEventListener('DOMContentLoaded', function () {
|
||
const contactForm = document.getElementById('contactForm');
|
||
const formSection = document.getElementById('formSection');
|
||
const thankYouSection = document.getElementById('thankYouSection');
|
||
const nameInput = document.getElementById('name');
|
||
const emailInput = document.getElementById('email');
|
||
const phoneInput = document.getElementById('phone');
|
||
const messageInput = document.getElementById('message');
|
||
|
||
contactForm.addEventListener('submit', async function (event) {
|
||
event.preventDefault();
|
||
let data = {
|
||
data:{
|
||
name: nameInput.value,
|
||
phone: phoneInput.value,
|
||
email: emailInput.value,
|
||
message: messageInput.value
|
||
},
|
||
owner: "Holly Wisdom Public School",
|
||
domain: window.location.origin,
|
||
referrer: "Holly Wisdom Public School"
|
||
}
|
||
console.log("Form Data", data)
|
||
const url = 'https://api.siliconpin.com/v3/contact-form-processor/';
|
||
try {
|
||
const response = await fetch(url, {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type': 'application/json'
|
||
},
|
||
body: JSON.stringify(data)
|
||
});
|
||
if (response.ok) {
|
||
console.log('Form data submitted successfully');
|
||
formSection.style.display = 'none';
|
||
thankYouSection.style.display = 'block';
|
||
} else {
|
||
console.error('Failed to submit form data');
|
||
}
|
||
} catch (error) {
|
||
console.error('An error occurred:', error);
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
<style>
|
||
.gradintBack {
|
||
background: linear-gradient(0deg, rgb(71, 174, 106) 0%, rgba(255, 255, 255) 40%);
|
||
}
|
||
</style>
|
||
|
||
<!-- function submitForm(){
|
||
const formData = {
|
||
data: {
|
||
name: document.getElementById('name').value,
|
||
email: document.getElementById('email').value,
|
||
phone: document.getElementById('phone').value
|
||
},
|
||
owner: document.getElementById('owner').value,
|
||
domain: document.getElementById('domain').value,
|
||
referrer: document.getElementById('referrer').value
|
||
};
|
||
fetch(`http://192.168.0.166:2053/v3/contact-form/`, {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type' : 'application/json',
|
||
},
|
||
body: JSON.stringify(formData)
|
||
})
|
||
.then(response => {
|
||
if(response.ok){
|
||
console.log('Form submitted succesfully!');
|
||
}else{
|
||
console.log('Form submitted faild!');
|
||
}
|
||
})
|
||
.then(error => {
|
||
console.error('an error occoured', error);
|
||
})
|
||
} --> |