Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -771,6 +771,21 @@ def create_likert_question(question, key, scale_type="5point"):
|
|
| 771 |
""",
|
| 772 |
unsafe_allow_html=True
|
| 773 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 774 |
|
| 775 |
return value
|
| 776 |
|
|
|
|
| 771 |
""",
|
| 772 |
unsafe_allow_html=True
|
| 773 |
)
|
| 774 |
+
st.components.v1.html(f"""
|
| 775 |
+
<script>
|
| 776 |
+
(function() {{
|
| 777 |
+
const slider = parent.document.querySelector('[data-testid="stSlider"] [aria-valuenow="{value}"]');
|
| 778 |
+
if(slider) {{
|
| 779 |
+
slider.parentElement.style.background = `repeating-linear-gradient(
|
| 780 |
+
to right,
|
| 781 |
+
#6a0dad, #6a0dad 2px,
|
| 782 |
+
transparent 2px, transparent calc(100%/{max_value-1} - 1px),
|
| 783 |
+
#6a0dad calc(100%/{max_value-1}), #6a0dad calc(100%/{max_value-1} + 1px)
|
| 784 |
+
)`;
|
| 785 |
+
}}
|
| 786 |
+
}})();
|
| 787 |
+
</script>
|
| 788 |
+
""", height=0)
|
| 789 |
|
| 790 |
return value
|
| 791 |
|