Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,28 @@ window.addEventListener("scroll", function () {
header.classList.remove("active");
backTopBtn.classList.remove("active");
}
});
});

// Hero form variables
const heroForm = document.querySelector("[data-hero-form]");
const heroFormInput = document.querySelector("[data-hero-form-input]");
const successMessage = document.getElementById("hero-success-message");

// Listen for form submit
heroForm.addEventListener("submit", function (e) {
e.preventDefault(); // Prevent the default form submission

// Check if the form is valid
if (heroForm.checkValidity()) {
// Show success message
successMessage.style.display = "block";

// Clear the form input field
heroFormInput.value = "";

// Hide the success message after 3 seconds
setTimeout(() => {
successMessage.style.display = "none";
}, 3000);
}
});
21 changes: 7 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,11 @@ <h2 class="h1 hero-title">Make Chat Easy For Today's Digital Customers</h2>
increase your sale.
</p>

<form action="" class="hero-form">
<input type="email" name="email_address" placeholder="Enter Your Email" aria-label="Enter Your Email"
required class="input-field">

<form action="" class="hero-form" data-hero-form>
<input type="email" name="email_address" placeholder="Enter Your Email" aria-label="Enter Your Email" required class="input-field" data-hero-form-input>
<button type="submit" class="btn btn-primary">Start Free Trial</button>
</form>

<div id="hero-success-message" style="display: none; color: green;">Thank you! Your email has been successfully submitted.</div>
<ul class="hero-list">

<li class="hero-item">
Expand Down Expand Up @@ -173,9 +171,7 @@ <h2 class="h1 hero-title">Make Chat Easy For Today's Digital Customers</h2>
<h2 class="h2 section-title">Our Solutions For You</h2>

<p class="section-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet nulla duis ac. Id massa scelerisque
venenatis,
massa gravida donec orci.
We offer a variety of innovative solutions tailored to meet your business needs. Whether you're looking for exceptional customer support, effective engagement strategies, or powerful marketing solutions, we have you covered.
</p>

<ul class="service-list">
Expand All @@ -195,8 +191,7 @@ <h3 class="h3">
</h3>

<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet nulla duis consectetur
adipiscing elit.
Our support team is always ready to assist you with any challenges you may face. We provide round-the-clock customer service, ensuring you get the help you need, when you need it.
</p>

<a href="#" class="btn-link">
Expand Down Expand Up @@ -225,8 +220,7 @@ <h3 class="h3">
</h3>

<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet nulla duis consectetur
adipiscing elit.
We specialize in creating lasting relationships with your audience. Our engagement strategies are designed to foster deeper connections, driving loyalty and enhancing user experience.
</p>

<a href="#" class="btn-link">
Expand Down Expand Up @@ -255,8 +249,7 @@ <h3 class="h3">
</h3>

<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet nulla duis consectetur
adipiscing elit.
Our marketing solutions are designed to help your business stand out in a crowded market. From digital advertising to social media strategies, we ensure your brand reaches the right audience.
</p>

<a href="#" class="btn-link">
Expand Down