riya123 commited on
Commit
74bba2f
1 Parent(s): 725a9d8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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):
10
+ r = requests.get(url)
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()