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
17 changes: 17 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,21 @@ window.addEventListener("resize", function () {
totalSlidableItems = sliderContainer.childElementCount - totalSliderVisibleItems;

moveSliderItem();
});

// Newsletter success message
document.getElementById('newsletterForm').addEventListener('submit', function (event) {
event.preventDefault(); // Prevent the form from submitting

// Show the success message
const successMessage = document.querySelector('.success-message');
successMessage.style.display = 'block';

// Hide after 5 seconds
setTimeout(() => {
successMessage.style.display = 'none';
}, 5000);

// Clear the input fields
this.reset();
});
41 changes: 19 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1402,32 +1402,29 @@ <h3 class="headline headline-2 aside-title">
</div>

<div class="footer-list">

<p class="footer-list-title">Newsletter</p>

<p class="footer-text">
Sign up to be first to receive the latest stories inspiring us, case studies, and industry news.
</p>

<div class="input-wrapper">
<input type="text" name="name" placeholder="Your name" required class="input-field" autocomplete="off">

<ion-icon name="person-outline" aria-hidden="true"></ion-icon>
</div>

<div class="input-wrapper">
<input type="email" name="email_address" placeholder="Emaill address" required class="input-field"
autocomplete="off">

<ion-icon name="mail-outline" aria-hidden="true"></ion-icon>
</div>

<a href="#" class="btn btn-primary">
<span class="span">Subscribe</span>

<ion-icon name="arrow-forward" aria-hidden="true"></ion-icon>
</a>

<form action="" class="newsletter-form" id="newsletterForm">
<div class="input-wrapper">
<input type="text" name="name" placeholder="Your name" required class="input-field" autocomplete="off">
<ion-icon name="person-outline" aria-hidden="true"></ion-icon>
</div>
<div class="input-wrapper">
<input type="email" name="email_address" placeholder="Email address" required class="input-field"
autocomplete="off">
<ion-icon name="mail-outline" aria-hidden="true"></ion-icon>
</div>
<button type="submit" class="btn btn-primary">
<span class="span">Subscribe</span>
<ion-icon name="arrow-forward" aria-hidden="true"></ion-icon>
</button>
</form>
<!-- Success Message -->
<p class="success-message" style="display: none; color: green; margin-top: 10px;">
Thank you for subscribing! You'll now receive the latest updates directly to your inbox.
</p>
</div>

</div>
Expand Down