File size: 852 Bytes
3508df5
 
 
39a82cc
3508df5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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)