Skip to content

Commit

Permalink
Merge pull request #1060 from Anjaliavv51/main
Browse files Browse the repository at this point in the history
Aligned and size decreased.
  • Loading branch information
varshith257 authored Jul 29, 2024
2 parents 4a4bd21 + 223e71e commit e1e2680
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 55 deletions.
2 changes: 2 additions & 0 deletions Css-Files/Rateus.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
min-height: 100vh;
padding: 20px;
box-sizing: border-box;
width: 60%;
}

.popup {
Expand Down Expand Up @@ -209,6 +210,7 @@
border: none;
padding: 12px 20px;
border-radius: 5px;
margin-left:190px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease, transform 0.2s ease;
Expand Down
2 changes: 1 addition & 1 deletion index.css
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ form.php-email-form {
#email {
margin-bottom: 10px;
border-bottom: none;
width: 30vw;
width: 100%;
}

#email,
Expand Down
55 changes: 4 additions & 51 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,56 +57,7 @@
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js">
</script>
Copy code
<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: 'Rapidoc', // 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!');
}, function(error) {
console.error('Error sending email:', error);
alert('Failed to send email. Please try again later.');
});
});
});
</script>
<script src="./js/emailvalidation.js"></script>
</head>
<body>
<script src="js/caduceus.js"></script>
Expand Down Expand Up @@ -787,6 +738,7 @@ <h3 class="name">Shikha Pandey</h3>
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
<!-- testimonial section -->
<!-- Feedback System-->
<center>
<div class="feedback-wrapper">
<div class="feedback-form">
<h2>We'd Love Your Feedback!</h2>
Expand All @@ -811,10 +763,11 @@ <h2>We'd Love Your Feedback!</h2>
<input type="email" id="email" placeholder="Enter your email" required>
<label for="feedback">Your Feedback</label>
<textarea id="feedback" rows="5" placeholder="Let us know how we can improve..." required></textarea>
<button type="submit" class="btn" style="width: 21rem;">Submit Feedback</button>
<button type="submit" class="btn" style="width: 10rem;">Submit Feedback</button>
</form>
</div>
</div>
</center>
<div id="feedback-message">Thanks for the feedback! ❤️ </div>
<div id="popup" class="popup">
<div class="popup-content">
Expand Down
47 changes: 47 additions & 0 deletions js/emailvalidation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
emailjs.init("Your_User_ID"); // Replace with your actual EmailJS User ID

// Function to validate email address
export 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: 'Rapidoc', // 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!');
}, function(error) {
console.error('Error sending email:', error);
alert('Failed to send email. Please try again later.');
});
});
});
4 changes: 1 addition & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1270,10 +1270,8 @@ footer {
/* Style for pateint portal */
/* -----***************************************----- */
.patient-portal {
width: 100%;
/* Maximum width of the container */
width: 60%;
margin: 0 auto;
/* Centers the container */
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: #3fbcc051;
Expand Down

0 comments on commit e1e2680

Please sign in to comment.