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

Enhancing the Feedback section styling and adding name and email id for the form #4708

Closed
wants to merge 2 commits into from
Closed
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
130 changes: 83 additions & 47 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6094,70 +6094,106 @@ <h3>Rateus</h3>

let selectedEmoji = document.querySelector('input[name="rate"]:checked');
let feedback = document.getElementById("feedback").value.trim();

if (selectedEmoji && feedback !== "") {
// Show success toast message
toastMessage.textContent = "Feedback submitted successfully!";
toastMessage.style.backgroundColor = "green";
showToastMessage();
<div class="button">
<button id="submit-btn">Submit</button>
</div>
</div>
<style>
/* Overall container with light gradient and shadow */
#rate-us {
width: 100%;
max-width: 600px;
padding: 20px;
margin: 0 auto;
background: linear-gradient(135deg, #f0f4f8, #d0e8f2);
color: #333;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

// Reset form fields
document.getElementById("feedback").value = "";
let starInputs = document.querySelectorAll('input[name="rate"]');
starInputs.forEach(input => input.checked = false);
} else {
// Show failure toast message
toastMessage.textContent = "Please select an emoji and give feedback.";
toastMessage.style.backgroundColor = "red";
showToastMessage();
}
});

function showToastMessage() {
toastMessage.style.display = "block",
setTimeout(() => {
toastMessage.style.opacity = "1"
}, 100);
/* Section title and subtitle */
.heading h3 {
font-size: 1.6em;
text-align: center;
color: #444;
margin-bottom: 5px;
}

setTimeout(function() {
toastMessage.style.opacity = "0",
setTimeout(() => {
toastMessage.style.display = "none"
}, 300)
}, 3000)
}
})
</script>
<style>
.heading p {
font-size: 0.9em;
text-align: center;
color: #666;
margin-bottom: 20px;
}

/* Basic styles for body */
body {
background-color: #0e1722; /* Background color */
color: white; /* Text color */
font-family: Arial, sans-serif; /* Font style */
/* Name and email fields */
.user-info input {
width: 100%;
padding: 12px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 8px;
background: #ffffff;
color: #333;
font-size: 0.9em;
}

.user-info input::placeholder {
color: #aaa;
}

/* Toast message styles */
.toast-message {
/* Star rating section */
.stars {
display: flex;
justify-content: center;
gap: 10px;
margin: 20px 0;
}

position: fixed;
top: 20px; /* Position at the top */
left: 50%;
transform: translateX(-50%); /* Center horizontally */
background-color: rgba(0, 0, 0, 0.8); /* Dark background */
color: white; /* Text color */
padding: 15px 20px;
border-radius: 5px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
opacity: 0; /* Initially hidden */
transition: opacity 0.5s ease, transform 0.5s ease; /* Smooth transitions */
z-index: 999; /* Ensure it's above other elements */
.emoji-label {
font-size: 1.6em;
cursor: pointer;
transition: transform 0.3s ease, color 0.3s ease;
}

.emoji-label:hover {
transform: scale(1.1);
color: #666;
}

/* Feedback Container */
.feedback-container {
margin: 20px auto;
width: 100%;
max-width: 400px;
}

#feedback {
width: 100%;
padding: 15px;
border: 1px solid #d1d1d1;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
font-size: 1em;
color: #5e5d5d;
background-color: #f9f9f9;
resize: none;
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#feedback::placeholder {
color: #a9a9a9;
}

#feedback:focus {
border-color: #4b9cd3;
box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
outline: none;
}
.toast-message.show {
opacity: 1; /* Visible */
transform: translateX(-50%) translateY(0); /* Slide in */
Expand Down
Loading