Suchith-nj commited on
Commit
70b286a
·
1 Parent(s): f6eabe2

fix scrolling

Browse files
Files changed (2) hide show
  1. .streamlit/config.toml +4 -1
  2. app.py +43 -1
.streamlit/config.toml CHANGED
@@ -2,4 +2,7 @@
2
  primaryColor = "#FF9D00"
3
  backgroundColor = "#ffffff"
4
  secondaryBackgroundColor = "#f0f2f6"
5
- textColor = "#262730"
 
 
 
 
2
  primaryColor = "#FF9D00"
3
  backgroundColor = "#ffffff"
4
  secondaryBackgroundColor = "#f0f2f6"
5
+ textColor = "#262730"
6
+
7
+ [runner]
8
+ fastReruns = true
app.py CHANGED
@@ -10,10 +10,35 @@ st.set_page_config(
10
  )
11
 
12
  # Custom CSS
 
13
  st.markdown("""
14
  <style>
15
- .main {padding: 2rem;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  h1 {color: #FF9D00;}
 
17
  .highlight-box {
18
  padding: 2rem;
19
  background: linear-gradient(135deg, #FF9D00 0%, #FFD21E 100%);
@@ -22,11 +47,28 @@ st.markdown("""
22
  margin: 1rem 0;
23
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
24
  }
 
25
  .metric-card {
26
  background: #f0f2f6;
27
  padding: 1.5rem;
28
  border-radius: 10px;
29
  text-align: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
  </style>
32
  """, unsafe_allow_html=True)
 
10
  )
11
 
12
  # Custom CSS
13
+ # Custom CSS (replace your existing st.markdown CSS section)
14
  st.markdown("""
15
  <style>
16
+ /* Smooth scrolling fix */
17
+ html {
18
+ scroll-behavior: smooth;
19
+ }
20
+
21
+ /* Remove Streamlit's sticky header that causes jumping */
22
+ header {
23
+ background: transparent !important;
24
+ }
25
+
26
+ /* Smooth container scrolling */
27
+ .main {
28
+ padding: 2rem;
29
+ scroll-behavior: smooth;
30
+ overflow-y: auto;
31
+ }
32
+
33
+ /* Fix mobile scrolling */
34
+ body {
35
+ overflow-x: hidden;
36
+ -webkit-overflow-scrolling: touch;
37
+ }
38
+
39
+ /* Your existing styles */
40
  h1 {color: #FF9D00;}
41
+
42
  .highlight-box {
43
  padding: 2rem;
44
  background: linear-gradient(135deg, #FF9D00 0%, #FFD21E 100%);
 
47
  margin: 1rem 0;
48
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
49
  }
50
+
51
  .metric-card {
52
  background: #f0f2f6;
53
  padding: 1.5rem;
54
  border-radius: 10px;
55
  text-align: center;
56
+ transition: transform 0.2s ease;
57
+ }
58
+
59
+ .metric-card:hover {
60
+ transform: translateY(-2px);
61
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
62
+ }
63
+
64
+ /* Smooth expander animations */
65
+ .streamlit-expanderHeader {
66
+ transition: all 0.3s ease;
67
+ }
68
+
69
+ /* Fix accordion jumping */
70
+ details {
71
+ scroll-margin-top: 2rem;
72
  }
73
  </style>
74
  """, unsafe_allow_html=True)