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

Enhanced Functionality of feedback form #718

Merged
merged 2 commits into from
Jul 3, 2024
Merged
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
83 changes: 53 additions & 30 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1250,63 +1250,88 @@ <h3 class="name">Shikha Pandey</h3>


<!-- Feedback System-->
<section id="feedback" class="feed">
<section id="feedback" class="feed">
<div class="feedback">
<h1>Give Us Your Valuable Feedback.</h1>
<p>Your feedback is very important for Rapidoc.</p>
<div class="emoji" >
<input type="radio" id="emoji1" name="emoji" value="&#128578;" style="display: none;">
<label for="emoji1" style="font-size: 2rem; cursor: pointer; padding: 5px;">&#128578;</label>
<input type="radio" id="emoji2" name="emoji" value="&#128515;" style="display: none;">
<label for="emoji2" style="font-size: 2rem; cursor: pointer; padding: 5px;">&#128515;</label>
<input type="radio" id="emoji3" name="emoji" value="&#128519;" style="display: none;">
<label for="emoji3" style="font-size: 2rem; cursor: pointer; padding: 5px;">&#128519;</label>
<input type="radio" id="emoji4" name="emoji" value="&#128531;" style="display: none;">
<label for="emoji4" style="font-size: 2rem; cursor: pointer; padding: 5px;">&#128531;</label>
<input type="radio" id="emoji5" name="emoji" value="&#128532;" style="display: none;">
<label for="emoji5" style="font-size: 2rem; cursor: pointer; padding: 5px;">&#128532;</label>
<input type="radio" id="emoji6" name="emoji" value="&#128545;" style="display: none;">
<label for="emoji6" style="font-size: 2rem; cursor: pointer; padding: 5px;">&#128545;</label>
<div class="emoji">
<input type="radio" id="emoji1" name="emoji" value="😊" style="display: none;">
<label for="emoji1" style="font-size: 2rem; cursor: pointer; padding: 5px;">😊</label>
<input type="radio" id="emoji2" name="emoji" value="😁" style="display: none;">
<label for="emoji2" style="font-size: 2rem; cursor: pointer; padding: 5px;">😁</label>
<input type="radio" id="emoji3" name="emoji" value="😇" style="display: none;">
<label for="emoji3" style="font-size: 2rem; cursor: pointer; padding: 5px;">😇</label>
<input type="radio" id="emoji4" name="emoji" value="😕" style="display: none;">
<label for="emoji4" style="font-size: 2rem; cursor: pointer; padding: 5px;">😕</label>
<input type="radio" id="emoji5" name="emoji" value="😔" style="display: none;">
<label for="emoji5" style="font-size: 2rem; cursor: pointer; padding: 5px;">😔</label>
<input type="radio" id="emoji6" name="emoji" value="😡" style="display: none;">
<label for="emoji6" style="font-size: 2rem; cursor: pointer; padding: 5px;">😡</label>
</div>
<p id="mood-text" style="font-size: 1rem; font-weight: bold;"></p>
<p class="ques">What you want to say?</p>
<textarea id="textarea" cols="20" rows="5"></textarea>
<p class="ques">Are you satisfied with rapidoc?</p>
<p class="ques">Are you satisfied with Rapidoc?</p>
<div class="radiobtn">
<div class="one">
<input class="input" type="radio" name="one" id="Yes" />
<input class="input" type="radio" name="satisfaction" id="Yes" />
<label class="label" for="Yes">Yes</label>
</div>
<div class="one">
<input class="input" type="radio" name="one" id="No" />
<input class="input" type="radio" name="satisfaction" id="No" />
<label class="label" for="No">No</label>
</div>
</div>
</div>
<div class="info">
<div class="center">
<button class="btn button" style="text-align: center; font-weight: 700; padding-bottom:40px ;"onclick="submitFeedback(event)">Submit</button>
<button class="btn button" style="text-align: center; font-weight: 700; padding-bottom:40px;" onclick="submitFeedback(event)">Submit</button>
</div>

</div>
</section>
<div id="overlay" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); display: none; justify-content: center; align-items: center; z-index: 1000;">
<div id="confirmation-message" style="width: 80%; height: 80%; color: #1c413b;; font-size: 50px; font-weight: bold; text-align: center; background-color: rgba(0, 0, 0, 0.8); padding: 20px; border-radius: 10px; display: flex; justify-content: center; align-items: center;">
<div id="confirmation-message" style="width: 80%; height: 80%; color: #1c413b; font-size: 50px; font-weight: bold; text-align: center; background-color: rgba(0, 0, 0, 0.8); padding: 20px; border-radius: 10px; display: flex; justify-content: center; align-items: center;">
Thank you for your feedback!
</div>
</div>
<script>
const emojiLabels = document.querySelectorAll('.emoji label');
const moodText = document.getElementById('mood-text');

emojiLabels.forEach(label => {
label.addEventListener('click', () => {
const emoji = label.innerHTML;
let mood = '';
switch (emoji) {
case '😊':
mood = 'Highly Satisfied';
break;
case '😁':
mood = 'Satisfied';
break;
case '😇':
mood = 'Average';
break;
case '😕':
mood = 'Confused';
break;
case '😔':
mood = 'Dissatisfied';
break;
case '😡':
mood = 'Highly Dissatisfied';
break;
}
moodText.textContent = `Mood: ${mood}`;
});
});

</div>
<script>
function submitFeedback(event) {
event.preventDefault();
const feedbackText = document.getElementById('textarea').value;
const selectedEmoji = document.querySelector('input[name="emoji"]:checked');
if (!feedbackText.trim() || !selectedEmoji) {
alert('Please fill the feedback form');
return;
}
if (!selectedEmoji) {
alert('Please select your satisfaction level');
alert('Please fill the feedback form and select your satisfaction level');
return;
}
const overlay = document.getElementById('overlay');
Expand All @@ -1315,13 +1340,11 @@ <h1>Give Us Your Valuable Feedback.</h1>
setTimeout(() => {
overlay.style.display = 'none';
document.body.classList.remove('blur');
location.reload(true);
location.reload(true);
}, 1000);
}
</script>



</main><!-- End #main -->
<!-- ############### Footer ############### -->
<br><br><br><br><br><br>
Expand Down