How can I create a looped distortion effect on a selected picture in Webflow without any interaction on hover?

TL;DR

To create a looped distortion effect on a selected picture in Webflow without any interaction on hover, you can utilize CSS animations and the Transform property. Here's a step-by-step guide:

​

1. First, select the picture you want to apply the distortion effect to. You can do this by either using an Image element in Webflow or applying a background image to a specific section.

​

2. Give the picture a class name. You can do this by selecting the picture and navigating to the Element Settings panel on the right-hand side. In the Class field, enter a unique name for your class, such as "distortion-effect".

​

3. Now, head over to the Styles panel and select the class you just created. You'll have access to various CSS properties to style your picture.

​

4. To create the distortion effect, we'll be using CSS keyframe animations. Keyframe animations allow you to define specific styles at different points in time. Add the following custom code within the `<style>` tags in the head of your Webflow project:

​

```css

@keyframes distortion {

  0%   { transform: scale(1) rotate(0deg); }

  50%  { transform: scale(1.1) rotate(2deg); }

  100% { transform: scale(0.9) rotate(-2deg); }

}

​

.distortion-effect {

  animation: distortion 5s ease-in-out infinite;

}

```

​

In the example above, we've defined a keyframe animation called "distortion" that includes three keyframes:

​

- At the 0% mark, the image has no distortion.

- At the 50% mark, the image is scaled up slightly and rotated clockwise.

- At the 100% mark, the image is scaled down slightly and rotated counter-clockwise.

​

Feel free to adjust the values within the `transform` property to achieve the desired distortion effect.

​

5. With the custom code added, go back to Webflow and publish your site or update the page preview. The selected picture should now have a looped distortion effect applied to it, without any interaction needed.

​

Please note that applying CSS animations to images may not be supported in all browsers or devices. Test your design across different browsers and devices to ensure a consistent experience for your users.

Rate this answer

Other Webflow Questions