Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -14,11 +14,11 @@ css = """
|
|
| 14 |
font-size: 12px;
|
| 15 |
color: #555;
|
| 16 |
margin-top: 0px;
|
| 17 |
-
margin-bottom:
|
| 18 |
}
|
| 19 |
.subcriteria {
|
| 20 |
-
margin-bottom:
|
| 21 |
-
padding:
|
| 22 |
}
|
| 23 |
.category-header {
|
| 24 |
margin-top: 6px;
|
|
@@ -33,7 +33,7 @@ css = """
|
|
| 33 |
margin-bottom: 6px;
|
| 34 |
font-size: 20px;
|
| 35 |
}
|
| 36 |
-
/* Enlarge slider thumb for easier touch */
|
| 37 |
div[data-baseweb="slider"] .Thumb {
|
| 38 |
width: 24px !important;
|
| 39 |
height: 24px !important;
|
|
@@ -70,7 +70,7 @@ css = """
|
|
| 70 |
"""
|
| 71 |
st.markdown(css, unsafe_allow_html=True)
|
| 72 |
|
| 73 |
-
# Define criteria with names and descriptions
|
| 74 |
criteria = {
|
| 75 |
"Writing": [
|
| 76 |
{"name": "Dialogue", "description": "Word choice, realism, subtext, and implications."},
|
|
@@ -127,13 +127,12 @@ def calculate_score(ratings):
|
|
| 127 |
st.markdown("<h1 class='app-header'>Movie Rating System</h1>", unsafe_allow_html=True)
|
| 128 |
ratings = []
|
| 129 |
|
| 130 |
-
#
|
| 131 |
-
# then the description
|
| 132 |
for group, subcriteria in criteria.items():
|
| 133 |
st.markdown(f"<div class='category-header'>{group}</div>", unsafe_allow_html=True)
|
| 134 |
for idx, crit in enumerate(subcriteria):
|
| 135 |
with st.container():
|
| 136 |
-
# Header row: name on the left and include checkbox on the right.
|
| 137 |
header_cols = st.columns([4, 0.5])
|
| 138 |
header_cols[0].markdown(f"<span class='criteria-name'>{crit['name']}</span>", unsafe_allow_html=True)
|
| 139 |
include = header_cols[1].checkbox("", value=True, key=f"include_{group}_{idx}")
|
|
|
|
| 14 |
font-size: 12px;
|
| 15 |
color: #555;
|
| 16 |
margin-top: 0px;
|
| 17 |
+
margin-bottom: 0px; /* Remove gap below description */
|
| 18 |
}
|
| 19 |
.subcriteria {
|
| 20 |
+
margin-bottom: 0px; /* Remove extra bottom margin */
|
| 21 |
+
padding: 0px; /* Remove padding */
|
| 22 |
}
|
| 23 |
.category-header {
|
| 24 |
margin-top: 6px;
|
|
|
|
| 33 |
margin-bottom: 6px;
|
| 34 |
font-size: 20px;
|
| 35 |
}
|
| 36 |
+
/* Enlarge the slider thumb for easier touch */
|
| 37 |
div[data-baseweb="slider"] .Thumb {
|
| 38 |
width: 24px !important;
|
| 39 |
height: 24px !important;
|
|
|
|
| 70 |
"""
|
| 71 |
st.markdown(css, unsafe_allow_html=True)
|
| 72 |
|
| 73 |
+
# Define criteria grouped by category with names and descriptions
|
| 74 |
criteria = {
|
| 75 |
"Writing": [
|
| 76 |
{"name": "Dialogue", "description": "Word choice, realism, subtext, and implications."},
|
|
|
|
| 127 |
st.markdown("<h1 class='app-header'>Movie Rating System</h1>", unsafe_allow_html=True)
|
| 128 |
ratings = []
|
| 129 |
|
| 130 |
+
# For each category and criterion, display a header row with the criterion name and include checkbox,
|
| 131 |
+
# then the description immediately below, followed immediately by the slider.
|
| 132 |
for group, subcriteria in criteria.items():
|
| 133 |
st.markdown(f"<div class='category-header'>{group}</div>", unsafe_allow_html=True)
|
| 134 |
for idx, crit in enumerate(subcriteria):
|
| 135 |
with st.container():
|
|
|
|
| 136 |
header_cols = st.columns([4, 0.5])
|
| 137 |
header_cols[0].markdown(f"<span class='criteria-name'>{crit['name']}</span>", unsafe_allow_html=True)
|
| 138 |
include = header_cols[1].checkbox("", value=True, key=f"include_{group}_{idx}")
|