Ken Burns Effect using Custom CSS

This application note provides an example of how to add a Ken Burns effect to a Slideshow block using custom CSS.

Using the Ken Burns Effect block

  1. Download this block (but do not unpack the ZIP file).
  2. In the Blocks editor at the Display page, import the block using the Import ZIP file command on the Block menu.
  3. Drag the Ken Burns Effect block onto a Display Spot and watch the slides slowly zoom in while playing.

Behind the scenes

The custom CSS code, which can be viewed by clicking the pen icon in the "Custom CSS URL" field of the slideshow, looks like this:

.slide-show .slide-show-slides .active-slide {
    animation-name: ken-burns;
    animation-duration: 11s;
    animation-timing-function: linear;
}

@keyframes ken-burns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

A CSS @keyframes animation (named ken-burns) zooms in on the image by scaling it to 1.2 times its size (using transform: scale()). The .active-slide class, which is automatically added by Blocks to the currently playing slide, runs the ken-burns animation for 11 seconds.

A couple of notes regarding the methods used in this application note: