Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,4 +27,32 @@ def add_bg_from_url():
|
|
| 27 |
unsafe_allow_html=True
|
| 28 |
)
|
| 29 |
|
| 30 |
-
add_bg_from_url()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
unsafe_allow_html=True
|
| 28 |
)
|
| 29 |
|
| 30 |
+
add_bg_from_url()
|
| 31 |
+
|
| 32 |
+
import time
|
| 33 |
+
import requests
|
| 34 |
+
|
| 35 |
+
import streamlit as st
|
| 36 |
+
from streamlit_lottie import st_lottie
|
| 37 |
+
from streamlit_lottie import st_lottie_spinner
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def load_lottieurl(url: str):
|
| 41 |
+
r = requests.get(url)
|
| 42 |
+
if r.status_code != 200:
|
| 43 |
+
return None
|
| 44 |
+
return r.json()
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
lottie_url_hello = "https://assets5.lottiefiles.com/packages/lf20_V9t630.json"
|
| 48 |
+
lottie_url_download = "https://assets4.lottiefiles.com/private_files/lf30_t26law.json"
|
| 49 |
+
lottie_hello = load_lottieurl(lottie_url_hello)
|
| 50 |
+
lottie_download = load_lottieurl(lottie_url_download)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
st_lottie(lottie_hello, key="hello")
|
| 54 |
+
|
| 55 |
+
if st.button("Download"):
|
| 56 |
+
with st_lottie_spinner(lottie_download, key="download"):
|
| 57 |
+
time.sleep(5)
|
| 58 |
+
st.balloons()
|