\n

3. Initialize the Library

\n

Once the library is added, you can begin leveraging its features within your Webflow project. Start with a very basic example. For instance, let's create a simple animation using GSAP and trigger it on a button click:

\n

// GSAP Animationโ€‹
const button = document.querySelector('.my-button');
button.addEventListener('click', () => {
gsap.to('.my-element', { duration: 1, x: 100, opacity: 0 });
});

\n

4. Add Additional Features

\n

After getting a basic implementation of the library working in your Webflow project, start to explore and add additional configurations and functionality. Review the documentation and iterate as needed, making adjustments or optimizations based on testing results to ensure optimal performance.

\n

// GSAP Animationโ€‹
const button = document.querySelector('.my-button');
const elements = document.querySelectorAll('.my-element');
โ€‹
button.addEventListener('click', () => {
gsap.from(elements, {
duration: 1,
x: -100,
opacity: 0,
stagger: 0.2,
ease: \"power2.out\"
});
});

\n

5. Finalize Your Implementation

\n

Once you have the implementation working correctly, revisit the code and refactor it. Remove any dead code and simplify the remaining code. Document where needed for yourself and future collaborators.

\n

--

\n

Call to Action

\n

This weekend, try implementing a new JS library in your project, and share your favorite JS libraries with us. We'll use your favorite libraries for future JavaScript tutorials.

\n

Happy coding!

\n

โ€‹

\n

๐Ÿค™ The Slater team

\n
\n

โ€‹

\n

๐Ÿ™ If Slater helps you create better websites, please support the team behind it.

\n\n\n\n
\n\n
\n\n\n\n
\n
Get A Paid Plan
\n

โ€‹
โ€‹
1295 Canyon View Rd, Midway, UT 84049
โ€‹Unsubscribe ยท Preferencesโ€‹

\n
\n
\n\n\n\n

โ€‹

\n\n\n\n","recentPosts":[{"id":5611581,"title":"GPT 4oooooo!","slug":"gpt-4oooooo","status":"published","readingTime":2,"campaignCompletedAt":"2024-05-17T20:33:51.000Z","publishedAt":"2024-05-17T20:33:51.000Z","orderByDate":"2024-05-17T20:33:51.000Z","timeAgo":"2 days","thumbnailUrl":"https://embed.filekitcdn.com/e/f2wTcXHNz6CCWc9a5vGTv3/2TenamgiigePNKFnHx6WvQ","thumbnailAlt":null,"path":"posts/gpt-4oooooo","url":"https://slater.ck.page/posts/gpt-4oooooo","isPaid":null,"introContent":"You can now use OpenAI's latest and most powerful language model, GPT 4o, with Slater AI. We've been testing GPT 4o this week and Slater AI's capabilities are better and faster than ever! Along with the new model, we implemented several improvements to Slater AI. Slater AI will now give more Slater and Webflow relevant answers since we give Slater AI contextual understanding (h/t tdlabs.ca). We also improved the messages parsing (h/t @jeffamcavoy). Slater Sessions Slater Sessions are back! In...","campaignId":15296503,"publicationId":11821248},{"id":5553287,"title":"Slater ๐Ÿค GSAP ๐Ÿค Webflow","slug":"slater-gsap-webflow","status":"published","readingTime":1,"campaignCompletedAt":"2024-05-10T20:58:56.000Z","publishedAt":"2024-05-10T20:58:56.000Z","orderByDate":"2024-05-10T20:58:56.000Z","timeAgo":"9 days","thumbnailUrl":"https://functions-js.convertkit.com/playbutton?play=%23324C85&accent=%23ffffff&thumbnailof=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7qRek2GLbB8&width=480&height=270&fit=contain","thumbnailAlt":null,"path":"posts/slater-gsap-webflow","url":"https://slater.ck.page/posts/slater-gsap-webflow","isPaid":null,"introContent":"We were excited to be invited back on an official Webflow livestream this week. This time, Slater played a supporting role on \"Learn GSAP for Webflow.\" Aron and Cassie did an incredible job building a really cool GSAP animation. Aron started the stream by publishing JavaScript in Webflow, so you could see the advantages of cmd+s over the publish flow. Those few seconds it takes to publish your Webflow project feel like eternity when you've just forgotten to add a comma. ;) If you didn't see...","campaignId":15224184,"publicationId":11748930},{"id":5493566,"title":"Cache busting ๐Ÿ’ฅ","slug":"cache-busting","status":"published","readingTime":2,"campaignCompletedAt":"2024-05-03T21:43:11.000Z","publishedAt":"2024-05-03T21:43:11.000Z","orderByDate":"2024-05-03T21:43:11.000Z","timeAgo":"16 days","thumbnailUrl":"https://embed.filekitcdn.com/e/f2wTcXHNz6CCWc9a5vGTv3/6jwDYWaxRSexr6X7obqGGi","thumbnailAlt":null,"path":"posts/cache-busting","url":"https://slater.ck.page/posts/cache-busting","isPaid":null,"introContent":"More and more Slater-powered Webflow projects are running in production! So, let's talk about what that means. Slater works a little differently in a production environment. Instead of serving a file from the Slater server, we serve a file from Amazon S3. The S3 file is extremely resilient, and by default, it is cached by the browser. When your site doesn't seem to be updated, even after publishing changes, it's likely a caching issue. Your browser is simply not getting the latest copy of the...","campaignId":15154144,"publicationId":11678921}],"newsletter":{"formId":4967504,"productId":null,"productUrl":null,"featuredPostId":null,"subscribersOnly":false},"isPaidSubscriber":false,"isSubscriber":false,"originUrl":"https://slater.ck.page/posts/thanks-for-sharing-slater-app","creatorProfileName":"Welcome To Slater!","creatorProfileId":1135261}Thanks for sharing Slater.app ๐Ÿ™
profile

