Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rating option on top and Modify feedback form #443

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion aboutus.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
padding: 40px 0;
}
h1, h2 {
color: #35424a;
color: #eceeee;
text-align: center;
margin-bottom: 40px;
}
Expand Down
182 changes: 182 additions & 0 deletions feedback.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Feedback Form</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.feedback-container {
background-color: white;
padding: 50px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
width: 400px;
}

.feedback-container h2 {
text-align: center;
color: #333;
margin-bottom: 20px;
}

.form-group {
margin-bottom: 15px;
}

.form-group label {
display: block;
font-weight: bold;
margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
width: 100%;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 5px;
}

.form-group textarea {
resize: vertical;
height: 100px;
}

.form-group select {
width: 50%;
}

button {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
font-size: 16px;
}

button:hover {
background-color: #45a049;
}

.error-message {
color: red;
font-size: 14px;
margin-top: -10px;
margin-bottom: 10px;
display: none;
}

.success-message {
color: green;
font-size: 18px;
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="feedback-container">
<h2>Feedback Form</h2>
<form id="feedbackForm">
<div class="form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" placeholder="Your name">
<p class="error-message" id="nameError">Name is required</p>
</div>

<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" placeholder="Your email">
<p class="error-message" id="emailError">Please enter a valid email</p>
</div>

<div class="form-group">
<label for="rating">Rate your experience</label>
<select id="rating" name="rating">
<option value="">--Select Rating--</option>
<option value="1">1 - Poor</option>
<option value="2">2 - Fair</option>
<option value="3">3 - Good</option>
<option value="4">4 - Very Good</option>
<option value="5">5 - Excellent</option>
</select>
<p class="error-message" id="ratingError">Please select a rating</p>
</div>

<div class="form-group">
<label for="feedback">Feedback</label>
<textarea id="feedback" name="feedback" placeholder="Your feedback"></textarea>
<p class="error-message" id="feedbackError">Feedback is required</p>
</div>

<button type="submit">Submit</button>
</form>
<div id="successMessage" class="success-message"></div>
</div>

<script>
document.getElementById('feedbackForm').addEventListener('submit', function(event) {
event.preventDefault();

// Clear previous error messages
let valid = true;
document.getElementById('nameError').style.display = 'none';
document.getElementById('emailError').style.display = 'none';
document.getElementById('ratingError').style.display = 'none';
document.getElementById('feedbackError').style.display = 'none';
document.getElementById('successMessage').textContent = '';

// Validate Name
const name = document.getElementById('name').value.trim();
if (name === "") {
document.getElementById('nameError').style.display = 'block';
valid = false;
}

// Validate Email
const email = document.getElementById('email').value.trim();
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailPattern.test(email)) {
document.getElementById('emailError').style.display = 'block';
valid = false;
}

// Validate Rating
const rating = document.getElementById('rating').value;
if (rating === "") {
document.getElementById('ratingError').style.display = 'block';
valid = false;
}

// Validate Feedback
const feedback = document.getElementById('feedback').value.trim();
if (feedback === "") {
document.getElementById('feedbackError').style.display = 'block';
valid = false;
}

// Show success message if the form is valid
if (valid) {
document.getElementById('successMessage').textContent = "Thank you for your feedback!";
document.getElementById('feedbackForm').reset(); // Clear the form fields
}
});
</script>
</body>
</html>
40 changes: 25 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" />
</head>

<body>
<div id="progressBarContainer">
</head>
<body>

<div id="progressBarContainer">
<div id="progressBar"></div>
</div>

Expand All @@ -32,27 +33,35 @@
</div>
<nav>
<ul>

<li><a href="./index.html">Home</a></li>
<li><a href="./aboutus.html">About Us</a></li>
<li><a href="#controller">Game Controllers</a></li>
<li><a href="#vrsection">VR Accessories</a></li>
<li><a href="#keyboard">Gaming Keyboard</a></li>
<li><a href="#others">Others</a></li>
<li><a href="#others">Others</a></li>

<li class="login"><a href="login/login.html">Login</a></li>

<li><label class="switch">
<input type="checkbox" id="theme-toggle" onchange="toggleTheme()">
<span class="slider"></span>
</label></li>

<!-- Inside the navbar ul -->
<li class="cart-nav">

<a href="#"><img height="25px " width="25px" src="images/cart.png" alt="Cart Icon"> <span id="cart-count">0</span></a>



</li>



</ul>


<!-- Hamburger Menu Icon -->
<img src="images/menu.png" class="menu-icon" onclick="toggleMenu()">
</nav>
Expand All @@ -65,12 +74,15 @@
<li><a href="#vrsection">VR Accessories</a></li>
<li><a href="#keyboard">Gaming Keyboard</a></li>
<li><a href="#others">Others</a></li>
<li class="login"><a href="login/login.html">Login</a></li>
<li class="login"><a href="login/login.html">Login</a> </li>

<!-- Theme Toggle -->
<li><label class="switch">
<li>
<label class="switch">
<input type="checkbox" id="theme-toggle" onchange="toggleTheme()">
<span class="slider"></span>
</label></li>

</ul>
<!-- Hamburger Menu Icon -->
<img src="images/menu.png" class="menu-icon" onclick="toggleMenu()">
Expand Down Expand Up @@ -617,15 +629,8 @@ <h2>Quick Links</h2>
</ul>
</div>
<div class="footer-section contact-form">
<h2>Feedback Form</h2>
<form action="#" method="post">
<input type="email" name="email" class="text-input contact-input" placeholder="Your email address...">
<textarea name="message" class="text-input contact-input" placeholder="Your message..."></textarea>
<button type="submit" class="btn btn-big contact-btn">
<i class="fas fa-envelope"></i>
Send
</button>
</form>
<h2>(we Value Your Feedback)</h2>
<h2> 👉 <a href="feedback.html">Feedback Form 👈 </a></h2>
</div>
</div>
<div class="footer-bottom">
Expand All @@ -643,6 +648,8 @@ <h2>Feedback Form</h2>
<li><a class="twitter" href="#" ><i class="fa-brands fa-x-twitter"></i></a></li>
<li><a class= "instagram" href="#"><i class="fa-brands fa-instagram"></i></a></li>
<li><a class= "youtube" href="#"><i class="fa-brands fa-youtube"></i></a></li>
<li><a class= "Rating" href="rating.html">⭐<i class="fa-brands fa-rating "></i></a></li>

</ul>
</div>
<div class="toggle-arrow" onclick="toggleSidebar()" title="Open Sidebar" style="display: none;">
Expand Down Expand Up @@ -718,6 +725,9 @@ <h2>Feedback Form</h2>
<script>
AOS.init();
</script>



</body>


Expand Down
Loading