INNER CODE UNIT · Python
create_lottie_html
OpenVGLab/OmniLottie · app.py:484
def create_lottie_html(animation_data, height=600):
bg_style = """
background-image:
linear-gradient(45deg, #666666 25%, transparent 25%),
linear-gradient(-45deg, #666666 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #666666 75%),
linear-gradient(-45deg, transparent 75%, #666666 75%);
background-size: 16px 16px;
background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
background-color: #444444;
"""
lottie_js = get_lottie_js()
if lottie_js.startswith('<script'):
lottie_script = lottie_js
else:
lottie_script = f"<script>{lottie_js}</script>"