Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shivenyadavs authored Nov 5, 2024
2 parents 8808ed5 + 0186072 commit d0b5121
Show file tree
Hide file tree
Showing 26 changed files with 2,905 additions and 2,322 deletions.
141 changes: 82 additions & 59 deletions F&Q.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ <h1 id="logo"><a href="#home">BuddyTrail</a></h1>
style="
position: absolute;
width: 250px;
top: 450px;
top: 370px;
right: 1250px;
mix-blend-mode: multiply;
"
Expand Down Expand Up @@ -383,15 +383,15 @@ <h2>Most Frequent Questions</h2>
<!-- Suggestions/Questions Form Section -->
<section id="suggestions-form">
<h2>Suggestions/Questions</h2>
<form id="suggestionForm" action="/submit-suggestion" method="POST">
<form id="suggestionForm" >
<label for="name">Name:</label>
<input type="text" id="name" name="name" required placeholder="Your Name"><br><br>
<input type="text" id="name" required placeholder="Your Name"><br><br>

<label for="email">Email:</label>
<input type="email" id="email" name="email" required placeholder="Your Email"><br><br>
<input type="email" id="email" required placeholder="Your Email"><br><br>

<label for="message">Message:</label><br>
<textarea id="message" name="message" rows="5" required placeholder="Your Message"></textarea><br><br>
<textarea id="message" rows="5" required placeholder="Your Message"></textarea><br><br>

<button type="submit">Submit</button>
</form>
Expand All @@ -406,6 +406,38 @@ <h2>Suggestions/Questions</h2>
</div>
</section>

<script>
document.getElementById("suggestionForm").addEventListener("submit", async function (event) {
event.preventDefault();

const name = document.getElementById("name").value;
const email = document.getElementById("email").value;
const message = document.getElementById("message").value;

console.log(name,email,message);
try {
const response = await fetch("http://localhost:5000/api/contact/suggestion", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ name, email, message }),
});

const data = await response.json();

if (data.success) {
alert("Suggestion recorded!");
} else {
alert(data.message);
}
} catch (error) {
console.error("Error:", error);
alert("Internal server error");
}
});

</script>

<script>
// Get elements
Expand Down Expand Up @@ -456,6 +488,8 @@ <h2>Suggestions/Questions</h2>
})
</script>





<style>
Expand Down Expand Up @@ -604,9 +638,7 @@ <h2>Suggestions/Questions</h2>
#about:hover {
background-color: #ffe0b2;
}
</style>
main
main
</style>

<!-- Circles -->
<div class="circle"></div>
Expand Down Expand Up @@ -738,21 +770,51 @@ <h2>Suggestions/Questions</h2>
});
});
</script>
</body>
main

main


main

</body>

<footer id="footer">
<div class="footer-container">
<!-- About Us Section -->
<div class="footer-column">
<h3>About Us</h3>
<p>Discover and plan affordable trips with BuddyTrail's travel companion tools.</p>
<!-- Newsletter Form Section -->
<style>
.footer-column.newsletter {
max-width: 300px;
margin: 0 auto;
text-align: center;
}
#newsletter-form {
display: flex;
flex-direction: column;
align-items: center;
}
#email {
width: 100%;
margin-bottom: 10px;
padding: 8px;
box-sizing: border-box;
}
button[type="submit"] {
width: 100px;
padding: 6px;
font-size: 14px;
background-color: #007bff;
}
#subscription-message {
font-size: 14px;
margin-top: 10px;
}
</style>
<div class="footer-column newsletter" id="newsletter">
<h3>Subscribe to Our Newsletter</h3>
<form id="newsletter-form">
<input type="email" id="email" placeholder="Enter your email" required />
<button type="submit">Subscribe</button>
</form>
<p id="subscription-message"></p>
</div>
</div>

<!-- Quick Links Section -->
Expand Down Expand Up @@ -789,9 +851,7 @@ <h3>Legal Links</h3>
<h3>Contact Us</h3>
<p>Email: <a href="mailto:[email protected]">[email protected]</a></p>
<p>Phone: <a href="tel:+1234567890">+123 456 7890</a></p>
</div>

<!-- Follow Us Section -->
<!-- Follow Us Section -->
<div class="footer-column">
<h3>Follow Us</h3>
<div class="social-icons">
Expand All @@ -801,42 +861,6 @@ <h3>Follow Us</h3>
<a href="https://www.linkedin.com/in/priya-ghosal-785771286/" target="_blank"><i class="fab fa-linkedin-in"></i></a>
</div>
</div>

<!-- Newsletter Form Section -->
<style>
.footer-column.newsletter {
max-width: 300px;
margin: 0 auto;
text-align: center;
}
#newsletter-form {
display: flex;
flex-direction: column;
align-items: center;
}
#email {
width: 100%;
margin-bottom: 10px;
padding: 8px;
box-sizing: border-box;
}
button[type="submit"] {
width: 100px;
padding: 6px;
font-size: 14px;
}
#subscription-message {
font-size: 14px;
margin-top: 10px;
}
</style>
<div class="footer-column newsletter" id="newsletter">
<h3>Subscribe to Our Newsletter</h3>
<form id="newsletter-form">
<input type="email" id="email" placeholder="Enter your email" required />
<button type="submit">Subscribe</button>
</form>
<p id="subscription-message"></p>
</div>
</div>

