Spaces:
Sleeping
Sleeping
Update pages/🤢 You_are_toxic.py
Browse files- pages/🤢 You_are_toxic.py +51 -0
pages/🤢 You_are_toxic.py
CHANGED
@@ -8,6 +8,57 @@ import string
|
|
8 |
import pickle
|
9 |
import streamlit as st
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Функция очистки текста
|
12 |
def clean(text):
|
13 |
text = text.lower() # нижний регистр
|
|
|
8 |
import pickle
|
9 |
import streamlit as st
|
10 |
|
11 |
+
import base64
|
12 |
+
import plotly.express as px
|
13 |
+
|
14 |
+
df = px.data.iris()
|
15 |
+
|
16 |
+
@st.cache_data
|
17 |
+
def get_img_as_base64(file):
|
18 |
+
with open(file, "rb") as f:
|
19 |
+
data = f.read()
|
20 |
+
return base64.b64encode(data).decode()
|
21 |
+
|
22 |
+
|
23 |
+
#img = get_img_as_base64("https://catherineasquithgallery.com/uploads/posts/2021-02/1612739741_65-p-goluboi-fon-tsifri-110.jpg")
|
24 |
+
|
25 |
+
page_bg_img = f"""
|
26 |
+
<style>
|
27 |
+
[data-testid="stAppViewContainer"] > .main {{
|
28 |
+
background-image: url("https://wallpapercave.com/wp/wp11966930.jpg");
|
29 |
+
background-size: 115%;
|
30 |
+
background-position: top left;
|
31 |
+
background-repeat: no-repeat;
|
32 |
+
background-attachment: local;
|
33 |
+
}}
|
34 |
+
|
35 |
+
[data-testid="stSidebar"] > div:first-child {{
|
36 |
+
background-image: url("https://ibb.co/ZBkdJRg");
|
37 |
+
background-size: 115%;
|
38 |
+
background-position: center;
|
39 |
+
background-repeat: no-repeat;
|
40 |
+
background-attachment: fixed;
|
41 |
+
}}
|
42 |
+
|
43 |
+
[data-testid="stHeader"] {{
|
44 |
+
background: rgba(0,0,0,0);
|
45 |
+
}}
|
46 |
+
|
47 |
+
[data-testid="stToolbar"] {{
|
48 |
+
right: 2rem;
|
49 |
+
}}
|
50 |
+
|
51 |
+
div.css-1n76uvr.e1tzin5v0 {{
|
52 |
+
background-color: rgba(238, 238, 238, 0.5);
|
53 |
+
border: 10px solid #EEEEEE;
|
54 |
+
padding: 5% 5% 5% 10%;
|
55 |
+
border-radius: 5px;
|
56 |
+
}}
|
57 |
+
|
58 |
+
</style>
|
59 |
+
"""
|
60 |
+
st.markdown(page_bg_img, unsafe_allow_html=True)
|
61 |
+
|
62 |
# Функция очистки текста
|
63 |
def clean(text):
|
64 |
text = text.lower() # нижний регистр
|