Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
# Compact custom CSS for mobile-friendly design
|
| 4 |
css = """
|
| 5 |
<style>
|
| 6 |
.criteria-name {
|
|
@@ -116,13 +116,13 @@ for group, subcriteria in criteria.items():
|
|
| 116 |
<div class='criteria-description'>{crit['description']}</div>
|
| 117 |
</div>
|
| 118 |
""", unsafe_allow_html=True)
|
| 119 |
-
# Use two columns
|
| 120 |
-
cols = st.columns([3,
|
| 121 |
na_key = f"na_{group}_{idx}"
|
| 122 |
slider_key = f"slider_{group}_{idx}"
|
| 123 |
na = cols[1].checkbox("N/A", key=na_key)
|
| 124 |
-
# Float slider from 1.0 to 7.0 with default value 4.0 and a step
|
| 125 |
-
rating = cols[0].slider("", 1.0, 7.0, 4.0, step=0.
|
| 126 |
ratings.append(None if na else rating)
|
| 127 |
|
| 128 |
if st.button("Calculate Score"):
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
# Compact custom CSS for mobile-friendly design and disabled slider styling
|
| 4 |
css = """
|
| 5 |
<style>
|
| 6 |
.criteria-name {
|
|
|
|
| 116 |
<div class='criteria-description'>{crit['description']}</div>
|
| 117 |
</div>
|
| 118 |
""", unsafe_allow_html=True)
|
| 119 |
+
# Use two columns with a much narrower column for the checkbox
|
| 120 |
+
cols = st.columns([3.8, 0.5])
|
| 121 |
na_key = f"na_{group}_{idx}"
|
| 122 |
slider_key = f"slider_{group}_{idx}"
|
| 123 |
na = cols[1].checkbox("N/A", key=na_key)
|
| 124 |
+
# Float slider from 1.0 to 7.0 with default value 4.0 and a step of 0.1
|
| 125 |
+
rating = cols[0].slider("", 1.0, 7.0, 4.0, step=0.01, key=slider_key, disabled=na)
|
| 126 |
ratings.append(None if na else rating)
|
| 127 |
|
| 128 |
if st.button("Calculate Score"):
|