Spaces:
Runtime error
Runtime error
File size: 773 Bytes
43bb682 77a0eb6 43bb682 2f926fd 43bb682 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import requests
import streamlit as st
from streamlit_lottie import st_lottie
def load_lottie_url(url: str):
r = requests.get(url)
if r.status_code != 200:
return None
return r.json()
lottie_animation_1 = "https://assets5.lottiefiles.com/packages/lf20_1pxqjqps.json"
lottie_anime_json = load_lottie_url(lottie_animation_1)
lottie_animation_2 = "https://assets5.lottiefiles.com/packages/lf20_puciaact.json"
lottie_anime_json_2 = load_lottie_url(lottie_animation_2)
st.title('This demo shows streamlit-lottie with Lottie Animations')
st_lottie(lottie_anime_json, key = "hello")
st.markdown('# Lottie Animations are a great alternative for GIFs')
st_lottie(lottie_anime_json_2, key = "humans")
st.markdown("### This is amazing") |