CMS Development

OJuul
Member

Is it possible to add SVG animations (.json-files) - and if so, how?

SOLVE

Hey guys

 

I have some SVG icon animations saved as .json that I would like to add to my website.

Is there any easy way to read and print them? Perhaps through a custom module?

 

I have made it work with bodymovin on a normal html-page outside hubspot, but I'm not sure how to get it to work properly within hubspot.

 

I'm sorry if it's a stupid question, but I'm very new to hubspot in general.

 

All the best

0 Upvotes
1 Accepted solution
piersg
Solution
Key Advisor

Is it possible to add SVG animations (.json-files) - and if so, how?

SOLVE

Hi @OJuul, you would just need to include the bodymovin or Lottie scripts on the pages you want to use these animations

<script src="https://cdnjs.com/libraries/bodymovin" type="text/javascript"></script>
 or 
<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.8.1/lottie_light.min.js" integrity="sha512-IDFrIN7dXkq1kmaqq0aXZ83nFwErfWwnCD4UO1UtJdDZ8ZXvCyVa+vUTzirSxeZIHH9C+YaDgI+fsTd5uTyuqA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

 

 

View solution in original post

1 Reply 1
piersg
Solution
Key Advisor

Is it possible to add SVG animations (.json-files) - and if so, how?

SOLVE

Hi @OJuul, you would just need to include the bodymovin or Lottie scripts on the pages you want to use these animations

<script src="https://cdnjs.com/libraries/bodymovin" type="text/javascript"></script>
 or 
<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.8.1/lottie_light.min.js" integrity="sha512-IDFrIN7dXkq1kmaqq0aXZ83nFwErfWwnCD4UO1UtJdDZ8ZXvCyVa+vUTzirSxeZIHH9C+YaDgI+fsTd5uTyuqA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>