β β β We're back from a company-wide summer pause (or winter pause for our Southern Hemisphere team members). Edgar Allan is hitting it's numbers! β Let's look at some new Community Library scripts: β π Dynamically loads HTML content based on a random number. This is a quick script we wrote to give a dynamic intro into a soon-to-be-released https://edgarallan.com. βhttps://slater.app/community_library/random-content-aee7f7f2-3ab8-4e6f-887e-ea54cad0ebbfβ From Jared Malanββ β βοΈ Create a variable for your state machine inputs by input name. This script comes in from @jeffamcavoy who is launching a Rive Animation course. Check it out if you want to add more movement to your Webflow project. From jeffamcavoyβ β π Smooth scrolling setup using Lenis library with scroll event logging. @SarkisBuniatyan posted a simple way to add Lenis to your Webflow project. The only faster way--one that gives you full control--is to grab this script and add it to your active Slater project. βhttps://slater.app/community_library/lenis-smooth-scrolling-352b7c92-921d-44e8-a051-c462dd64043dβ From Jared Malanββ β Javascript 101: Javascript MathLet's build off of the random dynamic loading script highlighted at the beginning of this email. To create that experience, we needed to generate a random number. Luckily this is fairly trivial because of Javascript's built-in math capabilities. Some of the Math functions are super useful (e.g. random numbers, rounding) for even the most basic Javascript developers. Others will only be used by the most seasoned. Basic ArithmeticYou can use the standard arithmetic operators for basic calculations:
Math ObjectThe Constants
Rounding Functions
Random Numbers
To get a random number between a specified range:
Absolute Value
Trigonometric Functions
Other Useful Functions
This should give you a good starting point for working with math in JavaScript! If you have any specific questions or need more details, feel free to ask. β Your projects, supported by SlaterLet's hear it for @jeffamcavoy again!
β Also thanks for including us in this AI tools rundown βheyanirudhgoelβ! Check out the other tools to supercharge your workflow.
β β Happy coding! π€ the Slater Team β If Slater helps you create better websites, please support the team behind it.
|
Slater resources, updates and community activity
You may recall that the original Slater had access controls for projects and files. We didn't want just anyone going in there and rewriting our Javascript. However, managing access for teammates became cumbersome (I even added a "god mode" to give myself access to any project or file). Since we generally trusted each other and never had issues, we decided to leave it out of the latest version of Slater. That said, we understand that some teams work differently, and maintaining control can be...
We're going to take a brief break from the regular newsletter format to celebrate the release of ask.edgarallan.com. Today, let's hear from Mason Poe, the Founder of Edgar Allan and Slater. I'm thrilled to announce the launch of ask.edgarallan.com and the start of a new conversation. We can all feel it: the web is changing in ways that seem both dramatic and, in a weird way, imperceptible. At times, itβs hard to know where to start exploring what could be next. Sometimes, when you think...
Our new Edgar Allan website, which we're launching next week π€«, uses over 3,000 lines of code. Itβs a bit unwieldy! To better support the new EA website and similar JavaScript-heavy projects, weβve added slater_import. This feature allows you to write a function once and then reuse it across all the files in your project. You can see how to use it here. β¬οΈ Not ready to watch the video? No problem. To import a file, simply start typing the name of the file you want to import and click on the...