Expand Down Expand Up @@ -896,8 +920,8 @@ <h3>Subscribe to Our Newsletter</h3>
sunIcon.style.display = "none";
moonIcon.style.display = "inline-block";
localStorage.setItem("theme", "dark");
document.getElementById("clipart-img1").style.visibility = "hidden";
document.getElementById("clipart-img2").style.visibility = "hidden";
// document.getElementById("clipart-img1").style.visibility = "hidden";
// document.getElementById("clipart-img2").style.visibility = "hidden";
} else {
sunIcon.style.display = "inline-block";
moonIcon.style.display = "none";
Expand All @@ -907,7 +931,6 @@ <h3>Subscribe to Our Newsletter</h3>
}
});
});
</script>
main
</script>
</body>
</html>
61 changes: 53 additions & 8 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

<link rel="icon" href="/icons/airplane.svg" />
<link rel="icon" href="https://img.icons8.com/?size=100&id=11808&format=png&color=000000">
main
main

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
<style>
/* circle styles */
Expand All @@ -26,14 +25,15 @@
pointer-events: none;
z-index: 99999999;
}

</style>
</head>

main



<link rel="stylesheet" href= "style.css" />
main

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
</head>

Expand All @@ -46,7 +46,29 @@
</div>
<div id="loading-text">Ready to Explore the World...</div>
</div>
<!-- <style>
<style>


.scroll-to-top {
position: fixed;
bottom: 30px;
right: 30px;
padding: 10px 15px;
font-size: 20px;
background-color: #007BFF;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
display: none; /* Hidden by default */
z-index: 1000;
}

.scroll-to-top:hover {
background-color: #0056b3;
}


/* Preloader Container */
#preloader {
position: fixed;
Expand Down Expand Up @@ -681,6 +703,9 @@ <h3>PRIYA Ghosal</h3>
}
</style>

<button id="scrollToTopBtn" class="scroll-to-top"></button>


<!-- Scroll to top button -->
<button id="scrollToTopBtn" title="Go to top">
<i class="fas fa-arrow-up"></i>
Expand Down Expand Up @@ -776,10 +801,10 @@ <h3>Office <div class="underline"><span></span></div>
<p>Near XYZ Mall, Sample City</p>
<p>Fake State, PIN 12345, India</p>

<h3>
<h5>
<a href="mailto:[email protected]" style="color: white; text-decoration: none;">[email protected]</a><br>
<a href="tel:+1234567890" style="color: white; text-decoration: none;">+123 456 7890</a>
</h3>
<br> <a href="tel:+1234567890" style="color: white; text-decoration: none;">+123 456 7890</a>
</h5>

</div>
<div class="col">
Expand Down Expand Up @@ -853,6 +878,26 @@ <h3>Follow Us <div class="underline"><span></span></div>
});
</script>

<script>
// Show the button when the user scrolls down 100px from the top
window.onscroll = function() {
const scrollToTopBtn = document.getElementById('scrollToTopBtn');
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
scrollToTopBtn.style.display = 'block';
} else {
scrollToTopBtn.style.display = 'none';
}
};

// Scroll to the top when the button is clicked
document.getElementById('scrollToTopBtn').addEventListener('click', function() {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});

</script>

<!-- Circles -->
<div class="circle"></div>
Expand Down
40 changes: 32 additions & 8 deletions backend/controllers/ContactController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const ContactUs = require("../models/ContactUs");

const FeedbackModal = require("../models/Feedback");

const SuggestionModal = require("../models/suggestion");

const nodemailer = require("nodemailer");

exports.submitContactForm = async (req, res) => {
Expand All @@ -11,7 +13,6 @@ exports.submitContactForm = async (req, res) => {
const newContact = new ContactUs({ name, email, message });
await newContact.save();
return res.status(201).json({ message: "Message sent successfully!" });

} catch (error) {
console.error("Error saving contact form:", error);
return res
Expand Down Expand Up @@ -50,13 +51,6 @@ exports.userfeedback = async (req, res) => {
success: false,
message: "internal server error ",
});
=======
} catch (error) {
console.error("Error saving contact form:", error);
return res
.status(500)
.json({ message: "Failed to send message. Please try again later." });

}
};

Expand Down Expand Up @@ -90,3 +84,33 @@ exports.sendEmail = async (req, resp) => {
}
});
};

exports.suggestion = async (req, resp) => {
try {
const { name, email, message } = req.body;
if (!name || !email || !message) {
return resp.status(400).send({
success: false,
message: "all fields are required",
});
}

const suggestion = await new SuggestionModal({
name: name,
email: email,
message: message,
}).save();

if (suggestion) {
return resp.status(201).send({
success: true,
message: "suggestion recorded",
});
}
} catch (error) {
return resp.status(500).send({
success: false,
message: "intenral server error",
});
}
};
Loading

0 comments on commit d0b5121

Please sign in to comment.