Becer commited on
Commit
f2ca6bb
·
1 Parent(s): 5f5fa18

Replaced product borders with horizontal lines, minimized spacing

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -21,16 +21,10 @@ st.markdown('<div class="app-container">', unsafe_allow_html=True)
21
  # 🎨 Custom CSS for better UI
22
  st.markdown("""
23
  <style>
24
- /* ✅ Ramka produktu */
25
  .item-container {
26
- display: flex;
27
- flex-direction: column;
28
- justify-content: center;
29
- padding: 10px;
30
- border: 1px solid #ddd;
31
- border-radius: 5px;
32
- background-color: #f9f9f9;
33
- margin-bottom: 5px; /* Minimalny odstęp między produktami */
34
  width: 100%;
35
  }
36
 
@@ -49,15 +43,25 @@ st.markdown("""
49
  margin-top: 0px !important;
50
  }
51
 
52
- /* ✅ Pole do wpisywania ilości (100% szerokości, bez odstępu) */
53
  div[data-testid="stNumberInput"] {
54
- margin-top: -5px !important; /* Usunięcie zbędnej przestrzeni */
55
  width: 100% !important;
56
  }
 
 
 
 
 
 
 
 
 
57
  </style>
58
  """, unsafe_allow_html=True)
59
 
60
 
 
61
  # 📥 File uploader
62
  uploaded_file = st.file_uploader("📂 Upload an Excel file", type=["xlsx"])
63
 
@@ -135,8 +139,8 @@ if uploaded_file:
135
  st.subheader("🛍️ Select item quantities:")
136
  for category, items in categories.items():
137
  with st.expander(category, expanded=False): # Grupy domyślnie zwinięte
138
- for _, row in df[df["Name"].isin(items)].iterrows():
139
- # 🔹 Wyświetlanie produktu (bez inputa wewnątrz!)
140
  st.markdown(f"""
141
  <div class="item-container">
142
  <p class="item-name">{row['Name']}</p>
@@ -146,9 +150,10 @@ if uploaded_file:
146
  WSS: {row['WSS Min']:.2f}-{row['WSS Max']:.2f}
147
  </p>
148
  </div>
 
149
  """, unsafe_allow_html=True)
150
 
151
- # 🔹 Input BEZPOŚREDNIO pod ramką
152
  user_inputs[row['Name']] = st.number_input(
153
  "", min_value=0, step=1, key=row['Name']
154
  )
 
21
  # 🎨 Custom CSS for better UI
22
  st.markdown("""
23
  <style>
24
+ /* ✅ Usunięcie marginesów między produktami */
25
  .item-container {
26
+ padding: 5px;
27
+ margin-bottom: 0px !important;
 
 
 
 
 
 
28
  width: 100%;
29
  }
30
 
 
43
  margin-top: 0px !important;
44
  }
45
 
46
+ /* ✅ Input dokładnie pod produktem */
47
  div[data-testid="stNumberInput"] {
48
+ margin-top: -8px !important; /* Jeszcze mniejszy odstęp */
49
  width: 100% !important;
50
  }
51
+
52
+ /* ✅ Pozioma kreska między produktami */
53
+ hr {
54
+ margin-top: 4px !important;
55
+ margin-bottom: 4px !important;
56
+ border: 0;
57
+ height: 1px;
58
+ background: #ccc;
59
+ }
60
  </style>
61
  """, unsafe_allow_html=True)
62
 
63
 
64
+
65
  # 📥 File uploader
66
  uploaded_file = st.file_uploader("📂 Upload an Excel file", type=["xlsx"])
67
 
 
139
  st.subheader("🛍️ Select item quantities:")
140
  for category, items in categories.items():
141
  with st.expander(category, expanded=False): # Grupy domyślnie zwinięte
142
+ for i, row in df[df["Name"].isin(items)].iterrows():
143
+ # 🔹 Wyświetlanie produktu bez ramki, ale z poziomą kreską
144
  st.markdown(f"""
145
  <div class="item-container">
146
  <p class="item-name">{row['Name']}</p>
 
150
  WSS: {row['WSS Min']:.2f}-{row['WSS Max']:.2f}
151
  </p>
152
  </div>
153
+ <hr> <!-- 🔹 Pozioma linia oddzielająca produkty -->
154
  """, unsafe_allow_html=True)
155
 
156
+ # 🔹 Input od razu pod produktem, bez zbędnych odstępów
157
  user_inputs[row['Name']] = st.number_input(
158
  "", min_value=0, step=1, key=row['Name']
159
  )