LinkLinkWu commited on
Commit
b1984fa
Β·
verified Β·
1 Parent(s): 36ccfe7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -20
app.py CHANGED
@@ -21,26 +21,15 @@ st.markdown("""
21
  body {
22
  background-color: #ffffff;
23
  }
24
- .title-wrapper {
25
- display: inline-block;
26
- white-space: nowrap;
27
- overflow-x: auto;
28
- max-width: 100%;
29
- }
30
- .title-wrapper::-webkit-scrollbar {
31
- height: 4px;
32
- }
33
- .title-wrapper::-webkit-scrollbar-thumb {
34
- background-color: #ccc;
35
- border-radius: 2px;
36
- }
37
- .main-title {
38
  color: #002b45;
39
  font-family: 'Segoe UI', sans-serif;
40
  font-size: 21px;
41
  font-weight: 600;
42
  margin: 0;
43
  }
 
44
  .stTextInput > div > div > input,
45
  .stTextArea textarea {
46
  font-size: 16px;
@@ -61,12 +50,11 @@ st.markdown("""
61
  </style>
62
  """, unsafe_allow_html=True)
63
 
64
- # ----------- Header Title (One-line, Scrollable if Long) -----------
65
- st.markdown("""
66
- <div class="title-wrapper">
67
- <h1 class="main-title">πŸ“Š EquiPulse: Stock Sentiment Tracker</h1>
68
- </div>
69
- """, unsafe_allow_html=True)
70
 
71
  # ----------- Description Section -----------
72
  st.markdown("""
@@ -110,6 +98,7 @@ if st.button("πŸ” Get News and Sentiment"):
110
  pos_ratio = pos_count / total if total else 0
111
  neg_ratio = neg_count / total if total else 0
112
 
 
113
  if pos_ratio >= 0.25:
114
  overall = "Positive"
115
  elif neg_ratio >= 0.75:
@@ -117,6 +106,7 @@ if st.button("πŸ” Get News and Sentiment"):
117
  else:
118
  overall = "Neutral"
119
 
 
120
  st.markdown(f"**πŸ“° Top News for `{ticker}`:**")
121
  for i, news in enumerate(news_list[:3]):
122
  st.markdown(f"{i+1}. [{news['title']}]({news['link']}) β€” **{sentiments[i]}**")
 
21
  body {
22
  background-color: #ffffff;
23
  }
24
+ /* Title styling */
25
+ h1.main-title {
 
 
 
 
 
 
 
 
 
 
 
 
26
  color: #002b45;
27
  font-family: 'Segoe UI', sans-serif;
28
  font-size: 21px;
29
  font-weight: 600;
30
  margin: 0;
31
  }
32
+ /* Input + Button styling */
33
  .stTextInput > div > div > input,
34
  .stTextArea textarea {
35
  font-size: 16px;
 
50
  </style>
51
  """, unsafe_allow_html=True)
52
 
53
+ # ----------- Header Title -----------
54
+ st.markdown(
55
+ '<h1 class="main-title">πŸ“Š EquiPulse: Stock Sentiment Tracker</h1>',
56
+ unsafe_allow_html=True
57
+ )
 
58
 
59
  # ----------- Description Section -----------
60
  st.markdown("""
 
98
  pos_ratio = pos_count / total if total else 0
99
  neg_ratio = neg_count / total if total else 0
100
 
101
+ # Simple heuristic for overall sentiment
102
  if pos_ratio >= 0.25:
103
  overall = "Positive"
104
  elif neg_ratio >= 0.75:
 
106
  else:
107
  overall = "Neutral"
108
 
109
+ # Display news
110
  st.markdown(f"**πŸ“° Top News for `{ticker}`:**")
111
  for i, news in enumerate(news_list[:3]):
112
  st.markdown(f"{i+1}. [{news['title']}]({news['link']}) β€” **{sentiments[i]}**")