Welcome To Slater!

Thanks for sharing Slater.app ๐Ÿ™

Published 2 months agoย โ€ขย 2 min read

๐Ÿ‘‹,

โ€‹

โ€‹

โ€‹

On Sunday, @ransegall shared an issue he had with CodeSandbox. Several of you responded with helpful comments suggesting Slater.app as a good solution for Ran.

Thank you for doing that @HalZeitlin, @josiahduenes, @jeffamcavoy, @andressentis, @DMendoza1999, @jarekkowalczyk, @adidascal, @JoaoPSoliva, @etybura, and anyone we may have missed for .

And welcome to the fold, Ran! Let us know what you build.


More scripts!

Next week, we will give you more control over your Slater scripts. While the existing single script functionality will remain unchanged, you'll now have the option to include single-page scripts. Additionally, you'll have staging or production-only scripts, providing you control over the scope and load events of your JavaScript.

Witt will be recording a Slater.app Sessions video to thoroughly explain this functionality.


Javascript 101: JS Libraries in Webflow

JavaScript libraries play a crucial role in providing functionality and interactivity to Webflow projects. They make learning JavaScript worthwhile. Whether you want to create smooth animations, implement scroll interactions, or add dynamic elements to your site, leveraging an existing JS library is a wise choice.

Let's explore a framework for implementing JavaScript libraries in your Webflow projects, using examples from commonly used libraries.

1. Understand the Library's Purpose and Documentation

Before diving into implementation, take the time to understand the purpose and features of the JavaScript library you intend to use. Find the documentation, explore a demo, and get familiar with the library's capabilities and limitations.

2. Add the Library to Your Project

Begin by adding the JavaScript library to your Webflow project. This typically involves including the library's JavaScript file directly or linking to it from a Content Delivery Network (CDN). You can often add a CDN directly as a Slater external script, but sometimes, like with GSAP, you need to add it directly to Webflow.

<!-- GSAP -->โ€‹
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"></script>

3. Initialize the Library

Once the library is added, you can begin leveraging its features within your Webflow project. Start with a very basic example. For instance, let's create a simple animation using GSAP and trigger it on a button click:

// GSAP Animationโ€‹
const button = document.querySelector('.my-button');
button.addEventListener('click', () => {
gsap.to('.my-element', { duration: 1, x: 100, opacity: 0 });
});

4. Add Additional Features

After getting a basic implementation of the library working in your Webflow project, start to explore and add additional configurations and functionality. Review the documentation and iterate as needed, making adjustments or optimizations based on testing results to ensure optimal performance.

// GSAP Animationโ€‹
const button = document.querySelector('.my-button');
const elements = document.querySelectorAll('.my-element');
โ€‹
button.addEventListener('click', () => {
gsap.from(elements, {
duration: 1,
x: -100,
opacity: 0,
stagger: 0.2,
ease: "power2.out"
});
});

5. Finalize Your Implementation

Once you have the implementation working correctly, revisit the code and refactor it. Remove any dead code and simplify the remaining code. Document where needed for yourself and future collaborators.

--

Call to Action

This weekend, try implementing a new JS library in your project, and share your favorite JS libraries with us. We'll use your favorite libraries for future JavaScript tutorials.

Happy coding!

โ€‹

๐Ÿค™ The Slater team


โ€‹

๐Ÿ™ If Slater helps you create better websites, please support the team behind it.

โ€‹
โ€‹
1295 Canyon View Rd, Midway, UT 84049
โ€‹Unsubscribe ยท Preferencesโ€‹

โ€‹

Welcome To Slater!

Sign up for early access and weekly resources in your inbox

Slater resources, updates and community activity

Read more from Welcome To Slater!

You can now use OpenAI's latest and most powerful language model, GPT 4o, with Slater AI. We've been testing GPT 4o this week and Slater AI's capabilities are better and faster than ever! Along with the new model, we implemented several improvements to Slater AI. Slater AI will now give more Slater and Webflow relevant answers since we give Slater AI contextual understanding (h/t tdlabs.ca). We also improved the messages parsing (h/t @jeffamcavoy). Slater Sessions Slater Sessions are back! In...

2 days agoย โ€ขย 2 min read

We were excited to be invited back on an official Webflow livestream this week. This time, Slater played a supporting role on "Learn GSAP for Webflow." Aron and Cassie did an incredible job building a really cool GSAP animation. Aron started the stream by publishing JavaScript in Webflow, so you could see the advantages of cmd+s over the publish flow. Those few seconds it takes to publish your Webflow project feel like eternity when you've just forgotten to add a comma. ;) If you didn't see...

9 days agoย โ€ขย 1 min read

More and more Slater-powered Webflow projects are running in production! So, let's talk about what that means. Slater works a little differently in a production environment. Instead of serving a file from the Slater server, we serve a file from Amazon S3. The S3 file is extremely resilient, and by default, it is cached by the browser. When your site doesn't seem to be updated, even after publishing changes, it's likely a caching issue. Your browser is simply not getting the latest copy of the...

16 days agoย โ€ขย 2 min read
Share this post