Spaces:
Runtime error
Runtime error
import requests | |
import streamlit | |
from streamlit_lottie import st_lottie | |
def load_lottieurl(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") |