eaglelandsonce commited on
Commit
5cfb870
·
verified ·
1 Parent(s): 082b00b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -27
app.py CHANGED
@@ -1,15 +1,9 @@
1
- import json
 
2
 
3
- import requests # pip install requests
4
- import streamlit as st # pip install streamlit
5
- from streamlit_lottie import st_lottie # pip install streamlit-lottie
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
- # lottie_coding = load_lottiefile("data/ballwalking.json") # replace link to local lottie file
23
- lottie_hello = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_M9p23l.json")
24
-
25
- st_lottie(
26
- lottie_hello,
27
- speed=1,
28
- reverse=False,
29
- loop=True,
30
- quality="low", # medium ; high
31
- renderer="svg", # canvas
32
- height=None,
33
- width=None,
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()