Skip to content

Commit 1095f04

Browse files
Remove the field title and add a thanks notification
modified: _resourcepdf/overrides/partials/rating.html
1 parent f63d0e7 commit 1095f04

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

_resourcepdf/overrides/partials/rating.html

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
font-size: 14px;
4040
">Thanks for your feedback</div>
4141

42+
<div id="feedback-submit-notification" style="
43+
display: none;
44+
margin-top: 10px;
45+
color: var(--md-typeset-a-color);
46+
font-weight: 500;
47+
font-size: 14px;
48+
">Thank you! The feedback has been submitted.</div>
49+
4250
<div id="feedback-form" style="
4351
display: none;
4452
margin-top: 12px;
@@ -52,22 +60,27 @@
5260
box-sizing: border-box;
5361
transition: all 0.2s ease-out;
5462
">
55-
<button id="close-feedback" title="Close" style="
56-
position: absolute;
57-
top: 8px;
58-
right: 8px;
59-
background: transparent;
60-
border: none;
61-
font-size: 20px;
62-
font-weight: bold;
63-
cursor: pointer;
64-
color: var(--md-default-fg-color--light);
65-
line-height: 1;
66-
">×</button>
67-
68-
<div style="margin-bottom: 10px; font-size: 15px;">
69-
Was this page helpful?
70-
</div>
63+
<button id="close-feedback" title="Close" style="
64+
position: absolute;
65+
top: -10px;
66+
right: -10px;
67+
background: var(--md-default-bg-color);
68+
border: 0.05rem solid var(--md-default-fg-color--lightest);
69+
border-radius: 50%;
70+
width: 24px;
71+
height: 24px;
72+
font-size: 18px;
73+
font-weight: bold;
74+
cursor: pointer;
75+
color: var(--md-default-fg-color--light);
76+
line-height: 1;
77+
display: flex;
78+
align-items: center;
79+
justify-content: center;
80+
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
81+
">
82+
×
83+
</button>
7184

7285
<textarea id="feedback-text" rows="3" placeholder="Write your feedback here..." style="
7386
width: 100%;
@@ -187,6 +200,7 @@
187200
const statusDiv = document.getElementById("feedback-status");
188201
const closeButton = document.getElementById("close-feedback");
189202
const notification = document.getElementById("feedback-notification");
203+
const submitNotification = document.getElementById("feedback-submit-notification");
190204

191205
if (!stars.length || !feedbackForm) return;
192206

@@ -237,7 +251,7 @@
237251
body: formData
238252
}).then(() => {
239253
statusDiv.style.color = "";
240-
statusDiv.textContent = "Thanks for your feedback!";
254+
statusDiv.textContent = "Thanks for rating this page!";
241255
feedbackTextarea.value = "";
242256
emailInput.value = "";
243257
feedbackForm.style.display = "none";
@@ -248,6 +262,13 @@
248262
s.classList.remove("active");
249263
s.classList.remove("hovered");
250264
});
265+
266+
// ✅ Show post-submit thank-you notification
267+
submitNotification.style.display = "block";
268+
clearTimeout(notificationTimeout);
269+
notificationTimeout = setTimeout(() => {
270+
submitNotification.style.display = "none";
271+
}, 4000);
251272
}).catch(() => {
252273
statusDiv.style.color = "";
253274
statusDiv.textContent = "Error sending feedback.";
@@ -296,7 +317,7 @@
296317
});
297318

298319
sendRatingOnly(rating);
299-
showNotification("Thanks for your feedback");
320+
showNotification("Thanks for rating this page!");
300321
feedbackForm.style.display = "block";
301322
statusDiv.textContent = "";
302323
});

0 commit comments

Comments
 (0)