\n
```
\nHow It Works:
\nCSS Transitions: We apply a transition to smoothly change the background color. In this case, the box will smoothly transition its color when it reaches certain stages in the animation.
\nCSS Animations: We use @keyframes to animate the box’s movement from left to right, changing its position and color at key stages (0%, 50%, and 100%).
\nUser Interaction: Clicking the button adds the animate class to the box, triggering the movement and color change. The animation takes 2 seconds to complete, and the background color smoothly transitions thanks to the transition property.
\nThis approach integrates both CSS transitions for smooth property changes and CSS animations for complex, multi-step movements. By combining them, you can create more engaging user interactions with minimal JavaScript, leveraging the power of CSS for visual effects.
\nHappy coding!
\n
\n🤙 the Slater Team
\n
\n
\nIf Slater helps you create better websites, please support the team behind it.
\nBecome a Pro Slater User |
Last week, we announced that CSS updates were on the way—and now they're here! You can now generate CSS files just as quickly and easily as JS files. In the video below, we give a quick demo of the new functionality. If you have a Smart Script loaded in your project, you can instantly add CSS. In the demo, we also show how to add CSS in the Webflow designer. Give it a try and let us know what you're building! Community Library🖍️ Text Highlight Color 🅰 Improved Font Rendering 📗 Richtext Reset Have you added a useful script to your library? Share it with us! -- Javascript 101: CSS & JS Part IIIn the last Javascript 101, we explored how to modify styles with JavaScript to create dynamic websites. We looked at manipulating inline styles, toggling CSS classes, and updating CSS variables to respond to user input. Each approach gave us a different level of control over styling changes, and by keeping animations smooth and maintainable, we can create interactive user experiences. Now, let’s combine what we learned last week with CSS transitions and animations. We’ll use CSS transitions for smooth property changes and @keyframes animations for more complex effects. ```
``` How It Works: CSS Transitions: We apply a transition to smoothly change the background color. In this case, the box will smoothly transition its color when it reaches certain stages in the animation. CSS Animations: We use @keyframes to animate the box’s movement from left to right, changing its position and color at key stages (0%, 50%, and 100%). User Interaction: Clicking the button adds the animate class to the box, triggering the movement and color change. The animation takes 2 seconds to complete, and the background color smoothly transitions thanks to the transition property. This approach integrates both CSS transitions for smooth property changes and CSS animations for complex, multi-step movements. By combining them, you can create more engaging user interactions with minimal JavaScript, leveraging the power of CSS for visual effects. Happy coding! 🤙 the Slater Team If Slater helps you create better websites, please support the team behind it.
|
Slater resources, updates and community activity
Do you get confused when undoing (cmd + z) in Slater? We auto-format your code on save. The auto-formatting updates your code, and those updates get pushed into the undo stack. You can now improve your workflow by formatting the code when you choose—not just on save. To gain more control over when your code formats: Turn off auto-format code in the Code Editor Settings Use cmd + shift + f to format your code We added a handful of other improvements: Console logs and debuggers are now...
Do you use Slater for CSS? CSS support in Slater has always been somewhat of an afterthought—JavaScript is our love language! But sometimes, you need a simple way to add CSS to your project. Maybe you want to write a complex grid or use a CSS property that Webflow doesn't support. That's why we've decided to make CSS a first-class citizen. We considered launching the new CSS functionality today, but we want to test it a bit more. Expect it early next week. To prepare for the launch, let's...
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...