ez326 commited on
Commit
b2fde99
·
verified ·
1 Parent(s): e2ef182

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -14,11 +14,11 @@ css = """
14
  font-size: 12px;
15
  color: #555;
16
  margin-top: 0px;
17
- margin-bottom: 2px;
18
  }
19
  .subcriteria {
20
- margin-bottom: 2px;
21
- padding: 1px 0;
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
- # Loop through criteria; for each, display a header row with the criterion name and a small include checkbox,
131
- # then the description and the slider (with minimal spacing).
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}")