Load GSAP and ScrollTrigger locally in Breakdance

Tutorials, Tips

Contents

You created an element on your website with Breakdance, but then realized that two files named gsap.min.js and ScrollTrigger.min.js be loaded from an external domain? This can be problematic from a GDPR perspective. In this tutorial, we will show you how to load these files locally.

1. download files

First download these 2 files and upload them to your server via FTP. For example, you could create a folder in your WordPress installation.
/wp-content/custom-files/

2. add code

Now the uploaded files must be loaded via a PHP script. Normally you use the functions.php of the current theme for this. Since Breakdance is usually used without a theme, we need a different solution for the code. It is best to use a plugin like WP Code. Here you can add the following PHP code:

add_action('breakdance_reusable_dependencies_urls', function ($urls) {
   $urls['gsap'] = '/wp-content/custom-files/gsap.min.js';
   $urls['scrollTrigger'] = '/wp-content/custom-files/ScrollTrigger.min.js';
   return $urls;
});

Conclusion!

That's it! Now the 2 files are loaded locally.

Share
Contact now

Let's finish your website.

What we guarantee

You will only receive an invoice if we have been able to help!

Our team works hard every day to solve problems quickly for our customers or to achieve optimal results during implementation. As a result, bedemy is now known for its first-class service and has many happy customers. Our past experience and belief in our abilities enables us to offer new customers a unique promise that underlines our commitment to customer satisfaction.

We only issue an invoice if we have really been able to help!

If we are unable to help with a problem or implementation, we will not issue an invoice. Even if we have already invested time. You have no risk, because even in the event that we have implemented everything as requested, our costs are transparent, agreed in advance and never exceed the planned budget!

What our help costs

No nasty surprises

We charge according to a fixed hourly rate, which we will inform you of in a written offer before we charge you for the use of our team. This means that implementing a small feature or fixing a problem is usually quick (often within a few minutes) and therefore doesn't cost much. The implementation of a complete site, on the other hand, can take a few days (depending on the scope).

But you don't have to worry about the costs.

Firstly, you will always receive a quote from us in advance via email, even for smaller support requests. Secondly, we always stick to this cost estimate unless we tell you otherwise. If, during implementation, we realize that the task assigned to us is more complex and will take longer, we will contact you with a revised cost estimate. You can then decide whether you are prepared to accept this revised offer or not. If it's too much for you, we'll stop the project and you won't pay a penny. Not even for the work we have already invested in the project up to that point (according to the initial estimate).