Come posso inserire un'animazione Lottie nella homepage?

Hi there !

I’ve designed an animated version of my logo. Have a look here !

I converted it into .json (as a lottiefile animation) and I would like to place that animation in my header.
It should be possible to do it, only by pasting this bunch of code onto my page:

<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<lottie-player src="https://assets3.lottiefiles.com/packages/lf20_KrQ5B2.json"  background="transparent"  speed="1"  style="width: 600px;" autoplay >
</lottie-player> 

But when I do it on my Discourse project, it doesn’t work.
I don’t understand why because it’s calling an external resource, so it should be independant of the Discourse’s environnement isn’t it?

I’ve read in other topics that Discourse users weren’t able to use lottie animation instead of category icons.
But in my case, I don’t understand why it’s not working (if I paste the code in my body tag it should be working).

Could anybody help me out with this please? :slight_smile:

Non sono sicuro di come utilizzare l’animazione per il tuo logo, ma per far funzionare lo script sul tuo sito Discourse, devi aggiungere https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js all’impostazione del sito “content security policy script src”. Quando lo faccio e aggiungo lo script alla sezione Intestazione del mio tema, l’animazione viene visualizzata per me.

Funziona perfettamente!
Grazie per la tua risposta :slight_smile: