Anime / app.py
Pranav4datasc's picture
Update app.py
39a82cc verified
Raw
History Blame Contribute Delete
852 Bytes
import json
import requests
import streamlit as st
from streamlit_lottie import st_lottie
def load_lottiefile(filepath: str):
with open (filepath, "r") as f:
return json.load(f)
def load_lottieurl(url: str):
r = requests.get(url)
if r.status_code != 200:
return None
return r.json()
#lottiefile1 = load_lottiefile("lottie1.mp4")
lottie_hello1 = load_lottieurl("https://lottie.host/052aa43f-953d-4952-85c1-35c6f1eb58a1/vEApoSht1W.json")
lottie_hello2 = load_lottieurl("https://lottie.host/8789072e-2035-423f-87fd-f2da60f8c24e/3uWgRlTXln.json")
lottie_hello3 = load_lottieurl("https://lottie.host/0d478ac1-2a52-4535-b4d9-fa717e890ce2/rYVGu2yZp1.json")
st.title("Amazing animation using lottiefiles")
st_lottie(lottie_hello1,loop=True)
st_lottie(lottie_hello2,loop=True)
st_lottie(lottie_hello3,loop=True)