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

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -4,7 +4,12 @@ st.set_page_config(layout="wide")
4
 
5
  css = """
6
  <style>
7
- /* Compact spacing for headings and descriptions */
 
 
 
 
 
8
  .criteria-name {
9
  font-size: 14px;
10
  font-weight: bold;
@@ -38,19 +43,20 @@ css = """
38
  width: 24px !important;
39
  height: 24px !important;
40
  }
41
- /* Hide slider tick marks, tick bar, and min/max texts */
42
  div[data-baseweb="slider"] .Tick,
43
  div[data-baseweb="slider"] .TickBar,
44
  div[data-testid="stSliderTickBarMin"],
45
  div[data-testid="stSliderTickBarMax"],
46
- div[data-testid="stSliderThumbValue"] {
 
47
  display: none !important;
48
  }
49
  /* Remove extra margin above slider */
50
  .stSlider {
51
  margin-top: 0px !important;
52
  }
53
- /* Prevent header columns from stacking on mobile */
54
  @media (max-width: 600px) {
55
  .stHorizontalBlock {
56
  flex-wrap: nowrap !important;
@@ -127,8 +133,9 @@ def calculate_score(ratings):
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):
 
4
 
5
  css = """
6
  <style>
7
+ /* Remove extra spacing from paragraphs in markdown */
8
+ .stMarkdown p {
9
+ margin: 0 !important;
10
+ padding: 0 !important;
11
+ }
12
+ /* Criteria header and description compact styling */
13
  .criteria-name {
14
  font-size: 14px;
15
  font-weight: bold;
 
43
  width: 24px !important;
44
  height: 24px !important;
45
  }
46
+ /* Hide slider tick marks, tick bar, min/max texts, and the empty label */
47
  div[data-baseweb="slider"] .Tick,
48
  div[data-baseweb="slider"] .TickBar,
49
  div[data-testid="stSliderTickBarMin"],
50
  div[data-testid="stSliderTickBarMax"],
51
+ div[data-testid="stSliderThumbValue"],
52
+ label[data-testid="stWidgetLabel"][aria-hidden="true"] {
53
  display: none !important;
54
  }
55
  /* Remove extra margin above slider */
56
  .stSlider {
57
  margin-top: 0px !important;
58
  }
59
+ /* Prevent header columns from stacking on mobile and reduce padding */
60
  @media (max-width: 600px) {
61
  .stHorizontalBlock {
62
  flex-wrap: nowrap !important;
 
133
  st.markdown("<h1 class='app-header'>Movie Rating System</h1>", unsafe_allow_html=True)
134
  ratings = []
135
 
136
+ # For each category and criterion, display:
137
+ # - A header row (criterion name and a small include checkbox)
138
+ # - Immediately below, the description and then the slider with no extra vertical space.
139
  for group, subcriteria in criteria.items():
140
  st.markdown(f"<div class='category-header'>{group}</div>", unsafe_allow_html=True)
141
  for idx, crit in enumerate(subcriteria):