Update app.py
Browse files
app.py
CHANGED
@@ -17,12 +17,12 @@ def generate_summary(text):
|
|
17 |
# Custom CSS styling
|
18 |
st.markdown("""<style>
|
19 |
.main {
|
20 |
-
background-color:
|
21 |
-
|
22 |
font-family: 'Arial', sans-serif;
|
23 |
}
|
24 |
.stTextArea textarea {
|
25 |
-
border: 2px solid
|
26 |
border-radius: 12px;
|
27 |
padding: 15px;
|
28 |
font-family: 'Segoe UI', sans-serif;
|
@@ -31,13 +31,15 @@ st.markdown("""<style>
|
|
31 |
max-width: 800px;
|
32 |
margin: 20px auto;
|
33 |
font-size: 16px;
|
|
|
|
|
34 |
}
|
35 |
.stTextArea textarea:focus {
|
36 |
-
border-color:
|
37 |
-
box-shadow: 0 0 10px
|
38 |
}
|
39 |
.stButton>button {
|
40 |
-
background-color:
|
41 |
color: white;
|
42 |
border-radius: 25px;
|
43 |
border: none;
|
@@ -46,31 +48,32 @@ st.markdown("""<style>
|
|
46 |
font-weight: bold;
|
47 |
box-shadow: 0 4px 12px rgba(41, 182, 246, 0.3);
|
48 |
transition: all 0.3s ease;
|
49 |
-
margin-right: 10px;
|
50 |
}
|
51 |
.stButton>button:hover {
|
52 |
-
background-color:
|
53 |
box-shadow: 0 6px 14px rgba(2, 136, 209, 0.4);
|
54 |
transform: translateY(-2px);
|
55 |
}
|
56 |
.stTitle {
|
57 |
-
color:
|
58 |
font-size: 2.5em;
|
59 |
text-align: center;
|
60 |
margin-bottom: 20px;
|
61 |
font-family: 'Segoe UI', sans-serif;
|
62 |
}
|
63 |
.summary-container {
|
64 |
-
background-color:
|
65 |
border-radius: 12px;
|
66 |
padding: 20px;
|
67 |
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
68 |
margin-top: 20px;
|
69 |
max-width: 800px;
|
70 |
margin: 20px auto;
|
|
|
71 |
}
|
72 |
.summary-title {
|
73 |
-
color:
|
74 |
font-weight: bold;
|
75 |
font-size: 1.5em;
|
76 |
margin-bottom: 10px;
|
@@ -79,16 +82,24 @@ st.markdown("""<style>
|
|
79 |
text-align: center;
|
80 |
margin-top: 50px;
|
81 |
padding: 20px;
|
82 |
-
color:
|
83 |
font-style: italic;
|
84 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
</style>""", unsafe_allow_html=True)
|
86 |
|
87 |
# Application UI
|
88 |
st.title(" Text Summarizer App")
|
89 |
text = st.text_area("Enter the text you want to summarize...", height=200)
|
90 |
|
91 |
-
col1, col2 = st.columns(2)
|
92 |
|
93 |
with col1:
|
94 |
if st.button("Generate Summary"):
|
@@ -102,7 +113,7 @@ with col1:
|
|
102 |
|
103 |
with col2:
|
104 |
if st.button("Refresh"):
|
105 |
-
st.experimental_rerun()
|
106 |
|
107 |
# Footer
|
108 |
st.markdown("""<div class="footer"> Created with hadheedo</div>""", unsafe_allow_html=True)
|
|
|
17 |
# Custom CSS styling
|
18 |
st.markdown("""<style>
|
19 |
.main {
|
20 |
+
background-color: var(--background-primary);
|
21 |
+
color: var(--text-primary);
|
22 |
font-family: 'Arial', sans-serif;
|
23 |
}
|
24 |
.stTextArea textarea {
|
25 |
+
border: 2px solid var(--primary-color);
|
26 |
border-radius: 12px;
|
27 |
padding: 15px;
|
28 |
font-family: 'Segoe UI', sans-serif;
|
|
|
31 |
max-width: 800px;
|
32 |
margin: 20px auto;
|
33 |
font-size: 16px;
|
34 |
+
background-color: var(--background-secondary);
|
35 |
+
color: var(--text-primary);
|
36 |
}
|
37 |
.stTextArea textarea:focus {
|
38 |
+
border-color: var(--primary-color-dark);
|
39 |
+
box-shadow: 0 0 10px var(--primary-color-light);
|
40 |
}
|
41 |
.stButton>button {
|
42 |
+
background-color: var(--primary-color);
|
43 |
color: white;
|
44 |
border-radius: 25px;
|
45 |
border: none;
|
|
|
48 |
font-weight: bold;
|
49 |
box-shadow: 0 4px 12px rgba(41, 182, 246, 0.3);
|
50 |
transition: all 0.3s ease;
|
51 |
+
margin-right: 10px;
|
52 |
}
|
53 |
.stButton>button:hover {
|
54 |
+
background-color: var(--primary-color-dark);
|
55 |
box-shadow: 0 6px 14px rgba(2, 136, 209, 0.4);
|
56 |
transform: translateY(-2px);
|
57 |
}
|
58 |
.stTitle {
|
59 |
+
color: var(--primary-color);
|
60 |
font-size: 2.5em;
|
61 |
text-align: center;
|
62 |
margin-bottom: 20px;
|
63 |
font-family: 'Segoe UI', sans-serif;
|
64 |
}
|
65 |
.summary-container {
|
66 |
+
background-color: var(--background-secondary);
|
67 |
border-radius: 12px;
|
68 |
padding: 20px;
|
69 |
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
70 |
margin-top: 20px;
|
71 |
max-width: 800px;
|
72 |
margin: 20px auto;
|
73 |
+
color: var(--text-primary);
|
74 |
}
|
75 |
.summary-title {
|
76 |
+
color: var(--primary-color-dark);
|
77 |
font-weight: bold;
|
78 |
font-size: 1.5em;
|
79 |
margin-bottom: 10px;
|
|
|
82 |
text-align: center;
|
83 |
margin-top: 50px;
|
84 |
padding: 20px;
|
85 |
+
color: var(--primary-color);
|
86 |
font-style: italic;
|
87 |
}
|
88 |
+
|
89 |
+
@media (max-width: 600px) {
|
90 |
+
.stButton>button {
|
91 |
+
width: 100%;
|
92 |
+
margin-right: 0;
|
93 |
+
margin-bottom: 10px;
|
94 |
+
}
|
95 |
+
}
|
96 |
</style>""", unsafe_allow_html=True)
|
97 |
|
98 |
# Application UI
|
99 |
st.title(" Text Summarizer App")
|
100 |
text = st.text_area("Enter the text you want to summarize...", height=200)
|
101 |
|
102 |
+
col1, col2 = st.columns(2)
|
103 |
|
104 |
with col1:
|
105 |
if st.button("Generate Summary"):
|
|
|
113 |
|
114 |
with col2:
|
115 |
if st.button("Refresh"):
|
116 |
+
st.experimental_rerun()
|
117 |
|
118 |
# Footer
|
119 |
st.markdown("""<div class="footer"> Created with hadheedo</div>""", unsafe_allow_html=True)
|