Skip to content

Commit 88a2e7e

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

File tree

2 files changed

+73
-69
lines changed

2 files changed

+73
-69
lines changed

_resourcepdf/overrides/partials/rating.html

Lines changed: 37 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,6 @@
237251
body: formData
238252
}).then(() => {
239253
statusDiv.style.color = "";
240-
statusDiv.textContent = "Thanks for your feedback!";
241254
feedbackTextarea.value = "";
242255
emailInput.value = "";
243256
feedbackForm.style.display = "none";
@@ -248,6 +261,13 @@
248261
s.classList.remove("active");
249262
s.classList.remove("hovered");
250263
});
264+
265+
// ✅ Show post-submit thank-you notification
266+
submitNotification.style.display = "block";
267+
clearTimeout(notificationTimeout);
268+
notificationTimeout = setTimeout(() => {
269+
submitNotification.style.display = "none";
270+
}, 4000);
251271
}).catch(() => {
252272
statusDiv.style.color = "";
253273
statusDiv.textContent = "Error sending feedback.";
@@ -296,7 +316,6 @@
296316
});
297317

298318
sendRatingOnly(rating);
299-
showNotification("Thanks for your feedback");
300319
feedbackForm.style.display = "block";
301320
statusDiv.textContent = "";
302321
});

docs/css/rating.css

Lines changed: 36 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,43 @@
1-
.rating-widget:hover {
2-
box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.12),
3-
0px 4px 5px 0px rgba(0, 0, 0, 0.14),
4-
0px 2px 4px -1px rgba(0, 0, 0, 0.20);
5-
transition: all 0.2s ease-out;
6-
}
7-
8-
.rating-widget:hover,
9-
#feedback-form:hover {
10-
box-shadow:
11-
0px 1px 10px 0px rgba(0, 0, 0, 0.12),
12-
0px 4px 5px 0px rgba(0, 0, 0, 0.14),
13-
0px 2px 4px -1px rgba(0, 0, 0, 0.20);
14-
}
15-
1+
.rating-widget:hover,
2+
#feedback-form:hover {
3+
box-shadow:
4+
0px 1px 10px 0px rgba(0, 0, 0, 0.12),
5+
0px 4px 5px 0px rgba(0, 0, 0, 0.14),
6+
0px 2px 4px -1px rgba(0, 0, 0, 0.20);
7+
}
8+
9+
/* Title color */
10+
.rating-widget .rating-title {
11+
color: var(--md-typeset-a-color, #0E5FB5);
12+
}
13+
14+
/* Dark mode title */
15+
@media (prefers-color-scheme: dark) {
1616
.rating-widget .rating-title {
17-
color: var(--md-typeset-a-color, #0E5FB5);
18-
}
19-
20-
@media (prefers-color-scheme: dark) {
21-
.rating-widget .rating-title {
22-
color: var(--md-typeset-a-color, #93C7FF) !important;
23-
}
24-
}
25-
26-
@media (prefers-color-scheme: dark) {
27-
#submit-feedback {
28-
background-color: var(--md-typeset-a-color, #93C7FF) !important;
29-
}
17+
color: var(--md-typeset-a-color, #93C7FF) !important;
3018
}
31-
#feedback-status {
32-
color: var(--md-typeset-a-color);
33-
}
34-
35-
@media (prefers-color-scheme: dark) {
36-
#feedback-status {
37-
color: var(--md-typeset-a-color, #93C7FF) !important;
38-
}
39-
}
40-
41-
@media (prefers-color-scheme: dark) {
42-
#submit-feedback {
43-
color: var(--md-default-fg-color--lightest) !important;
19+
}
4420

45-
}
21+
/* Feedback status */
22+
#feedback-status {
23+
color: var(--md-typeset-a-color);
24+
}
25+
26+
@media (prefers-color-scheme: dark) {
27+
#feedback-status {
28+
color: var(--md-typeset-a-color, #93C7FF) !important;
4629
}
30+
}
4731

48-
/* Light mode: Send button text white */
32+
/* Light mode: Send button */
4933
#submit-feedback {
50-
color: white !important;
34+
color: white !important;
35+
}
36+
37+
/* Dark mode: Send button */
38+
@media (prefers-color-scheme: dark) {
39+
#submit-feedback {
40+
background-color: var(--md-typeset-a-color, #93C7FF) !important;
41+
color: #999 !important;
5142
}
52-
53-
/* Dark mode: Send button text grey */
54-
@media (prefers-color-scheme: dark) {
55-
#submit-feedback {
56-
color: #999 !important;
57-
}
58-
}
43+
}

0 commit comments

Comments
 (0)