Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,9 @@
|
|
| 1 |
-
import
|
|
|
|
| 2 |
|
| 3 |
-
import
|
| 4 |
-
|
| 5 |
-
from streamlit_lottie import
|
| 6 |
-
|
| 7 |
-
# GitHub: https://github.com/andfanilo/streamlit-lottie
|
| 8 |
-
# Lottie Files: https://lottiefiles.com/
|
| 9 |
-
|
| 10 |
-
def load_lottiefile(filepath: str):
|
| 11 |
-
with open(filepath, "r") as f:
|
| 12 |
-
return json.load(f)
|
| 13 |
|
| 14 |
|
| 15 |
def load_lottieurl(url: str):
|
|
@@ -17,19 +11,17 @@ def load_lottieurl(url: str):
|
|
| 17 |
if r.status_code != 200:
|
| 18 |
return None
|
| 19 |
return r.json()
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
key=None,
|
| 35 |
-
)
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
import requests
|
| 3 |
|
| 4 |
+
import streamlit as st
|
| 5 |
+
from streamlit_lottie import st_lottie
|
| 6 |
+
from streamlit_lottie import st_lottie_spinner
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def load_lottieurl(url: str):
|
|
|
|
| 11 |
if r.status_code != 200:
|
| 12 |
return None
|
| 13 |
return r.json()
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
lottie_url_hello = "https://assets5.lottiefiles.com/packages/lf20_V9t630.json"
|
| 17 |
+
lottie_url_download = "https://assets4.lottiefiles.com/private_files/lf30_t26law.json"
|
| 18 |
+
lottie_hello = load_lottieurl(lottie_url_hello)
|
| 19 |
+
lottie_download = load_lottieurl(lottie_url_download)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
st_lottie(lottie_hello, key="hello")
|
| 23 |
+
|
| 24 |
+
if st.button("Download"):
|
| 25 |
+
with st_lottie_spinner(lottie_download, key="download"):
|
| 26 |
+
time.sleep(5)
|
| 27 |
+
st.balloons()
|
|
|
|
|
|