I stopped trying to make this work with Embed and json code because of the size of my jsons. My plan was to try to emulate the component and use a dummy lottie component with a certain class that’d match the class declared in custom code…
Well, we all want what you want and I think we’re all entitled to because it makes sense, right? So I hope this happens some day soon Go check if the idea is on the whishlist already maybe and if it’s not, add it.
Hmm your solution actually sounds pretty good, if I can keep the size of the JSONs down. If you ever end up writing out what you were doing I’d love to check it out (sadly can’t code so I can’t piece it together from what you wrote there )
Hey @ericlchen — I suppose if you gave a class to the actual container, then used “class” based (rather than element based) Webflow animations, it would be possible.
Hey @Julian_Wan thanks so much for the suggestion. I tried to do what you said and added a class to the in the embed and tried to reference it within Interactions, but it’s not animating on the live site. Am I adding the class to the correct element? When I click the keyframe in the interaction it references the Lottie element I have hidden currently, because I couldn’t use a Lottie interaction unless I clicked on a Lottie element. Thanks!
I figured out a way to do this while trying to figure out a way to implement embed elements in cms pages. In short, I’m building a site for a tattoo parlour. My only cms collection is the artists that work at the parlour. Each artist page should pull content from their respective instagram page. I used elfsight’s plugin because it can filter posts by hashtag, as to not pull personal photos like selfies or unrelated tattoo content.
Back to business.
On the artist template page, I placed a separate embed element for each artist. Four artists - four embed elements.
Going back in to the cms collection settings, I also added a toggle for each artists, and gave each toggle the name of the tattoo artist. Now going into each artist’s settings, I turn on their respective toggle. ie; On simon’s settings, I turn on the simon toggle. On Sylvain’s settings, I turn on the Sylvain toggle. Do this for each cms item.
Go back into the cms page template and add a filter on each embed element (visible only when simon toggle is on) (visible only when sylvain is toggle is on) etc.
Now when you preview your site, only the embed for simon will show on his page.
@andydaoo => You’re loading <script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script> for each instance of an item in your collection. Don’t.
To piggyback on what @webdev said, you only need to load a script once.
Think of it like introducing yourself at a party. Once you’ve been introduced, the system will keep track of who you are and what you defined about yourself. (And keep track of what the script is defining and describing).
But doing that again, for everyone else you meet, will definitely crash your system.
Hey!
Maybe you can help me with an animation. I have a problem with the renderer. When I use SVG the file flickers in Safari and Chrome and in Canvas it looks all weird. View image.