Amrrs commited on
Commit
43bb682
1 Parent(s): eecdd30

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -0
app.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import streamlit
3
+ from streamlit_lottie import st_lottie
4
+
5
+
6
+ def load_lottieurl(url: str):
7
+ r = requests.get(url)
8
+ if r.status_code != 200:
9
+ return None
10
+ return r.json()
11
+
12
+
13
+ lottie_animation_1 = "https://assets5.lottiefiles.com/packages/lf20_1pxqjqps.json"
14
+
15
+ lottie_anime_json = load_lottie_url(lottie_animation_1)
16
+
17
+
18
+ lottie_animation_2 = "https://assets5.lottiefiles.com/packages/lf20_puciaact.json"
19
+
20
+ lottie_anime_json_2 = load_lottie_url(lottie_animation_2)
21
+
22
+
23
+ st.title('This demo shows streamlit-lottie with Lottie Animations')
24
+
25
+
26
+
27
+ st_lottie(lottie_anime_json, key = "hello")
28
+
29
+
30
+ st.markdown('# Lottie Animations are a great alternative for GIFs')
31
+
32
+ st_lottie(lottie_anime_json_2, key = "humans")
33
+
34
+ st.markdown("### This is amazing")