Soufianesejjari commited on
Commit
290ea24
·
1 Parent(s): 6f00151

fix design

Browse files
__pycache__/helper.cpython-311.pyc ADDED
Binary file (12.2 kB). View file
 
__pycache__/preprocessor.cpython-311.pyc ADDED
Binary file (4.58 kB). View file
 
app.py CHANGED
@@ -3,10 +3,86 @@ import preprocessor
3
  import helper
4
  import matplotlib.pyplot as plt
5
  import seaborn as sns
6
- import pandas as pd
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  st.set_option('deprecation.showPyplotGlobalUse', False)
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  st.sidebar.title("WhatsApp Chat Analyzer")
11
 
12
  uploaded_file = st.sidebar.file_uploader("Choose a file")
@@ -25,7 +101,6 @@ if uploaded_file is not None:
25
  selected_user = st.sidebar.selectbox("Show analysis wrt", user_list)
26
 
27
  if st.sidebar.button("Show Analysis"):
28
-
29
  # Stats Area
30
  num_messages, words, num_media_messages, num_links = helper.fetch_stats(selected_user, df)
31
  st.title("Top Statistics")
 
3
  import helper
4
  import matplotlib.pyplot as plt
5
  import seaborn as sns
6
+ from streamlit.components.v1 import html
7
+
8
+ # Page configuration
9
+ st.set_page_config(
10
+ page_title="WhatsApp Chat Analyzer",
11
+ layout="wide",
12
+ initial_sidebar_state="auto",
13
+ menu_items={
14
+ 'Get Help': 'https://github.com/soufianesejjari',
15
+ 'About': "# This is a WhatsApp Chat Analyzer app\n"
16
+ "#### built with Streamlit. It helps you analyze your WhatsApp chat data. You can visualize your chat data, including the number of messages, words, media shared, links shared, and more. You can also see the most active users, most common words, and emojis used. The app also provides a word cloud and timeline analysis of your chat data. The app is developed by Soufiane Sejjari. You can find the source code on GitHub."
17
+ }
18
+ )
19
 
20
  st.set_option('deprecation.showPyplotGlobalUse', False)
21
 
22
+
23
+ # SEO title and footer
24
+ def inject_html():
25
+ footer = """
26
+ <style>
27
+ .footer {
28
+ position: fixed;
29
+ left: 0;
30
+ bottom: 0;
31
+ width: 100%;
32
+ background-color: #f1f1f1;
33
+ color: #333;
34
+ text-align: center;
35
+ padding: 10px;
36
+ font-family: Arial, sans-serif;
37
+ }
38
+ .main-content {
39
+ max-width: 1000px;
40
+ margin: 0 auto;
41
+ padding: 20px;
42
+ }
43
+ h1 {
44
+ font-size: 2.5em;
45
+ color: #333;
46
+ }
47
+ h2 {
48
+ font-size: 2em;
49
+ color: #333;
50
+ }
51
+ h3 {
52
+ font-size: 1.75em;
53
+ color: #333;
54
+ }
55
+ h4 {
56
+ font-size: 1.5em;
57
+ color: #333;
58
+ }
59
+ h5 {
60
+ font-size: 1.25em;
61
+ color: #333;
62
+ }
63
+ .stButton>button {
64
+ background-color: #4CAF50;
65
+ color: white;
66
+ border: none;
67
+ padding: 10px 20px;
68
+ text-align: center;
69
+ text-decoration: none;
70
+ display: inline-block;
71
+ font-size: 16px;
72
+ margin: 4px 2px;
73
+ cursor: pointer;
74
+ border-radius: 12px;
75
+ }
76
+ </style>
77
+ <div class="footer">
78
+ <p>Developed by Soufiane Sejjari</p>
79
+ <p><a href="https://soufiane-s.netlify.app/" target="_blank">Portfolio</a> | <a href="https://github.com/soufianesejjari" target="_blank">GitHub</a></p>
80
+ </div>
81
+ """
82
+ st.markdown(footer, unsafe_allow_html=True)
83
+
84
+ inject_html()
85
+
86
  st.sidebar.title("WhatsApp Chat Analyzer")
87
 
88
  uploaded_file = st.sidebar.file_uploader("Choose a file")
 
101
  selected_user = st.sidebar.selectbox("Show analysis wrt", user_list)
102
 
103
  if st.sidebar.button("Show Analysis"):
 
104
  # Stats Area
105
  num_messages, words, num_media_messages, num_links = helper.fetch_stats(selected_user, df)
106
  st.title("Top Statistics")