Skip to content

Commit 1c8b0e6

Browse files
Move the feedback banner to the top
1 parent c4f41a1 commit 1c8b0e6

File tree

6 files changed

+66
-108
lines changed

6 files changed

+66
-108
lines changed

_resourcepdf/overrides/main.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
{% endif %}
5050
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" {{ hidden }}>
5151
<div class="md-sidebar__scrollwrap">
52+
<div class="md-sidebar__inner">
53+
{% include "partials/feedback.html" %}
54+
</div>
5255
<div class="md-sidebar__inner">
5356
{% include "partials/edit.html" %}
5457
</div>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<div class="feedback-widget" style="
2+
background: #fff;
3+
border: 1px solid #ddd;
4+
padding: 10px 15px;
5+
border-radius: 0.2rem;
6+
margin-bottom: 16px;
7+
font-family: 'Poppins','Roboto',Arial,Helvetica,sans-serif;
8+
font-size: 15px;
9+
color: #000;
10+
text-align: center;
11+
">
12+
<div style="margin-bottom: 4px; font-weight: bold; color: #0E5FB5;">
13+
Do you like Percona docs?
14+
</div>
15+
<div class="feedback-stars" style="display: inline-block;">
16+
{% for i in range(1,6) %}
17+
<span class="star" data-rating="{{ i }}" style="
18+
font-size: 24px;
19+
cursor: pointer;
20+
margin: 0 2px;
21+
color: #000;
22+
display: inline-block;
23+
"></span>
24+
{% endfor %}
25+
</div>
26+
</div>
27+
28+
<script>
29+
document.addEventListener("DOMContentLoaded", function () {
30+
const stars = document.querySelectorAll(".feedback-stars .star");
31+
stars.forEach((star) => {
32+
const rating = parseInt(star.dataset.rating, 10);
33+
34+
star.addEventListener("mouseover", () => {
35+
stars.forEach((s, index) => {
36+
s.innerHTML = index < rating ? "★" : "☆";
37+
s.style.color = index < rating ? "#0E5FB5" : "#000";
38+
});
39+
});
40+
41+
star.addEventListener("mouseleave", () => {
42+
stars.forEach((s) => {
43+
s.innerHTML = "☆";
44+
s.style.color = "#000";
45+
});
46+
});
47+
48+
star.addEventListener("click", () => {
49+
const formURL = "https://docs.google.com/forms/d/e/1FAIpQLSfhscELpzoXB4uyh9pXNmXSeqKc10IH_DxmAoaVGID85sO0Aw/viewform";
50+
const ratingURL = `${formURL}?entry.303027158=${rating}`;
51+
window.open(ratingURL, "_blank");
52+
});
53+
});
54+
});
55+
</script>

docs/css/extra.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,10 @@
2828
fill: currentColor;
2929
vertical-align: middle;
3030
}
31+
32+
.feedback-widget:hover {
33+
box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.12),
34+
0px 4px 5px 0px rgba(0, 0, 0, 0.14),
35+
0px 2px 4px -1px rgba(0, 0, 0, 0.20);
36+
transition: all 0.2s ease-out;
37+
}

docs/js/feedback.js

Lines changed: 0 additions & 94 deletions
This file was deleted.

mkdocs-base.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ extra_javascript:
7070
- js/version-select.js
7171
- js/promptremover.js
7272
- js/consent.js
73-
- js/feedback.js
7473

7574
markdown_extensions:
7675
attr_list: {}

mkdocs.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,5 @@ extra:
1414
analytics:
1515
provider: google
1616
property: G-J4J70BNH0G
17-
# feedback:
18-
# title: Was this page helpful?
19-
# ratings:
20-
# - icon: material/emoticon-happy-outline
21-
# name: This page was helpful
22-
# data: 1
23-
# note: >-
24-
# Thank you for your feedback!
25-
# - icon: material/emoticon-sad-outline
26-
# name: This page could be improved
27-
# data: 0
28-
# note: >-
29-
# Thanks for your feedback! Want to improve this page? Click <strong>Edit this page on GitHub</strong> above to submit a pull request.
17+
3018

0 commit comments

Comments
 (0)