Skip to content

Commit

Permalink
Merge pull request #2791 from Bhattu-Anitha-07/footer_1
Browse files Browse the repository at this point in the history
Proper navigation for Privacy notice and Copyright policy in the footer section.
  • Loading branch information
huamanraj committed Aug 9, 2024
2 parents ad026ff + 876487b commit a0ae732
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 26 deletions.
12 changes: 6 additions & 6 deletions assets/html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,13 @@ <h2>Quick Links</h2>
<div class="row-copy">


<a href="#" id="copyrightPolicyLink">Copyright Policy</a> |
<a href="#" id="privacyNoticeLink">Privacy Notice</a>
<a href="/copyrightpolicy.html">Copyright Policy</a> |
<a href="/privacynotice.html">Privacy Notice</a>
</div>
</div>

<!-- Copyright Policy Modal -->
<div id="copyrightPolicyModal" class="modal">
<!-- <div id="copyrightPolicyModal" class="modal">
<div class="modal-content">
<span class="close" id="closeCopyright">&times;</span>
<h1>Copyright Policy</h1>
Expand All @@ -1091,10 +1091,10 @@ <h1>Copyright Policy</h1>
information.</li>
</ul>
</div>
</div>
</div> -->

<!-- Privacy Notice Modal -->
<div id="privacyNoticeModal" class="modal">
<!-- <div id="privacyNoticeModal" class="modal">
<div class="modal-content">
<span class="close" id="closePrivacy">&times;</span>
<h1>Privacy Notice</h1>
Expand All @@ -1108,7 +1108,7 @@ <h1>Privacy Notice</h1>
<li>By using our site, you consent to our privacy practices.</li>
</ul>
</div>
</div>
</div> -->

<script>
// Get the modal elements
Expand Down
4 changes: 2 additions & 2 deletions assets/html/freeBooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,8 @@ <h2>Quick Links</h2>
<div class="row-copy">


<a href="copyrightpolicy.html" id="copyrightPolicyLink">Copyright Policy</a> |
<a href="privacynotice.html" id="privacyNoticeLink">Privacy Notice</a>
<a href="/copyrightpolicy.html">Copyright Policy</a> |
<a href="/privacynotice.html">Privacy Notice</a>
</div>
</div>

Expand Down
95 changes: 77 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
<title>SwapReads</title>

<head>
<script type="text/javascript">
(function () {
emailjs.init({
publicKey: "Your_Public_key",
});
})();
</script>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="apple-touch-icon" sizes="180x180" href="./assets/favicon_package_v0.16/apple-touch-icon.png">
Expand Down Expand Up @@ -48,7 +55,9 @@
<script src="./assets/js/tilt.js"></script>
<script src="./assets/js/scroll.js"></script>
<link rel="stylesheet" href="./scrollbar.css">

<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js">
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="modals(privacy policy).css">

Expand Down Expand Up @@ -934,6 +943,57 @@
}

</style>
<script type="text/javascript">
emailjs.init("Your_User_ID"); // Replace with your actual EmailJS User ID

// Function to validate email address
function isValidEmail(email) {
// Simple email validation regex
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!regex.test(email)) {
return false;
}

// Extract domain
const domain = email.split('@')[1].toLowerCase();
const validDomains = ['gmail.com', 'outlook.com', 'yahoo.com'];

return validDomains.includes(domain);
}

document.addEventListener('DOMContentLoaded', function() {
document.getElementById('subscribeForm').addEventListener('submit', function(event) {
event.preventDefault();

var email = document.getElementById('emailInput').value;

if (!isValidEmail(email)) {
alert('Please enter a valid email address from Gmail, Outlook, or Yahoo.');
return;
}

// Prepare the parameters to send
var templateParams = {
to_email: email, // Set the recipient's email
from_name: 'SwapReads', // Replace with your company or your name
to_name: 'Subscriber',
message: 'Thank you for subscribing to our newsletter!'
};

// Send email
emailjs.send('Your_Service_ID', 'Your_Template_ID', templateParams)
.then(function(response) {
console.log('Email sent successfully:', response);
alert('Successfully subscribed to our newsletter!');
location.reload();
}, function(error) {
console.error('Error sending email:', error);
alert('Failed to send email. Please try again later.');
location.reload();
});
});
});
</script>
</head>


Expand Down Expand Up @@ -3376,19 +3436,18 @@ <h2>Quick Links</h2>

</style>

<form id="newsform" onsubmit="return showConfirmationMessage();">
<div>
<label for="new-email" class="news-form">Subscribe to our Newsletter</label>
<div class="row-flex display-flex">
<input class="finput" type="email" id="new-email" name="email" placeholder="Email address"
pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\.com$"
title="Please enter a valid email address that ends with '.com'" required>
<input type="submit" value="Subscribe" name="subscribe" class="subscribe" id="subs">
<form action="#" class="subscribe-form" id="subscribeForm">
<input type="email" id="emailInput" placeholder="Email Address" class="finput" style="margin-bottom: 10px; margin-top: 10px;" required>
<button type="submit" id="subscribeButton" class="subscribe" class="b">SUBSCRIBE</button>
</form>
</div>
</form>
<div id="confirmationmessage" style="display: none;">Thank you for subscribing!</div>
</div>

<script>
function showConfirmationMessage() {
function showConfirmationMessage() {

const form = document.getElementById('newsform');
const confirmationMessage = document.getElementById('confirmationmessage');
Expand Down Expand Up @@ -3656,16 +3715,16 @@ <h1>Privacy Notice</h1>
document.getElementById("subs_btn").addEventListener("submit", function(event) {
event.preventDefault();

const email_input = document.getElementById("newsletter-email").value;
// const email_input = document.getElementById("newsletter-email").value;

if (!validateEmail(email_input)) {
/* alert("Please enter a valid email address.");*/
document.getElementById("confirmationMessage").textContent = "Please enter a valid email address." ;
}
else{
document.getElementById("confirmationMessage").textContent = "Thank you for subscribing!" ;
}
document.getElementById("newsletter-email").value = '';
// if (!validateEmail(email_input)) {
// /* alert("Please enter a valid email address.");*/
// document.getElementById("confirmationMessage").textContent = "Please enter a valid email address." ;
// }
// else{
// document.getElementById("confirmationMessage").textContent = "Thank you for subscribing!" ;
// }
// document.getElementById("newsletter-email").value = '';
});

function validateEmail(email_input) {
Expand Down

0 comments on commit a0ae732

Please sign in to comment.